From b014d9eacddd5d6ae2bebdd49acb499fa85c100f Mon Sep 17 00:00:00 2001 From: Thibaut VIARD Date: Tue, 13 Sep 2011 11:18:38 +0200 Subject: [PATCH] [sam] led blink working on SAM3U-EK using validation app --- hardware/sam/sam.bat | 4 ++++ .../cmsis/sam3s/source/templates/gcc/startup_sam3s.c | 1 - .../libsam/cmsis/sam3u/source/templates/exceptions.c | 8 ++++---- .../cmsis/sam3u/source/templates/gcc/startup_sam3u.c | 5 ++--- hardware/sam/variants/sam3u_ek/variant.cpp | 6 +++--- 5 files changed, 13 insertions(+), 11 deletions(-) create mode 100644 hardware/sam/sam.bat diff --git a/hardware/sam/sam.bat b/hardware/sam/sam.bat new file mode 100644 index 000000000..12d501ea2 --- /dev/null +++ b/hardware/sam/sam.bat @@ -0,0 +1,4 @@ +start "libsam" /d"system\libsam\build_gcc" /max "cd" +start "libarduino" /d"cores\sam\build_gcc" /max "cd" +start "libvariant sam3u-ek" /d"variants\sam3u_ek\build_gcc" /max "cd" +start "test" /d"cores\sam\validation\build_gcc" /max "cd" \ No newline at end of file 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 671757e0d..aa1a73ebc 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 @@ -61,7 +61,6 @@ extern uint32_t _ezero; /** \cond DOXYGEN_SHOULD_SKIP_THIS */ extern int main( void ) ; /** \endcond */ -void ResetException( void ) ; extern void __libc_init_array( void ) ; /*------------------------------------------------------------------------------ diff --git a/hardware/sam/system/libsam/cmsis/sam3u/source/templates/exceptions.c b/hardware/sam/system/libsam/cmsis/sam3u/source/templates/exceptions.c index 246eb65e4..2afa37023 100644 --- a/hardware/sam/system/libsam/cmsis/sam3u/source/templates/exceptions.c +++ b/hardware/sam/system/libsam/cmsis/sam3u/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"))) ; @@ -77,9 +77,9 @@ extern void UDPHS_IrqHandler( void ) __attribute__ ((weak, alias ("Dummy_Handler #ifdef __ICCARM__ /* Cortex-M3 core handlers */ -#pragma weak Reset_Handler=Dummy_Handler +//#pragma weak Reset_Handler=Dummy_Handler #pragma weak NMI_Handler=Dummy_Handler -#pragma weak HardFault_Handler=Dummy_Handler +//#pragma weak HardFault_Handler=Dummy_Handler #pragma weak MemManage_Handler=Dummy_Handler #pragma weak BusFault_Handler=Dummy_Handler #pragma weak UsageFault_Handler=Dummy_Handler diff --git a/hardware/sam/system/libsam/cmsis/sam3u/source/templates/gcc/startup_sam3u.c b/hardware/sam/system/libsam/cmsis/sam3u/source/templates/gcc/startup_sam3u.c index d53b9ae57..f1f499399 100644 --- a/hardware/sam/system/libsam/cmsis/sam3u/source/templates/gcc/startup_sam3u.c +++ b/hardware/sam/system/libsam/cmsis/sam3u/source/templates/gcc/startup_sam3u.c @@ -46,7 +46,6 @@ extern uint32_t _ezero; /** \cond DOXYGEN_SHOULD_SKIP_THIS */ extern int main( void ) ; /** \endcond */ -void ResetException( void ) ; extern void __libc_init_array( void ) ; /*------------------------------------------------------------------------------ @@ -58,7 +57,7 @@ IntFunc exception_table[] = { /* Configure Initial Stack Pointer, using linker-generated symbols */ (IntFunc)(&pdwStack[STACK_SIZE-1]), - ResetException, + Reset_Handler, NMI_Handler, HardFault_Handler, MemManage_Handler, @@ -113,7 +112,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/variants/sam3u_ek/variant.cpp b/hardware/sam/variants/sam3u_ek/variant.cpp index 6cfbf04e9..e9fa1e330 100644 --- a/hardware/sam/variants/sam3u_ek/variant.cpp +++ b/hardware/sam/variants/sam3u_ek/variant.cpp @@ -10,7 +10,7 @@ extern const PinDescription g_APinDescription[]= { // LEDS, 0..2 - { PIOB, PIO_PB0, ID_PIOB, PIO_OUTPUT_1, PIO_DEFAULT }, // LED BLUE + { PIOB, PIO_PB0, ID_PIOB, PIO_OUTPUT_0, PIO_DEFAULT }, // LED BLUE { PIOB, PIO_PB1, ID_PIOB, PIO_OUTPUT_1, PIO_DEFAULT }, // LED GREEN { PIOB, PIO_PB2, ID_PIOB, PIO_OUTPUT_1, PIO_DEFAULT }, // LED RED @@ -23,8 +23,8 @@ extern const PinDescription g_APinDescription[]= { PIOA, PIO_PA11A_URXD|PIO_PA12A_UTXD, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT }, // All UART pins // Push buttons, 7..8 - { PIOA, PIO_PA18, ID_PIOA, PIO_INPUT, PIO_PULLUP | PIO_DEBOUNCE | PIO_IT_RISE_EDGE }, // PB_LEFT - { PIOA, PIO_PA19, ID_PIOA, PIO_INPUT, PIO_PULLUP | PIO_DEBOUNCE | PIO_IT_FALL_EDGE }, // PB_RIGHT + { PIOA, PIO_PA18, ID_PIOA, PIO_INPUT, PIO_PULLUP | PIO_DEGLITCH }, // PB_LEFT + { PIOA, PIO_PA19, ID_PIOA, PIO_INPUT, PIO_PULLUP | PIO_DEGLITCH }, // PB_RIGHT // MCI (SDCARD), 9..19 { PIOA, PIO_PA25, ID_PIOA, PIO_INPUT, PIO_PULLUP }, // MCI Card Detect