diff --git a/hardware/sam/cores/sam/build_gcc/Makefile b/hardware/sam/cores/sam/build_gcc/Makefile index f6d40e422..c938789f1 100644 --- a/hardware/sam/cores/sam/build_gcc/Makefile +++ b/hardware/sam/cores/sam/build_gcc/Makefile @@ -1,5 +1,5 @@ -# Makefile for compiling libboard -BOARD = +#VARIANTS = sam3s_ek sam3u_ek arduino_due +VARIANTS = sam3u_ek SUBMAKE_OPTIONS=--no-builtin-rules --no-builtin-variables @@ -7,18 +7,38 @@ SUBMAKE_OPTIONS=--no-builtin-rules --no-builtin-variables # Rules #------------------------------------------------------------------------------- -all: sam3s_ek +all: $(VARIANTS) -.PHONY: sam3s_ek +.PHONY: sam3s_ek sam3s_ek: @echo --- Making sam3s_ek @$(MAKE) DEBUG=1 $(SUBMAKE_OPTIONS) -f libarduino_sam3s_ek.mk # @$(MAKE) $(SUBMAKE_OPTIONS) -f libarduino_sam3s_ek.mk +.PHONY: sam3u_ek +sam3u_ek: + @echo --- Making sam3u_ek + @$(MAKE) DEBUG=1 $(SUBMAKE_OPTIONS) -f libarduino_sam3u_ek.mk +# @$(MAKE) $(SUBMAKE_OPTIONS) -f libarduino_sam3u_ek.mk + +.PHONY: arduino_due +arduino_due: + @echo --- Making arduino_due + @$(MAKE) DEBUG=1 $(SUBMAKE_OPTIONS) -f libarduino_arduino_due.mk +# @$(MAKE) $(SUBMAKE_OPTIONS) -f libarduino_arduino_due.mk + .PHONY: clean clean: @echo --- Cleaning sam3s_ek @$(MAKE) DEBUG=1 $(SUBMAKE_OPTIONS) -f libarduino_sam3s_ek.mk $@ # @$(MAKE) $(SUBMAKE_OPTIONS) -f libarduino_sam3s_ek.mk $@ + @echo --- Cleaning sam3u_ek + @$(MAKE) DEBUG=1 $(SUBMAKE_OPTIONS) -f libarduino_sam3u_ek.mk $@ +# @$(MAKE) $(SUBMAKE_OPTIONS) -f libarduino_sam3u_ek.mk $@ + + @echo --- Cleaning arduino_due + @$(MAKE) DEBUG=1 $(SUBMAKE_OPTIONS) -f libarduino_arduino_due.mk $@ +# @$(MAKE) $(SUBMAKE_OPTIONS) -f libarduino_arduino_due.mk $@ + diff --git a/hardware/sam/cores/sam/validation/build_gcc/test.mk b/hardware/sam/cores/sam/validation/build_gcc/test.mk index 41c384c9a..7d6fed01a 100644 --- a/hardware/sam/cores/sam/validation/build_gcc/test.mk +++ b/hardware/sam/cores/sam/validation/build_gcc/test.mk @@ -1,9 +1,10 @@ # Makefile for compiling libArduino .SUFFIXES: .o .a .c .s -CHIP=__SAM3S4C__ -VARIANT=sam3s_ek -#VARIANT=sam3u_ek +#CHIP=__SAM3S4C__ +CHIP=__SAM3U4E__ +#VARIANT=sam3s_ek +VARIANT=sam3u_ek #VARIANT=arduino_due TOOLCHAIN=gcc diff --git a/hardware/sam/system/libsam/cmsis/sam3u/source/templates/system_sam3u.c b/hardware/sam/system/libsam/cmsis/sam3u/source/templates/system_sam3u.c index 926f3797f..c107e5ed1 100644 --- a/hardware/sam/system/libsam/cmsis/sam3u/source/templates/system_sam3u.c +++ b/hardware/sam/system/libsam/cmsis/sam3u/source/templates/system_sam3u.c @@ -40,7 +40,7 @@ extern "C" { #define EFRC_OSC ( 4000000UL) /* Embedded fast RC oscillator freq */ #define UTMIPLL (480000000UL) /* UTMI PLL frequency */ #define MAINCK_XTAL_HZ (12000000UL) /* External crystal frequency */ -#define MCK_HZ (48000000UL) /* Processor frequency */ +#define MCK_HZ (96000000UL) /* Processor frequency */ /* FIXME: should be generated by sock */ uint32_t SystemCoreClock = EFRC_OSC; @@ -134,7 +134,7 @@ extern void SystemCoreClockUpdate( void ) break; } } - if (PMC->PMC_MCKR & PMC_MCKR_CSS_Msk == PMC_MCKR_CSS_PLLA_CLK) { + if ((PMC->PMC_MCKR & PMC_MCKR_CSS_Msk) == PMC_MCKR_CSS_PLLA_CLK) { SystemCoreClock *= ((((PMC->CKGR_PLLAR) >> CKGR_PLLAR_MULA_Pos) & 0x7FF) + 1); SystemCoreClock /= ((((PMC->CKGR_PLLAR) >> CKGR_PLLAR_DIVA_Pos) & 0x0FF)); } diff --git a/hardware/sam/system/libsam/include/pmc.h b/hardware/sam/system/libsam/include/pmc.h index 03f9d9601..e41138a30 100644 --- a/hardware/sam/system/libsam/include/pmc.h +++ b/hardware/sam/system/libsam/include/pmc.h @@ -21,7 +21,7 @@ extern void PMC_EnablePeripheral( uint32_t dwId ) ; extern void PMC_DisablePeripheral( uint32_t dwId ) ; -extern uint32_t PMC_IsPeriphEnabled( uint32_t dwId ) ; +extern uint32_t PMC_IsPeripheralEnabled( uint32_t dwId ) ; #ifdef __cplusplus } diff --git a/hardware/sam/system/libsam/include/spi.h b/hardware/sam/system/libsam/include/spi.h index bd44c905e..595708081 100644 --- a/hardware/sam/system/libsam/include/spi.h +++ b/hardware/sam/system/libsam/include/spi.h @@ -70,6 +70,7 @@ extern void SPI_Write( Spi* spi, uint32_t dwNpcs, uint16_t wData ) ; extern uint32_t SPI_GetStatus( Spi* spi ) ; extern uint32_t SPI_IsFinished( Spi* pSpi ) ; +#if (defined _SAM3S_) || (defined _SAM3S8_) || (defined _SAM3N_) extern void SPI_PdcEnableTx( Spi* spi ) ; extern void SPI_PdcDisableTx( Spi* spi ) ; extern void SPI_PdcEnableRx( Spi* spi ) ; @@ -81,6 +82,7 @@ extern void SPI_PdcSetRx( Spi* spi, void* pvRxBuf, uint32_t dwRxCount, void* pvR extern uint32_t SPI_WriteBuffer( Spi* spi, void* pvBuffer, uint32_t dwLength ) ; extern uint32_t SPI_ReadBuffer( Spi* spi, void* pvBuffer, uint32_t dwLength ) ; +#endif /* (defined _SAM3S_) || (defined _SAM3S8_) || (defined _SAM3N_) */ #ifdef __cplusplus } diff --git a/hardware/sam/system/libsam/source/spi.c b/hardware/sam/system/libsam/source/spi.c index d4f708d83..caf58e00d 100644 --- a/hardware/sam/system/libsam/source/spi.c +++ b/hardware/sam/system/libsam/source/spi.c @@ -183,6 +183,7 @@ extern uint32_t SPI_IsFinished( Spi* spi ) return ((spi->SPI_SR & SPI_SR_TXEMPTY) != 0) ; } +#if (defined _SAM3S_) || (defined _SAM3S8_) || (defined _SAM3N_) /** * \brief Enable Spi PDC transmit * \param spi Pointer to an Spi instance. @@ -322,4 +323,5 @@ extern uint32_t SPI_ReadBuffer( Spi* spi, void *pvBuffer, uint32_t dwLength ) return 0 ; } +#endif /* (defined _SAM3S_) || (defined _SAM3S8_) || (defined _SAM3N_) */