summaryrefslogtreecommitdiff
path: root/nuttx
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2013-06-27 14:24:27 -0600
committerGregory Nutt <gnutt@nuttx.org>2013-06-27 14:24:27 -0600
commit3739d5f33e73675fc0bdd0dc600bb39ed30b23b8 (patch)
tree51642eac4b6c9adb85861210226d96ba5883452c /nuttx
parentd5e65458491f91198ae56185f4e692061b2c49ce (diff)
downloadnuttx-3739d5f33e73675fc0bdd0dc600bb39ed30b23b8.tar.gz
nuttx-3739d5f33e73675fc0bdd0dc600bb39ed30b23b8.tar.bz2
nuttx-3739d5f33e73675fc0bdd0dc600bb39ed30b23b8.zip
Flesh out the Arduino Due board configuratino and integrate it with the build and configuration system
Diffstat (limited to 'nuttx')
-rw-r--r--nuttx/ChangeLog4
-rw-r--r--nuttx/arch/arm/include/sam34/chip.h14
-rw-r--r--nuttx/arch/arm/src/sam34/Kconfig30
-rw-r--r--nuttx/arch/arm/src/sam34/sam3u_dmac.c2
-rw-r--r--nuttx/configs/Kconfig16
-rw-r--r--nuttx/configs/README.txt4
-rw-r--r--nuttx/configs/arduino-due/Kconfig7
-rw-r--r--nuttx/configs/arduino-due/README.txt144
-rw-r--r--nuttx/configs/arduino-due/include/board.h243
-rw-r--r--nuttx/configs/arduino-due/ostest/Make.defs107
-rw-r--r--nuttx/configs/arduino-due/ostest/defconfig628
-rwxr-xr-xnuttx/configs/arduino-due/ostest/setenv.sh75
-rwxr-xr-xnuttx/configs/arduino-due/scripts/ld.script123
-rw-r--r--nuttx/configs/arduino-due/src/Makefile96
-rw-r--r--nuttx/configs/arduino-due/src/arduino-due.h130
-rw-r--r--nuttx/configs/arduino-due/src/sam_autoleds.c170
-rw-r--r--nuttx/configs/arduino-due/src/sam_boot.c75
-rw-r--r--nuttx/configs/arduino-due/src/sam_cxxinitialize.c154
-rw-r--r--nuttx/configs/arduino-due/src/sam_userleds.c141
-rw-r--r--nuttx/configs/sam3u-ek/README.txt6
-rw-r--r--nuttx/configs/sam3u-ek/include/board.h2
-rw-r--r--nuttx/configs/sam3u-ek/knsh/defconfig2
-rw-r--r--nuttx/configs/sam3u-ek/nsh/defconfig14
-rw-r--r--nuttx/configs/sam3u-ek/nx/defconfig2
-rw-r--r--nuttx/configs/sam3u-ek/ostest/defconfig2
-rwxr-xr-xnuttx/configs/sam3u-ek/scripts/ld.script2
-rw-r--r--nuttx/configs/sam3u-ek/scripts/memory.ld2
-rw-r--r--nuttx/configs/sam3u-ek/src/sam3u-ek.h2
-rw-r--r--nuttx/configs/sam3u-ek/src/up_lcd.c2
-rw-r--r--nuttx/configs/sam4l-xplained/nsh/defconfig14
-rw-r--r--nuttx/configs/sam4l-xplained/ostest/defconfig2
-rw-r--r--nuttx/configs/sam4s-xplained/README.txt2
-rw-r--r--nuttx/configs/sam4s-xplained/include/board.h2
-rw-r--r--nuttx/configs/sam4s-xplained/nsh/defconfig14
-rw-r--r--nuttx/configs/sam4s-xplained/ostest/defconfig2
35 files changed, 2167 insertions, 68 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index a666e2fd2..d19e00884 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -5075,4 +5075,6 @@
* arch/arm/src and include/ and configs/sam*/: Large rename of all
references to SPI with SPI0. This is because all other SAMs have
only SPI but the 3X/3A have SPI0 and SPI1 (2013-6-26).
-
+ * configs/arduino-due: Complete the basic board configuration and
+ integrate this into the configuration and build system. The Arduino
+ Due is now ready to begin test (2013-6-17).
diff --git a/nuttx/arch/arm/include/sam34/chip.h b/nuttx/arch/arm/include/sam34/chip.h
index f1881d1f0..cd107d0e9 100644
--- a/nuttx/arch/arm/include/sam34/chip.h
+++ b/nuttx/arch/arm/include/sam34/chip.h
@@ -50,7 +50,7 @@
/* AT91SAM3U Family *****************************************************************/
-#if defined(CONFIG_ARCH_CHIP_AT91SAM3U4E)
+#if defined(CONFIG_ARCH_CHIP_ATSAM3U4E)
/* Internal memory */
@@ -95,7 +95,7 @@
* HSMCI 8 bit 4 bit 8 bit 4 bit 4 bit 4 bit
*/
-#elif defined(CONFIG_ARCH_CHIP_AT91SAM3X8E)
+#elif defined(CONFIG_ARCH_CHIP_ATSAM3X8E)
/* Internal memory */
@@ -115,7 +115,7 @@
# define SAM32_NUDPFS 0 /* No USB full speed device */
# define SAM32_NUHPFS 0 /* No USB full speed embedded host */
-#elif defined(CONFIG_ARCH_CHIP_AT91SAM3X8C)
+#elif defined(CONFIG_ARCH_CHIP_ATSAM3X8C)
/* Internal memory */
@@ -135,7 +135,7 @@
# define SAM32_NUDPFS 0 /* No USB full speed device */
# define SAM32_NUHPFS 0 /* No USB full speed embedded host */
-#elif defined(CONFIG_ARCH_CHIP_AT91SAM3X4E)
+#elif defined(CONFIG_ARCH_CHIP_ATSAM3X4E)
/* Internal memory */
@@ -155,7 +155,7 @@
# define SAM32_NUDPFS 0 /* No USB full speed device */
# define SAM32_NUHPFS 0 /* No USB full speed embedded host */
-#elif defined(CONFIG_ARCH_CHIP_AT91SAM3X4C)
+#elif defined(CONFIG_ARCH_CHIP_ATSAM3X4C)
/* Internal memory */
@@ -175,7 +175,7 @@
# define SAM32_NUDPFS 0 /* No USB full speed device */
# define SAM32_NUHPFS 0 /* No USB full speed embedded host */
-#elif defined(CONFIG_ARCH_CHIP_AT91SAM3A8C)
+#elif defined(CONFIG_ARCH_CHIP_ATSAM3A8C)
/* Internal memory */
@@ -195,7 +195,7 @@
# define SAM32_NUDPFS 0 /* No USB full speed device */
# define SAM32_NUHPFS 0 /* No USB full speed embedded host */
-#elif defined(CONFIG_ARCH_CHIP_AT91SAM3A4C)
+#elif defined(CONFIG_ARCH_CHIP_ATSAM3A4C)
/* Internal memory */
diff --git a/nuttx/arch/arm/src/sam34/Kconfig b/nuttx/arch/arm/src/sam34/Kconfig
index 28e49ab96..8ce877628 100644
--- a/nuttx/arch/arm/src/sam34/Kconfig
+++ b/nuttx/arch/arm/src/sam34/Kconfig
@@ -7,16 +7,16 @@ comment "AT91SAM3/4 Configuration Options"
choice
prompt "AT91SAM3/4 Chip Selection"
- default ARCH_CHIP_AT91SAM3U4E
+ default ARCH_CHIP_ATSAM3U4E
depends on ARCH_CHIP_SAM34
-config ARCH_CHIP_AT91SAM3U4E
- bool "AT91SAM3U4E"
+config ARCH_CHIP_ATSAM3U4E
+ bool "ATSAM3U4E"
select ARCH_CORTEXM3
select ARCH_CHIP_SAM3U
-config ARCH_CHIP_AT91SAM3X8E
- bool "AT91SAMSAM3X8E"
+config ARCH_CHIP_ATSAM3X8E
+ bool "ATSAMSAM3X8E"
select ARCH_CORTEXM3
select ARCH_CHIP_SAM3X
select ARCH_HAVE_EXTNOR
@@ -24,13 +24,13 @@ config ARCH_CHIP_AT91SAM3X8E
select ARCH_HAVE_EXTSRAM0
select ARCH_HAVE_EXTSRAM1
-config ARCH_CHIP_AT91SAM3X8C
- bool "AT91SAM3X8C"
+config ARCH_CHIP_ATSAM3X8C
+ bool "ATSAM3X8C"
select ARCH_CORTEXM3
select ARCH_CHIP_SAM3X
-config ARCH_CHIP_AT91SAM3X4E
- bool "AT91SAM3X4E"
+config ARCH_CHIP_ATSAM3X4E
+ bool "ATSAM3X4E"
select ARCH_CORTEXM3
select ARCH_CHIP_SAM3X
select ARCH_HAVE_EXTNOR
@@ -38,18 +38,18 @@ config ARCH_CHIP_AT91SAM3X4E
select ARCH_HAVE_EXTSRAM0
select ARCH_HAVE_EXTSRAM1
-config ARCH_CHIP_AT91SAM3X4C
- bool "AT91SAM3X4C"
+config ARCH_CHIP_ATSAM3X4C
+ bool "ATSAM3X4C"
select ARCH_CORTEXM3
select ARCH_CHIP_SAM3X
-config ARCH_CHIP_AT91SAM3A8C
- bool "AT91SAM3A8C"
+config ARCH_CHIP_ATSAM3A8C
+ bool "ATSAM3A8C"
select ARCH_CORTEXM3
select ARCH_CHIP_SAM3A
-config ARCH_CHIP_AT91SAM3A4C
- bool "AT91SAM3A4C"
+config ARCH_CHIP_ATSAM3A4C
+ bool "ATSAM3A4C"
select ARCH_CORTEXM3
select ARCH_CHIP_SAM3A
diff --git a/nuttx/arch/arm/src/sam34/sam3u_dmac.c b/nuttx/arch/arm/src/sam34/sam3u_dmac.c
index 90a9bbebe..eff7a2a0b 100644
--- a/nuttx/arch/arm/src/sam34/sam3u_dmac.c
+++ b/nuttx/arch/arm/src/sam34/sam3u_dmac.c
@@ -152,7 +152,7 @@ static struct dma_linklist_s g_linklist[CONFIG_SAM34_NLLDESC];
static struct sam_dma_s g_dma[SAM34_NDMACHAN] =
{
-#ifdef CONFIG_ARCH_CHIP_AT91SAM3U4E
+#ifdef CONFIG_ARCH_CHIP_ATSAM3U4E
/* the AT91SAM3U4E has four DMA channels. The FIFOs for channels 0-2 are
* 8 bytes in size; channel 3 is 32 bytes.
*/
diff --git a/nuttx/configs/Kconfig b/nuttx/configs/Kconfig
index b5b03b8f5..d369edc43 100644
--- a/nuttx/configs/Kconfig
+++ b/nuttx/configs/Kconfig
@@ -20,6 +20,14 @@ config ARCH_BOARD_AMBER
on the Atmel AVR ATMega128 MCU. There is not much there yet and what is
there is untested due to tool-related issues.
+config ARCH_BOARD_ARDUINO_DUE
+ bool "Arduino Due"
+ depends on ARCH_CHIP_ATSAM3X8E
+ select ARCH_HAVE_LEDS
+ ---help---
+ This options selects the Arduino DUE board featuring the Atmel
+ ATSAM3X8E MCU running at 84 MHz.
+
config ARCH_BOARD_AVR32DEV1
bool "Atmel AVR32DEV1 board"
depends on ARCH_CHIP_AT32UC3B0256
@@ -466,7 +474,7 @@ config ARCH_BOARD_RGMP
config ARCH_BOARD_SAM3UEK
bool "Atmel SAM3U-EK development board"
- depends on ARCH_CHIP_AT91SAM3U4E
+ depends on ARCH_CHIP_ATSAM3U4E
select ARCH_HAVE_LEDS
select ARCH_HAVE_BUTTONS
select ARCH_HAVE_IRQBUTTONS
@@ -744,6 +752,7 @@ endchoice
config ARCH_BOARD
string
default "amber" if ARCH_BOARD_AMBER
+ default "arduino-due" if ARCH_BOARD_ARDUINO_DUE
default "avr32dev1" if ARCH_BOARD_AVR32DEV1
default "c5471evm" if ARCH_BOARD_C5471EVM
default "compal_e88" if ARCH_BOARD_COMPALE88
@@ -756,7 +765,7 @@ config ARCH_BOARD
default "ez80f910200kitg" if ARCH_BOARD_EZ80F910200KITG
default "ez80f910200zco" if ARCH_BOARD_EZ80F910200ZCO
default "fire-stm32v2" if ARCH_BOARD_FIRE_STM32
- default "freedom-kl25z" if ARCH_BOARD_FREEDOM_KL25Z
+ default "freedom-kl25z" if ARCH_BOARD_FREEDOM_KL25Z
default "hymini-stm32v" if ARCH_BOARD_HYMINI_STM32V
default "kwikstik-k40" if ARCH_BOARD_KWIKSTIK_K40
default "lincoln60" if ARCH_BOARD_LINCOLN60
@@ -877,6 +886,9 @@ comment "Board-Specific Options"
if ARCH_BOARD_AMBER
source "configs/amber/Kconfig"
endif
+if ARCH_BOARD_ARDUINO_DUE
+source "configs/arduino-due/Kconfig"
+endif
if ARCH_BOARD_AVR32DEV1
source "configs/avr32dev1/Kconfig"
endif
diff --git a/nuttx/configs/README.txt b/nuttx/configs/README.txt
index 33b6c217b..b9ea98e22 100644
--- a/nuttx/configs/README.txt
+++ b/nuttx/configs/README.txt
@@ -1702,6 +1702,10 @@ configs/amber
on the Atmel AVR ATMega128 MCU. There is not much there yet and what is
there is untested due to tool-related issues.
+configs/arduino-due
+ This sub-directory holds board support for the Arduino DUE board featuring
+ the Atmel ATSAM3X8E MCU running at 84 MHz.
+
configs/avr32dev1
This is a port of NuttX to the Atmel AVR32DEV1 board. That board is
based on the Atmel AT32UC3B0256 MCU and uses a specially patched
diff --git a/nuttx/configs/arduino-due/Kconfig b/nuttx/configs/arduino-due/Kconfig
new file mode 100644
index 000000000..8a0550d91
--- /dev/null
+++ b/nuttx/configs/arduino-due/Kconfig
@@ -0,0 +1,7 @@
+#
+# For a description of the syntax of this configuration file,
+# see misc/tools/kconfig-language.txt.
+#
+
+if ARCH_BOARD_ARDUINO_DUE
+endif
diff --git a/nuttx/configs/arduino-due/README.txt b/nuttx/configs/arduino-due/README.txt
index 4b946e0a8..1be147797 100644
--- a/nuttx/configs/arduino-due/README.txt
+++ b/nuttx/configs/arduino-due/README.txt
@@ -2,8 +2,8 @@ README
^^^^^^
This README discusses issues unique to NuttX configurations for the
- Arduion DUE board featuring the Atmel ATSAM3X8E MSU.
-
+ Arduino DUE board featuring the Atmel ATSAM3X8E MCU running at 84
+ MHz.
Contents
^^^^^^^^
@@ -23,7 +23,81 @@ Contents
PIO Pin Usage
^^^^^^^^^^^^^
- To be provided
+ PORTA PORTB PORTC
+ ------------------------------ ------------------------------ --------------------------------
+ PIO SIGNAL CONN PIN PIO SIGNAL CONN PIN PIO SIGNAL CONN PIN
+ ----- ---------- ---- -------- ----- ------------ ---- ------ ----- ----------- ---- ---------
+ PA0 CANTX0 ADCH 8 PB0 ETX_CLK ETH 1 PC0 ERASE N/A
+ PA1 CANRX0 ACDH 7 PB1 ETX_EN ETH 3 PC1 PIN33 XIO 14
+ PA2 AD7 ADCL 7 PB2 ETXD0 ETH 5 PC2 PIN34 XIO 15
+ PA3 AD6 ADCL 6 PB3 ETXD1 ETH 7 PC3 PIN35 XIO 16
+ PA4 AD5 ADCL 5 PB4 ERX_DV ETH 10 PC4 PIN36 XIO 17
+ PA5 EEXTINT ETH 8 PB5 ERXD0 ETH 9 PC5 PIN37 XIO 18
+ PA6 AD4 ADCL 4 PB6 ERXD1 ETH 11 PC6 PIN38 XIO 19
+ PA7 PIN31 XIO 12 PB7 ERX_ER ETH 13 PC7 PIN39 XIO 20
+ PA8 [U]RX PWML 1 PB8 EMDC ETH 14 PC8 PIN40 XIO 21
+ PA9 [U]TX PWML 2 PB9 EMDIO ETH 12 PC9 PIN41 XIO 22
+ PA10 RXD2 COMM 6 PB10 UOTGVBOF Vbus power PC10 N/C N/A
+ PA11 TXD2 COMM 5 PB11 UOTGID USB1 4 PC11 N/C N/A
+ PA12 RXD1 COMM 4 PB12 SDA0-3 COMM 7 PC12 PIN51 XIO 32
+ PA13 TXD1 COMM 3 PB13 SCL0-3 COMM 8 PC13 PIN50 XIO 31
+ PA14 PIN23 XIO 4 PB14 CANTX1/IO XIO 34 PC14 PIN49 XIO 30
+ PA15 PIN24 XIO 5 PB15 DAC0(CANRX1) ADCH 5 PC15 PIN48 XIO 29
+ PA16 AD0 ADCL 0 PB16 DAC1 ADCH 6 PC16 PIN47 XIO 28
+ PA17 SDA1 PWMH 9 PB17 AD8 ADCH 1 PC17 PIN46 XIO 27
+ PA18 SCL1 PWMH 10 PB18 AD9 ADCH 2 PC18 PIN45 XIO 26
+ PA19 PIN42 XIO 23 PB19 AD10 ADCH 3 PC19 PIN44 XIO 25
+ PA20 PIN43 XIO 24 PB20 AD11(TXD3) ADCH 4 PC20 N/C N/A
+ PA21 TXL TX YELLOW LED PB21 AD14(RXD3) XIO 33 PC21 PWM9 PWMH 2
+ PA22 AD3 ADCL 3 PB22 N/C N/A PC22 PWM8 PWMH 1
+ PA23 AD2 ADCL 2 PB23 SS3 ??? PC23 PWM7 PWML 8
+ PA24 AD1 ADCL 1 PB24 N/C N/A PC24 PWM6 PWML 7
+ PA25 MISO SPI 1 PB25 PWM2 PWML 3 PC25 PWM5 PWML 6
+ PA26 MOSI SPI 4 PB26 PIN22 ??? PC26 SS1/PWM4 ??? (there are two)
+ PA27 SPCK SPI 3 PB27 PWM13 PWMH 6 PC27 N/C N/A
+ PA28 SS0/PWM10 (ETH) PB28 JTAG_TCK JTAG 4 PC28 PWM3 PWML 4
+ PA29 SS1/PWM4 (SD) PB29 JTAG_TDI JTAG 8 PC29 SS0/PWM10 ??? (there are two)
+ PA30 N/A N/A PB30 JTAG_TDO JTAG 6 PC30 RXL RX YELLOW LED
+ PA31 N/A N/A PB31 JTAG_TMS JTAG 2 PC31 N/A N/A
+ ----- ---------- ---- -------- ----- ------------ ---- ------ ----- ----------- ---- ---------
+
+ PORTA PORTB PORTC
+ ------------------------------ ------------------------------ --------------------------------
+ PIO SIGNAL CONN PIN PIO SIGNAL CONN PIN PIO SIGNAL CONN PIN
+ ----- ---------- ---- -------- ----- ------------ ---- ------ ----- ----------- ---- ---------
+ PA0 PIN25 XIO 6 PE0 N/A N/A PF0 N/A N/A
+ PD1 PIN26 XIO 7 PE1 N/A N/A PF1 N/A N/A
+ PD2 PIN27 XIO 8 PE2 N/A N/A PF2 N/A N/A
+ PD3 PIN28 XIO 9 PE3 N/A N/A PF3 N/A N/A
+ PD4 TXD0 COMM 1 PE4 N/A N/A PF4 N/A N/A
+ PD5 RXD0 COMM 2 PE5 N/A N/A PF5 N/A N/A
+ PD6 PIN29 XIO 10 PE6 N/A N/A PF6 N/A N/A
+ PD7 PWM11 PWMH 4 PE7 N/A N/A PF7 N/A N/A
+ PD8 PWM12 PWMH 5 PE8 N/A N/A PF8 N/A N/A
+ PD9 PIN30 XIO 11 PE9 N/A N/A PF9 N/A N/A
+ PD10 PIN32 XIO 13 PE10 N/A N/A PF10 N/A N/A
+ PD11 N/A N/A PE11 N/A N/A PF11 N/A N/A
+ PD12 N/A N/A PE12 N/A N/A PF12 N/A N/A
+ PD13 N/A N/A PE13 N/A N/A PF13 N/A N/A
+ PD14 N/A N/A PE14 N/A N/A PF14 N/A N/A
+ PD15 N/A N/A PE15 N/A N/A PF15 N/A N/A
+ PD16 N/A N/A PE16 N/A N/A PF16 N/A N/A
+ PD17 N/A N/A PE17 N/A N/A PF17 N/A N/A
+ PD18 N/A N/A PE18 N/A N/A PF18 N/A N/A
+ PD19 N/A N/A PE19 N/A N/A PF19 N/A N/A
+ PD20 N/A N/A PE20 N/A N/A PF20 N/A N/A
+ PD21 N/A N/A PE21 N/A N/A PF21 N/A N/A
+ PD22 N/A N/A PE22 N/A N/A PF22 N/A N/A
+ PD23 N/A N/A PE23 N/A N/A PF23 N/A N/A
+ PD24 N/A N/A PE24 N/A N/A PF24 N/A N/A
+ PD25 N/A N/A PE25 N/A N/A PF25 N/A N/A
+ PD26 N/A N/A PE26 N/A N/A PF26 N/A N/A
+ PD27 N/A N/A PE27 N/A N/A PF27 N/A N/A
+ PD28 N/A N/A PE28 N/A N/A PF28 N/A N/A
+ PD29 N/A N/A PE29 N/A N/A PF29 N/A N/A
+ PD30 N/A N/A PE30 N/A N/A PF30 N/A N/A
+ PD31 N/A5 N/A PE31 N/A N/A PF31 N/A N/A
+ ----- ---------- ---- -------- ----- ------------ ---- ------ ----- ----------- ---- ---------
Development Environment
^^^^^^^^^^^^^^^^^^^^^^^
@@ -232,12 +306,70 @@ NXFLAT Toolchain
Buttons and LEDs
^^^^^^^^^^^^^^^^
- To be provided
+ Buttons
+ -------
+ There are no buttons on the Arduino Due board.
+
+ LEDs
+ ----
+ There are two user-controllable LEDs on board the Arduino Due board:
+
+ LED GPIO
+ ---------------- -----
+ TX Yellow LED PA21
+ RX Yellow LED PC30
+
+ Both are pulled high and can be illuminated by driving the corresponding
+ GPIO output to low.
+
+ These LEDs are not used by the board port unless CONFIG_ARCH_LEDS is
+ defined. In that case, the usage by the board port is defined in
+ include/board.h and src/sam_leds.c. The LEDs are used to encode OS-related
+ events as follows:
+
+ SYMBOL Meaning LED state
+ RX TX
+ ------------------- ----------------------- -------- --------
+ LED_STARTED NuttX has been started OFF OFF
+ LED_HEAPALLOCATE Heap has been allocated OFF OFF
+ LED_IRQSENABLED Interrupts enabled OFF OFF
+ LED_STACKCREATED Idle stack created ON OFF
+ LED_INIRQ In an interrupt No change
+ LED_SIGNAL In a signal handler No change
+ LED_ASSERTION An assertion failed No change
+ LED_PANIC The system has crashed OFF Blinking
+ LED_IDLE MCU is is sleep mode Not used
+
+ Thus if RX is statically on, NuttX has successfully booted and is,
+ apparently, running normmally. If TX is flashing at approximately
+ 2Hz, then a fatal error has been detected and the system has halted.
+
Serial Consoles
^^^^^^^^^^^^^^^
- To be provided
+ Any of UART and USART0-3 may be used as a serial console. By default,
+ the UART is used as the serial console in all configurations. But that is
+ easily changed by modifying the configuration as described under
+ "Configurations" below.
+
+ ------------------------------
+ PIO SIGNAL CONN PIN
+ ----- ---------- ---- --------
+ PA8 [U]RX PWML 1
+ PA9 [U]TX PWML 2
+ PD4 TXD0 COMM 1
+ PD5 RXD0 COMM 2
+ PA12 RXD1 COMM 4
+ PA13 TXD1 COMM 3
+ PA10 RXD2 COMM 6
+ PA11 TXD2 COMM 5
+ PB20 AD11(TXD3) ADCH 4
+ PB21 AD14(RXD3) XIO 33
+
+ The outputs from these pins is 3.3V. You will need to connect RS232
+ transceiver to get the signals to RS232 levels (or connect the pins to the
+ USB virual COM port.
Arduino DUE-specific Configuration Options
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -383,7 +515,7 @@ Configurations
can be selected as follow:
cd tools
- ./configure.shsam4s-xplained/<subdir>
+ ./configure.sh arduino-due/<subdir>
cd -
. ./setenv.sh
diff --git a/nuttx/configs/arduino-due/include/board.h b/nuttx/configs/arduino-due/include/board.h
new file mode 100644
index 000000000..ef841926c
--- /dev/null
+++ b/nuttx/configs/arduino-due/include/board.h
@@ -0,0 +1,243 @@
+/************************************************************************************
+ * configs/arduino-due/include/board.h
+ *
+ * Copyright (C) 2013 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ************************************************************************************/
+
+#ifndef __CONFIGS_ARDUINO_DUE_INCLUDE_BOARD_H
+#define __CONFIGS_ARDUINO_DUE_INCLUDE_BOARD_H
+
+/************************************************************************************
+ * Included Files
+ ************************************************************************************/
+
+#include <nuttx/config.h>
+
+#ifndef __ASSEMBLY__
+# include <stdint.h>
+# ifdef CONFIG_GPIO_IRQ
+# include <arch/irq.h>
+# endif
+#endif
+
+/************************************************************************************
+ * Definitions
+ ************************************************************************************/
+
+/* Clocking *************************************************************************/
+/* After power-on reset, the SAM3X device is running on a 4MHz internal RC. These
+ * definitions will configure clocking
+ *
+ * MAINOSC: Frequency = 12MHz (crysta)
+ * PLLA: PLL Divider = 1, Multiplier = 14 to generate PLLACK = 168MHz
+ * Master Clock (MCK): Source = PLLACK, Prescalar = 1 to generate MCK = 84MHz
+ * CPU clock: 84MHz
+ */
+
+/* Main oscillator register settings.
+ *
+ * The start up time should be should be:
+ * Start Up Time = 8 * MOSCXTST / SLCK = 56 Slow Clock Cycles.
+ */
+
+#define BOARD_CKGR_MOR_MOSCXTST (62 << PMC_CKGR_MOR_MOSCXTST_SHIFT) /* Start-up Time */
+
+/* PLLA configuration.
+ *
+ * Divider = 1
+ * Multipler = 14
+ */
+
+#define BOARD_CKGR_PLLAR_MUL (13 << PMC_CKGR_PLLAR_MUL_SHIFT)
+#define BOARD_CKGR_PLLAR_STMODE PMC_CKGR_PLLAR_STMODE_FAST
+#define BOARD_CKGR_PLLAR_COUNT (63 << PMC_CKGR_PLLAR_COUNT_SHIFT)
+#define BOARD_CKGR_PLLAR_DIV PMC_CKGR_PLLAR_DIV_BYPASS
+
+/* PMC master clock register settings.
+ *
+ * Source = PLLA
+ * Divider = 2
+ */
+
+#define BOARD_PMC_MCKR_CSS PMC_MCKR_CSS_PLLA
+#define BOARD_PMC_MCKR_PRES PMC_MCKR_PRES_DIV2
+
+/* USB UTMI PLL start-up time */
+
+#define BOARD_CKGR_UCKR_UPLLCOUNT (3 << PMC_CKGR_UCKR_UPLLCOUNT_SHIFT)
+
+/* Resulting frequencies */
+
+#define BOARD_MAINOSC_FREQUENCY (12000000) /* MAINOSC: 12MHz crystal on-board */
+#define BOARD_PLLA_FREQUENCY (168000000) /* PLLACK: 14 * 12Mhz / 1 */
+#define BOARD_MCK_FREQUENCY (84000000) /* MCK: PLLACK / 2 */
+#define BOARD_CPU_FREQUENCY (84000000) /* CPU: MCK */
+
+/* HSMCI clocking
+ *
+ * Multimedia Card Interface clock (MCCK or MCI_CK) is Master Clock (MCK)
+ * divided by (2*(CLKDIV+1)).
+ *
+ * MCI_SPEED = MCCK / (2*(CLKDIV+1))
+ * CLKDIV = MCCK / MCI_SPEED / 2 - 1
+ *
+ * Where CLKDIV has a range of 0-255.
+ */
+
+/* MCK = 84MHz, CLKDIV = 104, MCI_SPEED = 84MHz / 2 * (104+1) = 400 KHz */
+
+#define HSMCI_INIT_CLKDIV (104 << HSMCI_MR_CLKDIV_SHIFT)
+
+/* MCK = 84MHz, CLKDIV = 2, MCI_SPEED = 84MHz / 2 * (2+1) = 14 MHz */
+
+#define HSMCI_MMCXFR_CLKDIV (1 << HSMCI_MR_CLKDIV_SHIFT)
+
+/* MCK = 84MHz, CLKDIV = 1, MCI_SPEED = 84MHz / 2 * (1+1) = 21 MHz */
+
+#define HSMCI_SDXFR_CLKDIV (1 << HSMCI_MR_CLKDIV_SHIFT)
+#define HSMCI_SDWIDEXFR_CLKDIV HSMCI_SDXFR_CLKDIV
+
+/* FLASH wait states
+ *
+ * FWS Max frequency
+ * 1.62V 1.8V
+ * --- ----- ------
+ * 0 24MHz 27MHz
+ * 1 40MHz 47MHz
+ * 2 72MHz 84MHz
+ * 3 84MHz 96MHz
+ */
+
+#define BOARD_FWS 2
+
+/* LED definitions ******************************************************************/
+/* There are two user-controllable LEDs on board the Arduino Due board:
+ *
+ * LED GPIO
+ * ---------------- -----
+ * TX Yellow LED PA21
+ * RX Yellow LED PC30
+ *
+ * Both are pulled high and can be illuminated by driving the corresponding
+ * GPIO output to low.
+ */
+
+/* LED index values for use with sam_setled() */
+
+#define BOARD_LED_RX 0
+#define BOARD_LED_TX 1
+#define BOARD_NLEDS 2
+
+/* LED bits for use with sam_setleds() */
+
+#define BOARD_LED_RX_BIT (1 << BOARD_LED_RX)
+#define BOARD_LED_TX_BIT (1 << BOARD_LED_TX)
+
+/* These LEDs are not used by the board port unless CONFIG_ARCH_LEDS is
+ * defined. In that case, the usage by the board port is defined in
+ * include/board.h and src/sam_leds.c. The LEDs are used to encode OS-related
+ * events as follows:
+ *
+ * SYMBOL Val Meaning LED state
+ * RX TX
+ * ------------------- --- ----------------------- -------- --------- */
+#define LED_STARTED 0 /* NuttX has been started OFF OFF */
+#define LED_HEAPALLOCATE 0 /* Heap has been allocated OFF OFF */
+#define LED_IRQSENABLED 0 /* Interrupts enabled OFF OFF */
+#define LED_STACKCREATED 1 /* Idle stack created ON OFF */
+#define LED_INIRQ 2 /* In an interrupt No change */
+#define LED_SIGNAL 2 /* In a signal handler No change */
+#define LED_ASSERTION 2 /* An assertion failed No change */
+#define LED_PANIC 3 /* The system has crashed OFF Blinking */
+#undef LED_IDLE /* MCU is is sleep mode Not used */
+
+/* Thus if RX is statically on, NuttX has successfully booted and is,
+ * apparently, running normmally. If TX is flashing at approximately
+ * 2Hz, then a fatal error has been detected and the system has halted.
+ */
+
+/* Button definitions ***************************************************************/
+/* There are no buttons on the Arduino Due board. */
+
+
+/************************************************************************************
+ * Public Data
+ ************************************************************************************/
+
+#ifndef __ASSEMBLY__
+
+#undef EXTERN
+#if defined(__cplusplus)
+#define EXTERN extern "C"
+extern "C" {
+#else
+#define EXTERN extern
+#endif
+
+/************************************************************************************
+ * Public Function Prototypes
+ ************************************************************************************/
+/************************************************************************************
+ * Name: sam_boardinitialize
+ *
+ * Description:
+ * All SAM3X architectures must provide the following entry point. This entry point
+ * is called early in the intitialization -- after all memory has been configured
+ * and mapped but before any devices have been initialized.
+ *
+ ************************************************************************************/
+
+void sam_boardinitialize(void);
+
+/************************************************************************************
+ * Name: sam_ledinit, sam_setled, and sam_setleds
+ *
+ * Description:
+ * If CONFIG_ARCH_LEDS is defined, then NuttX will control the on-board LEDs. If
+ * CONFIG_ARCH_LEDS is not defined, then the following interfacesare available to
+ * control the LEDs from user applications.
+ *
+ ************************************************************************************/
+
+#ifndef CONFIG_ARCH_LEDS
+void sam_ledinit(void);
+void sam_setled(int led, bool ledon);
+void sam_setleds(uint8_t ledset);
+#endif
+
+#undef EXTERN
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /* __ASSEMBLY__ */
+#endif /* __CONFIGS_ARDUINO_DUE_INCLUDE_BOARD_H */
diff --git a/nuttx/configs/arduino-due/ostest/Make.defs b/nuttx/configs/arduino-due/ostest/Make.defs
new file mode 100644
index 000000000..39c6a9aaf
--- /dev/null
+++ b/nuttx/configs/arduino-due/ostest/Make.defs
@@ -0,0 +1,107 @@
+############################################################################
+# configs/arduino-due/ostest/Make.defs
+#
+# Copyright (C) 2013 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <gnutt@nuttx.org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+include ${TOPDIR}/.config
+include ${TOPDIR}/tools/Config.mk
+include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs
+
+ifeq ($(WINTOOL),y)
+ # Windows-native toolchains
+ DIRLINK = $(TOPDIR)/tools/copydir.sh
+ DIRUNLINK = $(TOPDIR)/tools/unlink.sh
+ MKDEP = $(TOPDIR)/tools/mknulldeps.sh
+ ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
+ ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script}"
+ MAXOPTIMIZATION = -O2
+else
+ # Linux/Cygwin-native toolchain
+ MKDEP = $(TOPDIR)/tools/mkdeps.sh
+ ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
+ ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script
+endif
+
+CC = $(CROSSDEV)gcc
+CXX = $(CROSSDEV)g++
+CPP = $(CROSSDEV)gcc -E
+LD = $(CROSSDEV)ld
+AR = $(CROSSDEV)ar rcs
+NM = $(CROSSDEV)nm
+OBJCOPY = $(CROSSDEV)objcopy
+OBJDUMP = $(CROSSDEV)objdump
+
+ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'}
+ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1}
+
+ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
+ ARCHOPTIMIZATION = -g
+else
+ ARCHOPTIMIZATION = $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
+endif
+
+ARCHCFLAGS = -fno-builtin
+ARCHCXXFLAGS = -fno-builtin -fno-exceptions
+ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
+ARCHWARNINGSXX = -Wall -Wshadow
+ARCHDEFINES =
+ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10
+
+CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
+CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
+CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
+AFLAGS = $(CFLAGS) -D__ASSEMBLY__
+
+NXFLATLDFLAGS1 = -r -d -warn-common
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
+LDNXFLATFLAGS = -e main -s 2048
+
+OBJEXT = .o
+LIBEXT = .a
+EXEEXT =
+
+ifneq ($(CROSSDEV),arm-nuttx-elf-)
+ LDFLAGS += -nostartfiles -nodefaultlibs
+endif
+ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
+ LDFLAGS += -g
+endif
+
+HOSTCC = gcc
+HOSTINCLUDES = -I.
+HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
+HOSTLDFLAGS =
diff --git a/nuttx/configs/arduino-due/ostest/defconfig b/nuttx/configs/arduino-due/ostest/defconfig
new file mode 100644
index 000000000..b895ac3fd
--- /dev/null
+++ b/nuttx/configs/arduino-due/ostest/defconfig
@@ -0,0 +1,628 @@
+#
+# Automatically generated file; DO NOT EDIT.
+# Nuttx/ Configuration
+#
+CONFIG_NUTTX_NEWCONFIG=y
+
+#
+# Build Setup
+#
+# CONFIG_EXPERIMENTAL is not set
+CONFIG_HOST_LINUX=y
+# CONFIG_HOST_OSX is not set
+# CONFIG_HOST_WINDOWS is not set
+# CONFIG_HOST_OTHER is not set
+
+#
+# Build Configuration
+#
+# CONFIG_APPS_DIR="../apps"
+# CONFIG_BUILD_2PASS is not set
+
+#
+# Binary Output Formats
+#
+# CONFIG_RRLOAD_BINARY is not set
+# CONFIG_INTELHEX_BINARY is not set
+# CONFIG_MOTOROLA_SREC is not set
+CONFIG_RAW_BINARY=y
+
+#
+# Customize Header Files
+#
+# CONFIG_ARCH_STDBOOL_H is not set
+# CONFIG_ARCH_MATH_H is not set
+# CONFIG_ARCH_FLOAT_H is not set
+# CONFIG_ARCH_STDARG_H is not set
+
+#
+# Debug Options
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_SYMBOLS is not set
+
+#
+# System Type
+#
+# CONFIG_ARCH_8051 is not set
+CONFIG_ARCH_ARM=y
+# CONFIG_ARCH_AVR is not set
+# CONFIG_ARCH_HC is not set
+# CONFIG_ARCH_MIPS is not set
+# CONFIG_ARCH_RGMP is not set
+# CONFIG_ARCH_SH is not set
+# CONFIG_ARCH_SIM is not set
+# CONFIG_ARCH_X86 is not set
+# CONFIG_ARCH_Z16 is not set
+# CONFIG_ARCH_Z80 is not set
+CONFIG_ARCH="arm"
+
+#
+# ARM Options
+#
+# CONFIG_ARCH_CHIP_C5471 is not set
+# CONFIG_ARCH_CHIP_CALYPSO is not set
+# CONFIG_ARCH_CHIP_DM320 is not set
+# CONFIG_ARCH_CHIP_IMX is not set
+# CONFIG_ARCH_CHIP_KINETIS is not set
+# CONFIG_ARCH_CHIP_KL is not set
+# CONFIG_ARCH_CHIP_LM is not set
+# CONFIG_ARCH_CHIP_LPC17XX is not set
+# CONFIG_ARCH_CHIP_LPC214X is not set
+# CONFIG_ARCH_CHIP_LPC2378 is not set
+# CONFIG_ARCH_CHIP_LPC31XX is not set
+# CONFIG_ARCH_CHIP_LPC43XX is not set
+# CONFIG_ARCH_CHIP_NUC1XX is not set
+CONFIG_ARCH_CHIP_SAM34=y
+# CONFIG_ARCH_CHIP_STM32 is not set
+# CONFIG_ARCH_CHIP_STR71X is not set
+CONFIG_ARCH_CORTEXM3=y
+CONFIG_ARCH_FAMILY="armv7-m"
+CONFIG_ARCH_CHIP="sam34"
+# CONFIG_ARMV7M_USEBASEPRI is not set
+# CONFIG_ARCH_HAVE_FPU is not set
+CONFIG_ARCH_HAVE_MPU=y
+# CONFIG_ARMV7M_MPU is not set
+
+#
+# ARMV7M Configuration Options
+#
+CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y
+# CONFIG_ARMV7M_TOOLCHAIN_CODEREDL is not set
+# CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL is not set
+# CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL is not set
+CONFIG_ARMV7M_OABI_TOOLCHAIN=y
+# CONFIG_GPIO_IRQ is not set
+
+#
+# AT91SAM3/4 Configuration Options
+#
+# CONFIG_ARCH_CHIP_ATSAM3U4E is not set
+CONFIG_ARCH_CHIP_ATSAM3X8E=y
+# CONFIG_ARCH_CHIP_ATSAM3X8C is not set
+# CONFIG_ARCH_CHIP_ATSAM3X4E is not set
+# CONFIG_ARCH_CHIP_ATSAM3X4C is not set
+# CONFIG_ARCH_CHIP_ATSAM3A8C is not set
+# CONFIG_ARCH_CHIP_ATSAM3A4C is not set
+# CONFIG_ARCH_CHIP_ATSAM4LC2C is not set
+# CONFIG_ARCH_CHIP_ATSAM4LC2B is not set
+# CONFIG_ARCH_CHIP_ATSAM4LC2A is not set
+# CONFIG_ARCH_CHIP_ATSAM4LC4C is not set
+# CONFIG_ARCH_CHIP_ATSAM4LC4B is not set
+# CONFIG_ARCH_CHIP_ATSAM4LC4A is not set
+# CONFIG_ARCH_CHIP_ATSAM4LS2C is not set
+# CONFIG_ARCH_CHIP_ATSAM4LS2B is not set
+# CONFIG_ARCH_CHIP_ATSAM4LS2A is not set
+# CONFIG_ARCH_CHIP_ATSAM4LS4C is not set
+# CONFIG_ARCH_CHIP_ATSAM4LS4B is not set
+# CONFIG_ARCH_CHIP_ATSAM4LS4A is not set
+# CONFIG_ARCH_CHIP_ATSAM4SD32C is not set
+# CONFIG_ARCH_CHIP_ATSAM4SD32B is not set
+# CONFIG_ARCH_CHIP_ATSAM4SD16C is not set
+# CONFIG_ARCH_CHIP_ATSAM4SD16B is not set
+# CONFIG_ARCH_CHIP_ATSAM4SA16C is not set
+# CONFIG_ARCH_CHIP_ATSAM4SA16B is not set
+# CONFIG_ARCH_CHIP_ATSAM4S16C is not set
+# CONFIG_ARCH_CHIP_ATSAM4S16B is not set
+# CONFIG_ARCH_CHIP_ATSAM4S8C is not set
+# CONFIG_ARCH_CHIP_ATSAM4S8B is not set
+# CONFIG_ARCH_CHIP_SAM3U is not set
+CONFIG_ARCH_CHIP_SAM3X=y
+# CONFIG_ARCH_CHIP_SAM3A is not set
+# CONFIG_ARCH_CHIP_SAM4L is not set
+# CONFIG_ARCH_CHIP_SAM4S is not set
+
+#
+# AT91SAM3/4 Peripheral Support
+#
+# CONFIG_SAM34_SPI0 is not set
+# CONFIG_SAM34_SPI1 is not set
+# CONFIG_SAM34_SSC is not set
+# CONFIG_SAM34_TC0 is not set
+# CONFIG_SAM34_TC1 is not set
+# CONFIG_SAM34_TC2 is not set
+# CONFIG_SAM34_TC3 is not set
+# CONFIG_SAM34_TC4 is not set
+# CONFIG_SAM34_TC5 is not set
+# CONFIG_SAM34_TC6 is not set
+# CONFIG_SAM34_TC7 is not set
+# CONFIG_SAM34_TC8 is not set
+# CONFIG_SAM34_PWM is not set
+# CONFIG_SAM34_TWIM0 is not set
+# CONFIG_SAM34_TWIS0 is not set
+# CONFIG_SAM34_TWIM1 is not set
+# CONFIG_SAM34_TWIS1 is not set
+CONFIG_SAM34_UART0=y
+# CONFIG_SAM34_USART0 is not set
+# CONFIG_SAM34_USART1 is not set
+# CONFIG_SAM34_USART2 is not set
+# CONFIG_SAM34_USART3 is not set
+# CONFIG_SAM34_ADC12B is not set
+# CONFIG_SAM34_DACC is not set
+# CONFIG_SAM34_TRNG is not set
+# CONFIG_SAM34_EMAC is not set
+# CONFIG_SAM34_CAN0 is not set
+# CONFIG_SAM34_CAN1 is not set
+# CONFIG_SAM34_SMC is not set
+# CONFIG_SAM34_SDRAMC is not set
+# CONFIG_SAM34_DMA is not set
+# CONFIG_SAM34_UOTGHS is not set
+# CONFIG_SAM34_RTC is not set
+# CONFIG_SAM34_RTT is not set
+# CONFIG_SAM34_WDT is not set
+# CONFIG_SAM34_HSMCI is not set
+
+#
+# AT91SAM3/4 USART Configuration
+#
+
+#
+# AT91SAM3/4 GPIO Interrupt Configuration
+#
+
+#
+# External Memory Configuration
+#
+CONFIG_ARCH_HAVE_EXTNAND=y
+CONFIG_ARCH_HAVE_EXTNOR=y
+CONFIG_ARCH_HAVE_EXTSRAM0=y
+CONFIG_ARCH_HAVE_EXTSRAM1=y
+# CONFIG_ARCH_EXTNAND is not set
+# CONFIG_ARCH_EXTNOR is not set
+# CONFIG_ARCH_EXTSRAM0 is not set
+# CONFIG_ARCH_EXTSRAM1 is not set
+
+#
+# Architecture Options
+#
+# CONFIG_ARCH_NOINTC is not set
+# CONFIG_ARCH_VECNOTIRQ is not set
+# CONFIG_ARCH_DMA is not set
+CONFIG_ARCH_IRQPRIO=y
+# CONFIG_CUSTOM_STACK is not set
+# CONFIG_ADDRENV is not set
+CONFIG_ARCH_HAVE_VFORK=y
+CONFIG_ARCH_STACKDUMP=y
+# CONFIG_ENDIAN_BIG is not set
+CONFIG_ARCH_HAVE_RAMFUNCS=y
+# CONFIG_ARCH_RAMFUNCS is not set
+CONFIG_ARCH_HAVE_RAMVECTORS=y
+# CONFIG_ARCH_RAMVECTORS is not set
+
+#
+# Board Settings
+#
+CONFIG_BOARD_LOOPSPERMSEC=8720
+# CONFIG_ARCH_CALIBRATION is not set
+CONFIG_DRAM_START=0x20000000
+CONFIG_DRAM_SIZE=32768
+CONFIG_ARCH_HAVE_INTERRUPTSTACK=y
+CONFIG_ARCH_INTERRUPTSTACK=0
+
+#
+# Boot options
+#
+# CONFIG_BOOT_RUNFROMEXTSRAM is not set
+CONFIG_BOOT_RUNFROMFLASH=y
+# CONFIG_BOOT_RUNFROMISRAM is not set
+# CONFIG_BOOT_RUNFROMSDRAM is not set
+# CONFIG_BOOT_COPYTORAM is not set
+
+#
+# Board Selection
+#
+CONFIG_ARCH_BOARD_ARDUINO_DUE=y
+# CONFIG_ARCH_BOARD_CUSTOM is not set
+CONFIG_ARCH_BOARD="arduino-due"
+
+#
+# Common Board Options
+#
+CONFIG_ARCH_HAVE_LEDS=y
+CONFIG_ARCH_LEDS=y
+
+#
+# Board-Specific Options
+#
+
+#
+# RTOS Features
+#
+# CONFIG_BOARD_INITIALIZE is not set
+CONFIG_MSEC_PER_TICK=10
+CONFIG_RR_INTERVAL=200
+# CONFIG_SCHED_INSTRUMENTATION is not set
+CONFIG_TASK_NAME_SIZE=0
+# CONFIG_SCHED_HAVE_PARENT is not set
+# CONFIG_JULIAN_TIME is not set
+CONFIG_START_YEAR=2009
+CONFIG_START_MONTH=9
+CONFIG_START_DAY=21
+CONFIG_DEV_CONSOLE=y
+# CONFIG_MUTEX_TYPES is not set
+# CONFIG_PRIORITY_INHERITANCE is not set
+# CONFIG_FDCLONE_DISABLE is not set
+# CONFIG_FDCLONE_STDIO is not set
+CONFIG_SDCLONE_DISABLE=y
+# CONFIG_SCHED_WAITPID is not set
+# CONFIG_SCHED_STARTHOOK is not set
+# CONFIG_SCHED_ATEXIT is not set
+# CONFIG_SCHED_ONEXIT is not set
+CONFIG_USER_ENTRYPOINT="ostest_main"
+CONFIG_DISABLE_OS_API=y
+# CONFIG_DISABLE_CLOCK is not set
+# CONFIG_DISABLE_POSIX_TIMERS is not set
+# CONFIG_DISABLE_PTHREAD is not set
+# CONFIG_DISABLE_SIGNALS is not set
+# CONFIG_DISABLE_MQUEUE is not set
+CONFIG_DISABLE_ENVIRON=y
+
+#
+# Signal Numbers
+#
+CONFIG_SIG_SIGUSR1=1
+CONFIG_SIG_SIGUSR2=2
+CONFIG_SIG_SIGALARM=3
+CONFIG_SIG_SIGCONDTIMEDOUT=16
+
+#
+# Sizes of configurable things (0 disables)
+#
+CONFIG_MAX_TASKS=16
+CONFIG_MAX_TASK_ARGS=4
+CONFIG_NPTHREAD_KEYS=4
+CONFIG_NFILE_DESCRIPTORS=8
+CONFIG_NFILE_STREAMS=8
+CONFIG_NAME_MAX=32
+CONFIG_PREALLOC_MQ_MSGS=4
+CONFIG_MQ_MAXMSGSIZE=32
+CONFIG_MAX_WDOGPARMS=2
+CONFIG_PREALLOC_WDOGS=4
+CONFIG_PREALLOC_TIMERS=4
+
+#
+# Stack and heap information
+#
+CONFIG_IDLETHREAD_STACKSIZE=1024
+CONFIG_USERMAIN_STACKSIZE=2048
+CONFIG_PTHREAD_STACK_MIN=256
+CONFIG_PTHREAD_STACK_DEFAULT=2048
+
+#
+# Device Drivers
+#
+CONFIG_DISABLE_POLL=y
+CONFIG_DEV_NULL=y
+# CONFIG_DEV_ZERO is not set
+# CONFIG_LOOP is not set
+# CONFIG_RAMDISK is not set
+# CONFIG_CAN is not set
+# CONFIG_PWM is not set
+# CONFIG_I2C is not set
+# CONFIG_SPI is not set
+# CONFIG_RTC is not set
+# CONFIG_WATCHDOG is not set
+# CONFIG_ANALOG is not set
+# CONFIG_AUDIO_DEVICES is not set
+# CONFIG_BCH is not set
+# CONFIG_INPUT is not set
+# CONFIG_LCD is not set
+# CONFIG_MMCSD is not set
+# CONFIG_MTD is not set
+# CONFIG_PIPES is not set
+# CONFIG_PM is not set
+# CONFIG_POWER is not set
+# CONFIG_SENSORS is not set
+CONFIG_SERIAL=y
+CONFIG_DEV_LOWCONSOLE=y
+# CONFIG_16550_UART is not set
+CONFIG_ARCH_HAVE_UART0=y
+CONFIG_MCU_SERIAL=y
+CONFIG_UART0_SERIAL_CONSOLE=y
+# CONFIG_NO_SERIAL_CONSOLE is not set
+
+#
+# UART0 Configuration
+#
+CONFIG_UART0_RXBUFSIZE=256
+CONFIG_UART0_TXBUFSIZE=256
+CONFIG_UART0_BAUD=115200
+CONFIG_UART0_BITS=8
+CONFIG_UART0_PARITY=0
+CONFIG_UART0_2STOP=0
+# CONFIG_UART0_IFLOWCONTROL is not set
+# CONFIG_UART0_OFLOWCONTROL is not set
+# CONFIG_SERIAL_IFLOWCONTROL is not set
+# CONFIG_SERIAL_OFLOWCONTROL is not set
+# CONFIG_USBDEV is not set
+# CONFIG_USBHOST is not set
+# CONFIG_WIRELESS is not set
+
+#
+# System Logging Device Options
+#
+
+#
+# System Logging
+#
+# CONFIG_RAMLOG is not set
+
+#
+# Networking Support
+#
+# CONFIG_NET is not set
+
+#
+# File Systems
+#
+
+#
+# File system configuration
+#
+CONFIG_DISABLE_MOUNTPOINT=y
+# CONFIG_FS_RAMMAP is not set
+
+#
+# System Logging
+#
+# CONFIG_SYSLOG_ENABLE is not set
+# CONFIG_SYSLOG is not set
+
+#
+# Graphics Support
+#
+# CONFIG_NX is not set
+
+#
+# Memory Management
+#
+# CONFIG_MM_MULTIHEAP is not set
+# CONFIG_MM_SMALL is not set
+CONFIG_MM_REGIONS=3
+# CONFIG_GRAN is not set
+
+#
+# Audio Support
+#
+# CONFIG_AUDIO is not set
+
+#
+# Binary Formats
+#
+# CONFIG_BINFMT_DISABLE is not set
+# CONFIG_NXFLAT is not set
+# CONFIG_ELF is not set
+# CONFIG_BUILTIN is not set
+# CONFIG_PIC is not set
+# CONFIG_SYMTAB_ORDEREDBYNAME is not set
+
+#
+# Library Routines
+#
+
+#
+# Standard C Library Options
+#
+CONFIG_STDIO_BUFFER_SIZE=64
+CONFIG_STDIO_LINEBUFFER=y
+CONFIG_NUNGET_CHARS=2
+# CONFIG_LIBM is not set
+# CONFIG_NOPRINTF_FIELDWIDTH is not set
+# CONFIG_LIBC_FLOATINGPOINT is not set
+CONFIG_LIB_RAND_ORDER=1
+# CONFIG_EOL_IS_CR is not set
+# CONFIG_EOL_IS_LF is not set
+# CONFIG_EOL_IS_BOTH_CRLF is not set
+CONFIG_EOL_IS_EITHER_CRLF=y
+# CONFIG_LIBC_EXECFUNCS is not set
+CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=1024
+CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=2048
+# CONFIG_LIBC_STRERROR is not set
+# CONFIG_LIBC_PERROR_STDOUT is not set
+CONFIG_ARCH_LOWPUTC=y
+CONFIG_LIB_SENDFILE_BUFSIZE=512
+# CONFIG_ARCH_ROMGETC is not set
+# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set
+
+#
+# Non-standard Library Support
+#
+# CONFIG_SCHED_WORKQUEUE is not set
+# CONFIG_LIB_KBDCODEC is not set
+# CONFIG_LIB_SLCDCODEC is not set
+
+#
+# Basic CXX Support
+#
+# CONFIG_C99_BOOL8 is not set
+# CONFIG_HAVE_CXX is not set
+
+#
+# Application Configuration
+#
+
+#
+# Built-In Applications
+#
+
+#
+# Examples
+#
+# CONFIG_EXAMPLES_BUTTONS is not set
+# CONFIG_EXAMPLES_CAN is not set
+# CONFIG_EXAMPLES_COMPOSITE is not set
+# CONFIG_EXAMPLES_DHCPD is not set
+# CONFIG_EXAMPLES_ELF is not set
+# CONFIG_EXAMPLES_FTPC is not set
+# CONFIG_EXAMPLES_FTPD is not set
+# CONFIG_EXAMPLES_HELLO is not set
+# CONFIG_EXAMPLES_HELLOXX is not set
+# CONFIG_EXAMPLES_JSON is not set
+# CONFIG_EXAMPLES_HIDKBD is not set
+# CONFIG_EXAMPLES_KEYPADTEST is not set
+# CONFIG_EXAMPLES_IGMP is not set
+# CONFIG_EXAMPLES_LCDRW is not set
+# CONFIG_EXAMPLES_MM is not set
+# CONFIG_EXAMPLES_MODBUS is not set
+# CONFIG_EXAMPLES_MOUNT is not set
+# CONFIG_EXAMPLES_NRF24L01TERM is not set
+# CONFIG_EXAMPLES_NSH is not set
+# CONFIG_EXAMPLES_NULL is not set
+# CONFIG_EXAMPLES_NX is not set
+# CONFIG_EXAMPLES_NXCONSOLE is not set
+# CONFIG_EXAMPLES_NXFFS is not set
+# CONFIG_EXAMPLES_NXFLAT is not set
+# CONFIG_EXAMPLES_NXHELLO is not set
+# CONFIG_EXAMPLES_NXIMAGE is not set
+# CONFIG_EXAMPLES_NXLINES is not set
+# CONFIG_EXAMPLES_NXTEXT is not set
+CONFIG_EXAMPLES_OSTEST=y
+CONFIG_EXAMPLES_OSTEST_LOOPS=1
+CONFIG_EXAMPLES_OSTEST_STACKSIZE=2048
+CONFIG_EXAMPLES_OSTEST_NBARRIER_THREADS=3
+CONFIG_EXAMPLES_OSTEST_RR_RANGE=10000
+CONFIG_EXAMPLES_OSTEST_RR_RUNS=10
+# CONFIG_EXAMPLES_PASHELLO is not set
+# CONFIG_EXAMPLES_PIPE is not set
+# CONFIG_EXAMPLES_POLL is not set
+# CONFIG_EXAMPLES_POSIXSPAWN is not set
+# CONFIG_EXAMPLES_QENCODER is not set
+# CONFIG_EXAMPLES_RGMP is not set
+# CONFIG_EXAMPLES_ROMFS is not set
+# CONFIG_EXAMPLES_SENDMAIL is not set
+# CONFIG_EXAMPLES_SERLOOP is not set
+# CONFIG_EXAMPLES_SLCD is not set
+# CONFIG_EXAMPLES_SMART is not set
+# CONFIG_EXAMPLES_TCPECHO is not set
+# CONFIG_EXAMPLES_TELNETD is not set
+# CONFIG_EXAMPLES_THTTPD is not set
+# CONFIG_EXAMPLES_TIFF is not set
+# CONFIG_EXAMPLES_TOUCHSCREEN is not set
+# CONFIG_EXAMPLES_UDP is not set
+# CONFIG_EXAMPLES_UIP is not set
+# CONFIG_EXAMPLES_USBSERIAL is not set
+# CONFIG_EXAMPLES_USBMSC is not set
+# CONFIG_EXAMPLES_USBTERM is not set
+# CONFIG_EXAMPLES_WATCHDOG is not set
+
+#
+# Graphics Support
+#
+# CONFIG_TIFF is not set
+
+#
+# Interpreters
+#
+# CONFIG_INTERPRETERS_FICL is not set
+# CONFIG_INTERPRETERS_PCODE is not set
+
+#
+# Network Utilities
+#
+
+#
+# Networking Utilities
+#
+# CONFIG_NETUTILS_CODECS is not set
+# CONFIG_NETUTILS_DHCPC is not set
+# CONFIG_NETUTILS_DHCPD is not set
+# CONFIG_NETUTILS_FTPC is not set
+# CONFIG_NETUTILS_FTPD is not set
+# CONFIG_NETUTILS_JSON is not set
+# CONFIG_NETUTILS_RESOLV is not set
+# CONFIG_NETUTILS_SMTP is not set
+# CONFIG_NETUTILS_TELNETD is not set
+# CONFIG_NETUTILS_TFTPC is not set
+# CONFIG_NETUTILS_THTTPD is not set
+# CONFIG_NETUTILS_UIPLIB is not set
+# CONFIG_NETUTILS_WEBCLIENT is not set
+
+#
+# FreeModBus
+#
+# CONFIG_MODBUS is not set
+
+#
+# NSH Library
+#
+# CONFIG_NSH_LIBRARY is not set
+
+#
+# NxWidgets/NxWM
+#
+
+#
+# System NSH Add-Ons
+#
+
+#
+# Custom Free Memory Command
+#
+# CONFIG_SYSTEM_FREE is not set
+
+#
+# I2C tool
+#
+
+#
+# FLASH Program Installation
+#
+# CONFIG_SYSTEM_INSTALL is not set
+
+#
+# FLASH Erase-all Command
+#
+
+#
+# RAM test
+#
+# CONFIG_SYSTEM_RAMTEST is not set
+
+#
+# readline()
+#
+# CONFIG_SYSTEM_READLINE is not set
+
+#
+# Power Off
+#
+# CONFIG_SYSTEM_POWEROFF is not set
+
+#
+# RAMTRON
+#
+# CONFIG_SYSTEM_RAMTRON is not set
+
+#
+# SD Card
+#
+# CONFIG_SYSTEM_SDCARD is not set
+
+#
+# Sysinfo
+#
+# CONFIG_SYSTEM_SYSINFO is not set
+
+#
+# USB Monitor
+#
diff --git a/nuttx/configs/arduino-due/ostest/setenv.sh b/nuttx/configs/arduino-due/ostest/setenv.sh
new file mode 100755
index 000000000..2f0fdac1b
--- /dev/null
+++ b/nuttx/configs/arduino-due/ostest/setenv.sh
@@ -0,0 +1,75 @@
+#!/bin/bash
+# configs/arduino-due/ostest/setenv.sh
+#
+# Copyright (C) 2013 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <gnutt@nuttx.org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+if [ "$_" = "$0" ] ; then
+ echo "You must source this script, not run it!" 1>&2
+ exit 1
+fi
+
+WD=`pwd`
+if [ ! -x "setenv.sh" ]; then
+ echo "This script must be executed from the top-level NuttX build directory"
+ exit 1
+fi
+
+if [ -z "${PATH_ORIG}" ]; then
+ export PATH_ORIG="${PATH}"
+fi
+
+# This is the Cygwin path to the location where I installed the Atmel GCC
+# toolchain under Windows. You will also have to edit this if you install
+# this toolchain in any other location
+#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/Atmel/Atmel Toolchain/ARM GCC/Native/4.7.3.99/arm-gnu-toolchain/bin"
+
+# This is the Cygwin path to the location where I installed the CodeSourcery
+# toolchain under windows. You will also have to edit this if you install
+# the CodeSourcery toolchain in any other location
+#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin"
+
+# These are the Cygwin paths to the locations where I installed the Atollic
+# toolchain under windows. You will also have to edit this if you install
+# the Atollic toolchain in any other location. /usr/bin is added before
+# the Atollic bin path because there is are binaries named gcc.exe and g++.exe
+# at those locations as well.
+#export TOOLCHAIN_BIN="/usr/bin:/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for ARM Pro 2.3.0/ARMTools/bin"
+#export TOOLCHAIN_BIN="/usr/bin:/cygdrive/c/Program Files (x86)/Atollic/TrueSTUDIO for STMicroelectronics STM32 Lite 2.3.0/ARMTools/bin"
+
+# This is the Cygwin path to the location where I build the buildroot
+# toolchain.
+export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin"
+
+# Add the path to the toolchain to the PATH varialble
+export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}"
+
+echo "PATH : ${PATH}"
diff --git a/nuttx/configs/arduino-due/scripts/ld.script b/nuttx/configs/arduino-due/scripts/ld.script
new file mode 100755
index 000000000..27c96360d
--- /dev/null
+++ b/nuttx/configs/arduino-due/scripts/ld.script
@@ -0,0 +1,123 @@
+/****************************************************************************
+ * configs/arduino-due/scripts/ld.script
+ *
+ * Copyright (C) 2013 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/* The ATSAM3X8E has 512KB of FLASH beginning at address 0x0040:0000 and
+ * up to 100KB SRAM in three memory regions.
+ */
+
+MEMORY
+{
+ flash (rx) : ORIGIN = 0x00400000, LENGTH = 1024K
+ sram0 (rwx) : ORIGIN = 0x20000000, LENGTH = 64K
+ sram1 (rwx) : ORIGIN = 0x20080000, LENGTH = 32K
+ nfcram (rwx) : ORIGIN = 0x20100000, LENGTH = 4K
+}
+
+OUTPUT_ARCH(arm)
+ENTRY(_stext)
+SECTIONS
+{
+ .text : {
+ _stext = ABSOLUTE(.);
+ *(.vectors)
+ *(.text .text.*)
+ *(.fixup)
+ *(.gnu.warning)
+ *(.rodata .rodata.*)
+ *(.gnu.linkonce.t.*)
+ *(.glue_7)
+ *(.glue_7t)
+ *(.got)
+ *(.gcc_except_table)
+ *(.gnu.linkonce.r.*)
+ _etext = ABSOLUTE(.);
+ } > flash
+
+ .init_section : {
+ _sinit = ABSOLUTE(.);
+ *(.init_array .init_array.*)
+ _einit = ABSOLUTE(.);
+ } > flash
+
+ .ARM.extab : {
+ *(.ARM.extab*)
+ } >flash
+
+ __exidx_start = ABSOLUTE(.);
+ .ARM.exidx : {
+ *(.ARM.exidx*)
+ } >flash
+ __exidx_end = ABSOLUTE(.);
+
+ .data : {
+ _sdata = ABSOLUTE(.);
+ *(.data .data.*)
+ *(.gnu.linkonce.d.*)
+ CONSTRUCTORS
+ _edata = ABSOLUTE(.);
+ } > sram0 AT > flash
+
+ _eronly = LOADADDR(.data);
+
+ .ramfunc ALIGN(4): {
+ _sramfuncs = ABSOLUTE(.);
+ *(.ramfunc .ramfunc.*)
+ _eramfuncs = ABSOLUTE(.);
+ } > sram0 AT > flash
+
+ _framfuncs = LOADADDR(.ramfunc);
+
+ .bss : {
+ _sbss = ABSOLUTE(.);
+ *(.bss .bss.*)
+ *(.gnu.linkonce.b.*)
+ *(COMMON)
+ _ebss = ABSOLUTE(.);
+ } > sram0
+
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_info 0 : { *(.debug_info) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ .debug_aranges 0 : { *(.debug_aranges) }
+}
diff --git a/nuttx/configs/arduino-due/src/Makefile b/nuttx/configs/arduino-due/src/Makefile
new file mode 100644
index 000000000..a3ad76c45
--- /dev/null
+++ b/nuttx/configs/arduino-due/src/Makefile
@@ -0,0 +1,96 @@
+############################################################################
+# configs/arduino-due/src/Makefile
+#
+# Copyright (C) 2013 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <gnutt@nuttx.org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+-include $(TOPDIR)/Make.defs
+
+CFLAGS += -I$(TOPDIR)/sched
+
+ASRCS =
+AOBJS = $(ASRCS:.S=$(OBJEXT))
+
+CSRCS = sam_boot.c
+
+ifeq ($(CONFIG_HAVE_CXX),y)
+CSRCS += sam_cxxinitialize.c
+endif
+
+ifeq ($(CONFIG_ARCH_LEDS),y)
+CSRCS += sam_autoleds.c
+else
+CSRCS += sam_userleds.c
+endif
+
+COBJS = $(CSRCS:.c=$(OBJEXT))
+
+SRCS = $(ASRCS) $(CSRCS)
+OBJS = $(AOBJS) $(COBJS)
+
+ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
+ifeq ($(WINTOOL),y)
+ CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}"
+ CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/common}"
+ CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/armv7-m}"
+else
+ CFLAGS += -I$(ARCH_SRCDIR)/chip
+ CFLAGS += -I$(ARCH_SRCDIR)/common
+ CFLAGS += -I$(ARCH_SRCDIR)/armv7-m
+endif
+
+all: libboard$(LIBEXT)
+
+$(AOBJS): %$(OBJEXT): %.S
+ $(call ASSEMBLE, $<, $@)
+
+$(COBJS) $(LINKOBJS): %$(OBJEXT): %.c
+ $(call COMPILE, $<, $@)
+
+libboard$(LIBEXT): $(OBJS)
+ $(call ARCHIVE, $@, $(OBJS))
+
+.depend: Makefile $(SRCS)
+ $(Q) $(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
+ $(Q) touch $@
+
+depend: .depend
+
+clean:
+ $(call DELFILE, libboard$(LIBEXT))
+ $(call CLEAN)
+
+distclean: clean
+ $(call DELFILE, Make.dep)
+ $(call DELFILE, .depend)
+
+-include Make.dep
diff --git a/nuttx/configs/arduino-due/src/arduino-due.h b/nuttx/configs/arduino-due/src/arduino-due.h
new file mode 100644
index 000000000..860b52647
--- /dev/null
+++ b/nuttx/configs/arduino-due/src/arduino-due.h
@@ -0,0 +1,130 @@
+/************************************************************************************
+ * configs/arduino-due/src/arduino-due.h
+ *
+ * Copyright (C) 2013 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ************************************************************************************/
+
+#ifndef __CONFIGS_ARDUINO_DUE_SRC_ARDUNO_DUE_H
+#define __CONFIGS_ARDUINO_DUE_SRC_ARDUNO_DUE_H
+
+/************************************************************************************
+ * Included Files
+ ************************************************************************************/
+
+#include <nuttx/config.h>
+#include <nuttx/compiler.h>
+
+#include <stdint.h>
+
+#include <arch/irq.h>
+#include <nuttx/irq.h>
+
+#include "chip/sam_pinmap.h"
+
+/************************************************************************************
+ * Pre-processor Definitions
+ ************************************************************************************/
+/* There are two user-controllable LEDs on board the Arduino Due board:
+ *
+ * LED GPIO
+ * ---------------- -----
+ * TX Yellow LED PA21
+ * RX Yellow LED PC30
+ *
+ * Both are pulled high and can be illuminated by driving the corresponding
+ * GPIO output to low.
+ *
+ * These LEDs are not used by the board port unless CONFIG_ARCH_LEDS is
+ * defined. In that case, the usage by the board port is defined in
+ * include/board.h and src/sam_leds.c. The LEDs are used to encode OS-related
+ * events as follows:
+ *
+ * SYMBOL Meaning LED state
+ * RX TX
+ * ------------------- ----------------------- -------- --------
+ * LED_STARTED NuttX has been started OFF OFF
+ * LED_HEAPALLOCATE Heap has been allocated OFF OFF
+ * LED_IRQSENABLED Interrupts enabled OFF OFF
+ * LED_STACKCREATED Idle stack created ON OFF
+ * LED_INIRQ In an interrupt No change
+ * LED_SIGNAL In a signal handler No change
+ * LED_ASSERTION An assertion failed No change
+ * LED_PANIC The system has crashed OFF Blinking
+ * LED_IDLE MCU is is sleep mode Not used
+ *
+ * Thus if RX is statically on, NuttX has successfully booted and is,
+ * apparently, running normmally. If TX is flashing at approximately
+ * 2Hz, then a fatal error has been detected and the system has halted.
+ */
+
+#define GPIO_LED_RX (GPIO_OUTPUT | GPIO_CFG_PULLUP | GPIO_OUTPUT_SET | \
+ GPIO_PORT_PIOC | GPIO_PIN30)
+#define GPIO_LED_TX (GPIO_OUTPUT | GPIO_CFG_PULLUP | GPIO_OUTPUT_SET | \
+ GPIO_PORT_PIOA | GPIO_PIN21)
+
+/************************************************************************************
+ * Public Types
+ ************************************************************************************/
+
+/************************************************************************************
+ * Public data
+ ************************************************************************************/
+
+#ifndef __ASSEMBLY__
+
+/************************************************************************************
+ * Public Functions
+ ************************************************************************************/
+
+/************************************************************************************
+ * Name: sam_sram_initialize
+ *
+ * Description:
+ * Configure and enable SRAM on board the SAM4S Xplained
+ *
+ ************************************************************************************/
+
+#ifdef CONFIG_ARCH_EXTSRAM0
+void sam_sram_initialize(void);
+#endif
+
+/************************************************************************************
+ * Name: up_ledinit
+ ************************************************************************************/
+
+#ifdef CONFIG_ARCH_LEDS
+void up_ledinit(void);
+#endif
+
+#endif /* __ASSEMBLY__ */
+#endif /* __CONFIGS_ARDUINO_DUE_SRC_ARDUNO_DUE_H */
+
diff --git a/nuttx/configs/arduino-due/src/sam_autoleds.c b/nuttx/configs/arduino-due/src/sam_autoleds.c
new file mode 100644
index 000000000..c2ce23b67
--- /dev/null
+++ b/nuttx/configs/arduino-due/src/sam_autoleds.c
@@ -0,0 +1,170 @@
+/****************************************************************************
+ * configs/arduino-due/src/sam_autoleds.c
+ *
+ * Copyright (C) 2013 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <debug.h>
+
+#include <arch/board/board.h>
+
+#include "chip.h"
+#include "sam_gpio.h"
+#include "arduino-due.h"
+
+#ifdef CONFIG_ARCH_LEDS
+
+/****************************************************************************
+ * Definitions
+ ****************************************************************************/
+/* There are two user-controllable LEDs on board the Arduino Due board:
+ *
+ * LED GPIO
+ * ---------------- -----
+ * TX Yellow LED PA21
+ * RX Yellow LED PC30
+ *
+ * Both are pulled high and can be illuminated by driving the corresponding
+ * GPIO output to low.
+ *
+ * These LEDs are not used by the board port unless CONFIG_ARCH_LEDS is
+ * defined. In that case, the usage by the board port is defined in
+ * include/board.h and src/sam_leds.c. The LEDs are used to encode OS-related
+ * events as follows:
+ *
+ * SYMBOL Meaning LED state
+ * RX TX
+ * ------------------- ----------------------- -------- --------
+ * LED_STARTED NuttX has been started OFF OFF
+ * LED_HEAPALLOCATE Heap has been allocated OFF OFF
+ * LED_IRQSENABLED Interrupts enabled OFF OFF
+ * LED_STACKCREATED Idle stack created ON OFF
+ * LED_INIRQ In an interrupt No change
+ * LED_SIGNAL In a signal handler No change
+ * LED_ASSERTION An assertion failed No change
+ * LED_PANIC The system has crashed OFF Blinking
+ * LED_IDLE MCU is is sleep mode Not used
+ *
+ * Thus if RX is statically on, NuttX has successfully booted and is,
+ * apparently, running normmally. If TX is flashing at approximately
+ * 2Hz, then a fatal error has been detected and the system has halted.
+ */
+
+/* CONFIG_DEBUG_LEDS enables debug output from this file (needs CONFIG_DEBUG
+ * with CONFIG_DEBUG_VERBOSE too)
+ */
+
+#ifdef CONFIG_DEBUG_LEDS
+# define leddbg lldbg
+# define ledvdbg llvdbg
+#else
+# define leddbg(x...)
+# define ledvdbg(x...)
+#endif
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: up_ledinit
+ ****************************************************************************/
+
+void up_ledinit(void)
+{
+ /* Configure RX and TX LED GPIOs for output */
+
+ sam_configgpio(GPIO_LED_RX);
+ sam_configgpio(GPIO_LED_TX);
+}
+
+/****************************************************************************
+ * Name: up_ledon
+ ****************************************************************************/
+
+void up_ledon(int led)
+{
+ bool rxledon = false;
+ bool txledon = false;
+
+ switch (led)
+ {
+ case 0: /* LED_STARTED, LED_HEAPALLOCATE, LED_IRQSENABLED */
+ break;
+
+ case 1: /* LED_STACKCREATED */
+ rxledon = true;
+ break;
+
+ default:
+ case 2: /* LED_INIRQ, LED_SIGNAL, LED_ASSERTION */
+ return;
+
+ case 3: /* LED_PANIC */
+ txledon = true;
+ break;
+ }
+
+ sam_gpiowrite(GPIO_LED_RX, rxledon);
+ sam_gpiowrite(GPIO_LED_TX, txledon);
+}
+
+/****************************************************************************
+ * Name: up_ledoff
+ ****************************************************************************/
+
+void up_ledoff(int led)
+{
+ if (led != 2)
+ {
+ sam_gpiowrite(GPIO_LED_RX, false);
+ sam_gpiowrite(GPIO_LED_TX, false);
+ }
+}
+
+#endif /* CONFIG_ARCH_LEDS */
diff --git a/nuttx/configs/arduino-due/src/sam_boot.c b/nuttx/configs/arduino-due/src/sam_boot.c
new file mode 100644
index 000000000..a09e7545d
--- /dev/null
+++ b/nuttx/configs/arduino-due/src/sam_boot.c
@@ -0,0 +1,75 @@
+/************************************************************************************
+ * configs/arduino-due/src/sam_boot.c
+ *
+ * Copyright (C) 2013 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ************************************************************************************/
+
+/************************************************************************************
+ * Included Files
+ ************************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <debug.h>
+
+#include "arduino-due.h"
+
+/************************************************************************************
+ * Definitions
+ ************************************************************************************/
+
+/************************************************************************************
+ * Private Functions
+ ************************************************************************************/
+
+/************************************************************************************
+ * Public Functions
+ ************************************************************************************/
+
+/************************************************************************************
+ * Name: sam_boardinitialize
+ *
+ * Description:
+ * All SAM3X architectures must provide the following entry point. This entry point
+ * is called early in the intitialization -- after all memory has been configured
+ * and mapped but before any devices have been initialized.
+ *
+ ************************************************************************************/
+
+void sam_boardinitialize(void)
+{
+#ifdef CONFIG_ARCH_LEDS
+ /* Configure on-board LEDs if LED support has been selected. */
+
+ up_ledinit();
+#endif
+}
diff --git a/nuttx/configs/arduino-due/src/sam_cxxinitialize.c b/nuttx/configs/arduino-due/src/sam_cxxinitialize.c
new file mode 100644
index 000000000..910c5db37
--- /dev/null
+++ b/nuttx/configs/arduino-due/src/sam_cxxinitialize.c
@@ -0,0 +1,154 @@
+/************************************************************************************
+ * configs/arduino-due/src/sam_cxxinitialize.c
+ *
+ * Copyright (C) 2013 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ************************************************************************************/
+
+/************************************************************************************
+ * Included Files
+ ************************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <debug.h>
+
+#include <nuttx/arch.h>
+
+#include <arch/sam34/chip.h>
+#include "chip.h"
+
+#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE)
+
+/************************************************************************************
+ * Definitions
+ ************************************************************************************/
+/* Debug ****************************************************************************/
+/* Non-standard debug that may be enabled just for testing the static constructors */
+
+#ifndef CONFIG_DEBUG
+# undef CONFIG_DEBUG_CXX
+#endif
+
+#ifdef CONFIG_DEBUG_CXX
+# define cxxdbg dbg
+# define cxxlldbg lldbg
+# ifdef CONFIG_DEBUG_VERBOSE
+# define cxxvdbg vdbg
+# define cxxllvdbg llvdbg
+# else
+# define cxxvdbg(x...)
+# define cxxllvdbg(x...)
+# endif
+#else
+# define cxxdbg(x...)
+# define cxxlldbg(x...)
+# define cxxvdbg(x...)
+# define cxxllvdbg(x...)
+#endif
+
+/************************************************************************************
+ * Private Types
+ ************************************************************************************/
+/* This type defines one entry in initialization array */
+
+typedef void (*initializer_t)(void);
+
+/************************************************************************************
+ * External references
+ ************************************************************************************/
+/* _sinit and _einit are symbols exported by the linker script that mark the
+ * beginning and the end of the C++ initialization section.
+ */
+
+extern initializer_t _sinit;
+extern initializer_t _einit;
+
+/* _stext and _etext are symbols exported by the linker script that mark the
+ * beginning and the end of text.
+ */
+
+extern uint32_t _stext;
+extern uint32_t _etext;
+
+/************************************************************************************
+ * Private Functions
+ ************************************************************************************/
+
+/************************************************************************************
+ * Public Functions
+ ************************************************************************************/
+
+/****************************************************************************
+ * Name: up_cxxinitialize
+ *
+ * Description:
+ * If C++ and C++ static constructors are supported, then this function
+ * must be provided by board-specific logic in order to perform
+ * initialization of the static C++ class instances.
+ *
+ * This function should then be called in the application-specific
+ * user_start logic in order to perform the C++ initialization. NOTE
+ * that no component of the core NuttX RTOS logic is involved; This
+ * function defintion only provides the 'contract' between application
+ * specific C++ code and platform-specific toolchain support
+ *
+ ***************************************************************************/
+
+void up_cxxinitialize(void)
+{
+ initializer_t *initp;
+
+ cxxdbg("_sinit: %p _einit: %p _stext: %p _etext: %p\n",
+ &_sinit, &_einit, &_stext, &_etext);
+
+ /* Visit each entry in the initialzation table */
+
+ for (initp = &_sinit; initp != &_einit; initp++)
+ {
+ initializer_t initializer = *initp;
+ cxxdbg("initp: %p initializer: %p\n", initp, initializer);
+
+ /* Make sure that the address is non-NULL and lies in the text region
+ * defined by the linker script. Some toolchains may put NULL values
+ * or counts in the initialization table
+ */
+
+ if ((void*)initializer > (void*)&_stext && (void*)initializer < (void*)&_etext)
+ {
+ cxxdbg("Calling %p\n", initializer);
+ initializer();
+ }
+ }
+}
+
+#endif /* CONFIG_HAVE_CXX && CONFIG_HAVE_CXXINITIALIZE */
+
diff --git a/nuttx/configs/arduino-due/src/sam_userleds.c b/nuttx/configs/arduino-due/src/sam_userleds.c
new file mode 100644
index 000000000..5cd87f1c5
--- /dev/null
+++ b/nuttx/configs/arduino-due/src/sam_userleds.c
@@ -0,0 +1,141 @@
+/****************************************************************************
+ * configs/arduino-due/src/sam_userleds.c
+ *
+ * Copyright (C) 2013 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <debug.h>
+
+#include <arch/board/board.h>
+
+#include "chip.h"
+#include "sam_gpio.h"
+#include "arduino-due.h"
+
+#ifndef CONFIG_ARCH_LEDS
+
+/****************************************************************************
+ * Definitions
+ ****************************************************************************/
+
+/* CONFIG_DEBUG_LEDS enables debug output from this file (needs CONFIG_DEBUG
+ * with CONFIG_DEBUG_VERBOSE too)
+ */
+
+#ifdef CONFIG_DEBUG_LEDS
+# define leddbg lldbg
+# define ledvdbg llvdbg
+#else
+# define leddbg(x...)
+# define ledvdbg(x...)
+#endif
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Function Protototypes
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: sam_ledinit
+ ****************************************************************************/
+
+void sam_ledinit(void)
+{
+ /* Configure LED1-2 GPIOs for output */
+
+ sam_configgpio(GPIO_LED_RX);
+ sam_configgpio(GPIO_LED_TX);
+}
+
+/****************************************************************************
+ * Name: sam_setled
+ ****************************************************************************/
+
+void sam_setled(int led, bool ledon)
+{
+ uint32_t ledcfg;
+
+ if (led == BOARD_LED_RX)
+ {
+ ledcfg = GPIO_LED_RX;
+ }
+ else if (led == BOARD_LED_TX)
+ {
+ ledcfg = GPIO_LED_TX;
+ }
+ else
+ {
+ return;
+ }
+
+ sam_gpiowrite(ledcfg, ledon);
+}
+
+/****************************************************************************
+ * Name: sam_setleds
+ ****************************************************************************/
+
+void sam_setleds(uint8_t ledset)
+{
+ bool ledon;
+
+ ledon = ((ledset & BOARD_LED_RX_BIT) != 0);
+ sam_gpiowrite(GPIO_LED_RX, ledon);
+
+ ledon = ((ledset & BOARD_LED_TX_BIT) != 0);
+ sam_gpiowrite(GPIO_LED_TX, ledon);
+}
+
+#endif /* !CONFIG_ARCH_LEDS */
diff --git a/nuttx/configs/sam3u-ek/README.txt b/nuttx/configs/sam3u-ek/README.txt
index cefc3dd98..cf01f744d 100644
--- a/nuttx/configs/sam3u-ek/README.txt
+++ b/nuttx/configs/sam3u-ek/README.txt
@@ -3,7 +3,7 @@ README
This README discusses issues unique to NuttX configurations for the Atmel
SAM3U-EK development board featuring the ATAM3U. This board features the
-AT91SAM3U4E MCU running at 96MHz.
+ATSAM3U4E MCU running at 96MHz.
Contents
^^^^^^^^
@@ -292,7 +292,7 @@ SAM3U-EK-specific Configuration Options
CONFIG_ARCH_CHIP_SAM34
CONFIG_ARCH_CHIP_SAM3U
- CONFIG_ARCH_CHIP_AT91SAM3U4
+ CONFIG_ARCH_CHIP_ATSAM3U4
CONFIG_ARCH_BOARD - Identifies the configs subdirectory and
hence, the board that supports the particular chip or SoC.
@@ -377,7 +377,7 @@ SAM3U-EK-specific Configuration Options
CONFIG_USART3_ISUART
CONFIG_SAM34_NAND - NAND memory
- AT91SAM3U specific device driver settings
+ SAM3U specific device driver settings
CONFIG_U[S]ARTn_SERIAL_CONSOLE - selects the USARTn (n=0,1,2,3) or UART
m (m=4,5) for the console and ttys0 (default is the USART1).
diff --git a/nuttx/configs/sam3u-ek/include/board.h b/nuttx/configs/sam3u-ek/include/board.h
index 1c0d7230a..d5a10c4b1 100644
--- a/nuttx/configs/sam3u-ek/include/board.h
+++ b/nuttx/configs/sam3u-ek/include/board.h
@@ -123,7 +123,7 @@
/* MCK = 96MHz, CLKDIV = 1, MCI_SPEED = 96MHz / 2 * (1+1) = 24 MHz */
-#define HSMCI_SDXFR_CLKDIV (3 << HSMCI_MR_CLKDIV_SHIFT)
+#define HSMCI_SDXFR_CLKDIV (1 << HSMCI_MR_CLKDIV_SHIFT)
#define HSMCI_SDWIDEXFR_CLKDIV HSMCI_SDXFR_CLKDIV
/* FLASH wait states
diff --git a/nuttx/configs/sam3u-ek/knsh/defconfig b/nuttx/configs/sam3u-ek/knsh/defconfig
index 892f3203e..f5fb5d86d 100644
--- a/nuttx/configs/sam3u-ek/knsh/defconfig
+++ b/nuttx/configs/sam3u-ek/knsh/defconfig
@@ -105,7 +105,7 @@ CONFIG_ARMV7M_OABI_TOOLCHAIN=y
#
# AT91SAM3/4 Configuration Options
#
-CONFIG_ARCH_CHIP_AT91SAM3U4E=y
+CONFIG_ARCH_CHIP_ATSAM3U4E=y
# CONFIG_ARCH_CHIP_SAM34_NDMACHANC2C is not set
# CONFIG_ARCH_CHIP_ATSAM4LC2B is not set
# CONFIG_ARCH_CHIP_ATSAM4LC2A is not set
diff --git a/nuttx/configs/sam3u-ek/nsh/defconfig b/nuttx/configs/sam3u-ek/nsh/defconfig
index 34e8db316..07edb61d3 100644
--- a/nuttx/configs/sam3u-ek/nsh/defconfig
+++ b/nuttx/configs/sam3u-ek/nsh/defconfig
@@ -97,13 +97,13 @@ CONFIG_ARMV7M_OABI_TOOLCHAIN=y
#
# AT91SAM3/4 Configuration Options
#
-CONFIG_ARCH_CHIP_AT91SAM3U4E=y
-# CONFIG_ARCH_CHIP_AT91SAM3X8E is not set
-# CONFIG_ARCH_CHIP_AT91SAM3X8C is not set
-# CONFIG_ARCH_CHIP_AT91SAM3X4E is not set
-# CONFIG_ARCH_CHIP_AT91SAM3X4C is not set
-# CONFIG_ARCH_CHIP_AT91SAM3A8C is not set
-# CONFIG_ARCH_CHIP_AT91SAM3A4C is not set
+CONFIG_ARCH_CHIP_ATSAM3U4E=y
+# CONFIG_ARCH_CHIP_ATSAM3X8E is not set
+# CONFIG_ARCH_CHIP_ATSAM3X8C is not set
+# CONFIG_ARCH_CHIP_ATSAM3X4E is not set
+# CONFIG_ARCH_CHIP_ATSAM3X4C is not set
+# CONFIG_ARCH_CHIP_ATSAM3A8C is not set
+# CONFIG_ARCH_CHIP_ATSAM3A4C is not set
# CONFIG_ARCH_CHIP_ATSAM4LC2C is not set
# CONFIG_ARCH_CHIP_ATSAM4LC2B is not set
# CONFIG_ARCH_CHIP_ATSAM4LC2A is not set
diff --git a/nuttx/configs/sam3u-ek/nx/defconfig b/nuttx/configs/sam3u-ek/nx/defconfig
index 344057eee..327053a8c 100644
--- a/nuttx/configs/sam3u-ek/nx/defconfig
+++ b/nuttx/configs/sam3u-ek/nx/defconfig
@@ -97,7 +97,7 @@ CONFIG_ARMV7M_OABI_TOOLCHAIN=y
#
# AT91SAM3/4 Configuration Options
#
-CONFIG_ARCH_CHIP_AT91SAM3U4E=y
+CONFIG_ARCH_CHIP_ATSAM3U4E=y
# CONFIG_ARCH_CHIP_SAM34_NDMACHANC2C is not set
# CONFIG_ARCH_CHIP_ATSAM4LC2B is not set
# CONFIG_ARCH_CHIP_ATSAM4LC2A is not set
diff --git a/nuttx/configs/sam3u-ek/ostest/defconfig b/nuttx/configs/sam3u-ek/ostest/defconfig
index e4bc12f87..ec0780d51 100644
--- a/nuttx/configs/sam3u-ek/ostest/defconfig
+++ b/nuttx/configs/sam3u-ek/ostest/defconfig
@@ -97,7 +97,7 @@ CONFIG_ARMV7M_OABI_TOOLCHAIN=y
#
# AT91SAM3/4 Configuration Options
#
-CONFIG_ARCH_CHIP_AT91SAM3U4E=y
+CONFIG_ARCH_CHIP_ATSAM3U4E=y
# CONFIG_ARCH_CHIP_SAM34_NDMACHANC2C is not set
# CONFIG_ARCH_CHIP_ATSAM4LC2B is not set
# CONFIG_ARCH_CHIP_ATSAM4LC2A is not set
diff --git a/nuttx/configs/sam3u-ek/scripts/ld.script b/nuttx/configs/sam3u-ek/scripts/ld.script
index e38216583..0deb1b15e 100755
--- a/nuttx/configs/sam3u-ek/scripts/ld.script
+++ b/nuttx/configs/sam3u-ek/scripts/ld.script
@@ -33,7 +33,7 @@
*
****************************************************************************/
-/* The AT91SAM3U-4 has 256Kb of FLASH beginning at address 0x0008:0000,
+/* The ATSAM3U4E has 256Kb of FLASH beginning at address 0x0008:0000,
* 32Kb of SRAM beginning at address 0x2000:0000, and 16Kb of SRAM beginning
* at address 0x2008:000 (used only for heap). When booting from FLASH,
* FLASH memory is aliased to address 0x0000:0000 where the code expects to
diff --git a/nuttx/configs/sam3u-ek/scripts/memory.ld b/nuttx/configs/sam3u-ek/scripts/memory.ld
index c99a31146..57b97d915 100644
--- a/nuttx/configs/sam3u-ek/scripts/memory.ld
+++ b/nuttx/configs/sam3u-ek/scripts/memory.ld
@@ -33,7 +33,7 @@
*
****************************************************************************/
-/* The AT91SAM3U-4 has 256KB of FLASH beginning at address 0x0008:0000,
+/* The ATSAM3U4E has 256KB of FLASH beginning at address 0x0008:0000,
* 32KB of SRAM beginning at address 0x2000:0000, and 16Kb of SRAM beginning
* at address 0x2008:000 (used only for heap). When booting from FLASH,
* FLASH memory is aliased to address 0x0000:0000 where the code expects to
diff --git a/nuttx/configs/sam3u-ek/src/sam3u-ek.h b/nuttx/configs/sam3u-ek/src/sam3u-ek.h
index a9841dcc6..e6e091363 100644
--- a/nuttx/configs/sam3u-ek/src/sam3u-ek.h
+++ b/nuttx/configs/sam3u-ek/src/sam3u-ek.h
@@ -67,7 +67,7 @@
/* SAM3U-EK GPIO Pin Definitions ****************************************************/
/* LCD:
- * LCD Module Pin Out: AT91SAM3U PIO:
+ * LCD Module Pin Out: SAM3U PIO:
* -------------------------------------------- --------------------------------------
* Pin Symbol Function LCD PeriphA PeriphB Extra
* ---- ------ -------------------------------- -------------- -------- ------- ------
diff --git a/nuttx/configs/sam3u-ek/src/up_lcd.c b/nuttx/configs/sam3u-ek/src/up_lcd.c
index 56d1018d6..6cfb08720 100644
--- a/nuttx/configs/sam3u-ek/src/up_lcd.c
+++ b/nuttx/configs/sam3u-ek/src/up_lcd.c
@@ -38,7 +38,7 @@
* touch-screen, FTM280C12D, with integratd driver IC HX8346. The LCD display size
* is 2.8 inches, with a native resolution of 240 x 320 pixels.
*
- * LCD Module Pin Out: AT91SAM3U PIO:
+ * LCD Module Pin Out: SAM3U PIO:
* -------------------------------------------- --------------------------------------
* Pin Symbol Function LCD PeriphA PeriphB Extra
* ---- ------ -------------------------------- -------------- -------- ------- ------
diff --git a/nuttx/configs/sam4l-xplained/nsh/defconfig b/nuttx/configs/sam4l-xplained/nsh/defconfig
index f87213c0c..fed07807b 100644
--- a/nuttx/configs/sam4l-xplained/nsh/defconfig
+++ b/nuttx/configs/sam4l-xplained/nsh/defconfig
@@ -97,13 +97,13 @@ CONFIG_ARMV7M_OABI_TOOLCHAIN=y
#
# AT91SAM3/4 Configuration Options
#
-# CONFIG_ARCH_CHIP_AT91SAM3U4E is not set
-# CONFIG_ARCH_CHIP_AT91SAM3X8E is not set
-# CONFIG_ARCH_CHIP_AT91SAM3X8C is not set
-# CONFIG_ARCH_CHIP_AT91SAM3X4E is not set
-# CONFIG_ARCH_CHIP_AT91SAM3X4C is not set
-# CONFIG_ARCH_CHIP_AT91SAM3A8C is not set
-# CONFIG_ARCH_CHIP_AT91SAM3A4C is not set
+# CONFIG_ARCH_CHIP_ATSAM3U4E is not set
+# CONFIG_ARCH_CHIP_ATSAM3X8E is not set
+# CONFIG_ARCH_CHIP_ATSAM3X8C is not set
+# CONFIG_ARCH_CHIP_ATSAM3X4E is not set
+# CONFIG_ARCH_CHIP_ATSAM3X4C is not set
+# CONFIG_ARCH_CHIP_ATSAM3A8C is not set
+# CONFIG_ARCH_CHIP_ATSAM3A4C is not set
# CONFIG_ARCH_CHIP_ATSAM4LC2C is not set
# CONFIG_ARCH_CHIP_ATSAM4LC2B is not set
# CONFIG_ARCH_CHIP_ATSAM4LC2A is not set
diff --git a/nuttx/configs/sam4l-xplained/ostest/defconfig b/nuttx/configs/sam4l-xplained/ostest/defconfig
index 447334e25..32dc79fd2 100644
--- a/nuttx/configs/sam4l-xplained/ostest/defconfig
+++ b/nuttx/configs/sam4l-xplained/ostest/defconfig
@@ -96,7 +96,7 @@ CONFIG_ARMV7M_OABI_TOOLCHAIN=y
#
# AT91SAM3/4 Configuration Options
#
-# CONFIG_ARCH_CHIP_AT91SAM3U4E is not set
+# CONFIG_ARCH_CHIP_ATSAM3U4E is not set
# CONFIG_ARCH_CHIP_SAM34_NDMACHANC2C is not set
# CONFIG_ARCH_CHIP_ATSAM4LC2B is not set
# CONFIG_ARCH_CHIP_ATSAM4LC2A is not set
diff --git a/nuttx/configs/sam4s-xplained/README.txt b/nuttx/configs/sam4s-xplained/README.txt
index 50bfaa258..a50a7c540 100644
--- a/nuttx/configs/sam4s-xplained/README.txt
+++ b/nuttx/configs/sam4s-xplained/README.txt
@@ -299,7 +299,7 @@ Buttons and LEDs
These LEDs are not used by the board port unless CONFIG_ARCH_LEDS is
defined. In that case, the usage by the board port is defined in
- include/board.h and src/up_leds.c. The LEDs are used to encode OS-related
+ include/board.h and src/sam_leds.c. The LEDs are used to encode OS-related
events as follows:
SYMBOL Meaning LED state
diff --git a/nuttx/configs/sam4s-xplained/include/board.h b/nuttx/configs/sam4s-xplained/include/board.h
index 7f29380a0..1ff60650e 100644
--- a/nuttx/configs/sam4s-xplained/include/board.h
+++ b/nuttx/configs/sam4s-xplained/include/board.h
@@ -119,7 +119,7 @@
/* MCK = 48MHz, CLKDIV = 1, MCI_SPEED = 48MHz / 2 * (1+1) = 12 MHz */
-#define HSMCI_MMCXFR_CLKDIV (3 << HSMCI_MR_CLKDIV_SHIFT)
+#define HSMCI_MMCXFR_CLKDIV (1 << HSMCI_MR_CLKDIV_SHIFT)
/* MCK = 48MHz, CLKDIV = 0, MCI_SPEED = 48MHz / 2 * (0+1) = 24 MHz */
diff --git a/nuttx/configs/sam4s-xplained/nsh/defconfig b/nuttx/configs/sam4s-xplained/nsh/defconfig
index 1f7cb5ca3..b4f877e43 100644
--- a/nuttx/configs/sam4s-xplained/nsh/defconfig
+++ b/nuttx/configs/sam4s-xplained/nsh/defconfig
@@ -97,13 +97,13 @@ CONFIG_ARMV7M_OABI_TOOLCHAIN=y
#
# AT91SAM3/4 Configuration Options
#
-# CONFIG_ARCH_CHIP_AT91SAM3U4E is not set
-# CONFIG_ARCH_CHIP_AT91SAM3X8E is not set
-# CONFIG_ARCH_CHIP_AT91SAM3X8C is not set
-# CONFIG_ARCH_CHIP_AT91SAM3X4E is not set
-# CONFIG_ARCH_CHIP_AT91SAM3X4C is not set
-# CONFIG_ARCH_CHIP_AT91SAM3A8C is not set
-# CONFIG_ARCH_CHIP_AT91SAM3A4C is not set
+# CONFIG_ARCH_CHIP_ATSAM3U4E is not set
+# CONFIG_ARCH_CHIP_ATSAM3X8E is not set
+# CONFIG_ARCH_CHIP_ATSAM3X8C is not set
+# CONFIG_ARCH_CHIP_ATSAM3X4E is not set
+# CONFIG_ARCH_CHIP_ATSAM3X4C is not set
+# CONFIG_ARCH_CHIP_ATSAM3A8C is not set
+# CONFIG_ARCH_CHIP_ATSAM3A4C is not set
# CONFIG_ARCH_CHIP_ATSAM4LC2C is not set
# CONFIG_ARCH_CHIP_ATSAM4LC2B is not set
# CONFIG_ARCH_CHIP_ATSAM4LC2A is not set
diff --git a/nuttx/configs/sam4s-xplained/ostest/defconfig b/nuttx/configs/sam4s-xplained/ostest/defconfig
index eb3ddaf6e..36daa09a4 100644
--- a/nuttx/configs/sam4s-xplained/ostest/defconfig
+++ b/nuttx/configs/sam4s-xplained/ostest/defconfig
@@ -96,7 +96,7 @@ CONFIG_ARMV7M_OABI_TOOLCHAIN=y
#
# AT91SAM3/4 Configuration Options
#
-# CONFIG_ARCH_CHIP_AT91SAM3U4E is not set
+# CONFIG_ARCH_CHIP_ATSAM3U4E is not set
# CONFIG_ARCH_CHIP_SAM34_NDMACHANC2C is not set
# CONFIG_ARCH_CHIP_ATSAM4LC2B is not set
# CONFIG_ARCH_CHIP_ATSAM4LC2A is not set