diff --git a/hardware/sam/cores/sam/build_gcc/libarduino_sam3s_ek.mk b/hardware/sam/cores/sam/build_gcc/libarduino_sam3s_ek.mk index 05c3b8c00..f48ee8891 100644 --- a/hardware/sam/cores/sam/build_gcc/libarduino_sam3s_ek.mk +++ b/hardware/sam/cores/sam/build_gcc/libarduino_sam3s_ek.mk @@ -69,7 +69,7 @@ C_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.c) C_OBJ_TEMP = $(patsubst %.c, %.o, $(notdir $(C_SRC))) # during development, remove some files -C_OBJ_FILTER=wiring_analog.o wiring_pulse.o +C_OBJ_FILTER=wiring_analog.o wiring_pulse.o dlib_lowlevel_sam3.o C_OBJ=$(filter-out $(C_OBJ_FILTER), $(C_OBJ_TEMP)) diff --git a/hardware/sam/system/libsam/build_gcc/sam3.mk b/hardware/sam/system/libsam/build_gcc/sam3.mk index 81a2d90e1..51135bed0 100644 --- a/hardware/sam/system/libsam/build_gcc/sam3.mk +++ b/hardware/sam/system/libsam/build_gcc/sam3.mk @@ -121,10 +121,10 @@ $(CHIP): create_output $(OUTPUT_LIB) create_output: @echo --- Preparing $(CHIP) files $(OUTPUT_PATH) $(OUTPUT_BIN) @echo ------------------------- -# @echo *$(C_SRC) -# @echo ------------------------- -# @echo *$(C_OBJ) -# @echo ------------------------- + @echo *$(C_SRC) + @echo ------------------------- + @echo *$(C_OBJ) + @echo ------------------------- # @echo *$(addprefix $(OUTPUT_PATH)/, $(C_OBJ)) # @echo ------------------------- # @echo *$(A_SRC) diff --git a/hardware/sam/system/libsam/cmsis/sam3s/source/templates/exceptions.c b/hardware/sam/system/libsam/cmsis/sam3s/source/templates/exceptions.c index 5ed6a5892..ae895cc17 100644 --- a/hardware/sam/system/libsam/cmsis/sam3s/source/templates/exceptions.c +++ b/hardware/sam/system/libsam/cmsis/sam3s/source/templates/exceptions.c @@ -31,9 +31,9 @@ extern "C" { #ifdef __GNUC__ /* Cortex-M3 core handlers */ -extern void Reset_Handler( void ) __attribute__ ((weak, alias ("Dummy_Handler"))) ; +//extern void Reset_Handler( void ) __attribute__ ((weak, alias ("Dummy_Handler"))) ; extern void NMI_Handler( void ) __attribute__ ((weak, alias ("Dummy_Handler"))) ; -extern void HardFault_Handler( void ) __attribute__ ((weak, alias ("Dummy_Handler"))) ; +//extern void HardFault_Handler( void ) __attribute__ ((weak, alias ("Dummy_Handler"))) ; extern void MemManage_Handler( void ) __attribute__ ((weak, alias ("Dummy_Handler"))) ; extern void BusFault_Handler( void ) __attribute__ ((weak, alias ("Dummy_Handler"))) ; extern void UsageFault_Handler( void ) __attribute__ ((weak, alias ("Dummy_Handler"))) ; diff --git a/hardware/sam/system/libsam/cmsis/sam3s/source/templates/gcc/startup_sam3s.c b/hardware/sam/system/libsam/cmsis/sam3s/source/templates/gcc/startup_sam3s.c index 7cd2a981c..671757e0d 100644 --- a/hardware/sam/system/libsam/cmsis/sam3s/source/templates/gcc/startup_sam3s.c +++ b/hardware/sam/system/libsam/cmsis/sam3s/source/templates/gcc/startup_sam3s.c @@ -73,7 +73,7 @@ IntFunc exception_table[] = { /* Configure Initial Stack Pointer, using linker-generated symbols */ (IntFunc)(&pdwStack[STACK_SIZE-1]), - ResetException, + Reset_Handler, NMI_Handler, HardFault_Handler, @@ -134,7 +134,7 @@ IntFunc exception_table[] = { * \brief This is the code that gets called on processor reset. * To initialize the device, and call the main() routine. */ -void ResetException( void ) +void Reset_Handler( void ) { uint32_t *pSrc, *pDest ; diff --git a/hardware/sam/system/libsam/cmsis/sam3s/source/templates/system_sam3s.c b/hardware/sam/system/libsam/cmsis/sam3s/source/templates/system_sam3s.c index 06fb57631..7034b0902 100644 --- a/hardware/sam/system/libsam/cmsis/sam3s/source/templates/system_sam3s.c +++ b/hardware/sam/system/libsam/cmsis/sam3s/source/templates/system_sam3s.c @@ -132,7 +132,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/variants/common/UART.h b/hardware/sam/variants/common/UART.h index 6f77ff9cf..ccf5f18e6 100644 --- a/hardware/sam/variants/common/UART.h +++ b/hardware/sam/variants/common/UART.h @@ -26,9 +26,12 @@ class UARTClass : public HardwareSerial void IrqHandler( void ) ; +#if defined __GNUC__ /* GCC CS3 */ + using Print::write ; // pull in write(str) and write(buf, size) from Print +#elif defined __ICCARM__ /* IAR Ewarm 5.41+ */ virtual void write( const char *str ) ; virtual void write( const uint8_t *buffer, size_t size ) ; -// using Print::write ; // pull in write(str) and write(buf, size) from Print +#endif }; #endif // _UART_CLASS_ diff --git a/hardware/sam/variants/common/USART.h b/hardware/sam/variants/common/USART.h index 1cd638580..197ffeb65 100644 --- a/hardware/sam/variants/common/USART.h +++ b/hardware/sam/variants/common/USART.h @@ -26,9 +26,12 @@ class USARTClass : public HardwareSerial void IrqHandler( void ) ; +#if defined __GNUC__ /* GCC CS3 */ + using Print::write ; // pull in write(str) and write(buf, size) from Print +#elif defined __ICCARM__ /* IAR Ewarm 5.41+ */ virtual void write( const char *str ) ; virtual void write( const uint8_t *buffer, size_t size ) ; -// using Print::write ; // pull in write(str) and write(buf, size) from Print +#endif }; #endif // _USART_CLASS_ diff --git a/hardware/sam/variants/sam3s_ek/build_gcc/libvariant_sam3s_ek.mk b/hardware/sam/variants/sam3s_ek/build_gcc/libvariant_sam3s_ek.mk index 684a60cc9..9c225d6d7 100644 --- a/hardware/sam/variants/sam3s_ek/build_gcc/libvariant_sam3s_ek.mk +++ b/hardware/sam/variants/sam3s_ek/build_gcc/libvariant_sam3s_ek.mk @@ -139,7 +139,7 @@ $(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c $(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.o: %.cpp # @$(CC) -c $(CPPFLAGS) $< -o $@ - $(CC) -xc++ -c $(CPPFLAGS) $< -o $@ + @$(CC) -xc++ -c $(CPPFLAGS) $< -o $@ $(addprefix $(OUTPUT_PATH)/,$(A_OBJ)): $(OUTPUT_PATH)/%.o: %.s @$(AS) -c $(ASFLAGS) $< -o $@ diff --git a/hardware/sam/variants/sam3s_ek/variant.h b/hardware/sam/variants/sam3s_ek/variant.h index ba39bfbef..35838a686 100644 --- a/hardware/sam/variants/sam3s_ek/variant.h +++ b/hardware/sam/variants/sam3s_ek/variant.h @@ -33,10 +33,10 @@ /** Name of the board */ #define VARIANT_NAME "SAM3S-EK" -/* #define VARIANT_REV_A -*/ +/* #define VARIANT_REV_B +*/ /** Frequency of the board main oscillator */ #define VARIANT_MAINOSC 12000000