1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-02 13:24:12 +01:00

[sam] test app (led blink) working using GCC and GDB server for debug

This commit is contained in:
Thibaut VIARD 2011-09-10 23:54:56 +02:00
parent 2963a37075
commit 0c2bba55c8
9 changed files with 21 additions and 15 deletions

View File

@ -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))

View File

@ -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)

View File

@ -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"))) ;

View File

@ -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 ;

View File

@ -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));
}

View File

@ -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_

View File

@ -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_

View File

@ -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 $@

View File

@ -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