From 3b6e63199a7d9a9a5ed62d55847fce0fb5b5e02c Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 9 Oct 2013 07:35:00 -0600 Subject: [PATCH] Add option to enable Aduino Due specific logic, like pull-up on UART0 RXD. Suggested by gdi@embedders.org --- ChangeLog | 5 +++++ configs/arduino-due/Kconfig | 8 ++++++++ configs/arduino-due/README.txt | 12 ++++++++++++ configs/arduino-due/include/board.h | 26 ++++++++++++++++++++++++++ 4 files changed, 51 insertions(+) diff --git a/ChangeLog b/ChangeLog index 1796b3be24..a714d687f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5726,4 +5726,9 @@ incorporated into the build system (but still untested (2013-10-8). * configs/sama5d3x-ek/nx: Add an examples/nx configuratino that will be used for the SAMA5 LCD bring-up (2013-10-8). + * configs/arduino-due/Kconfig and include/board.h: Add configuration + to select revision 3 of the Arduino Due which has some small + but important differences. Suggested by gdi@embedders.org. +D + differences diff --git a/configs/arduino-due/Kconfig b/configs/arduino-due/Kconfig index 5330ae2a4c..7fdfd6f361 100644 --- a/configs/arduino-due/Kconfig +++ b/configs/arduino-due/Kconfig @@ -5,6 +5,14 @@ if ARCH_BOARD_ARDUINO_DUE +config ADRUINO_DUE_REV3 + bool "Rev 3" + default n + ---help--- + This port was performed on the Aduino Due Rev 2 board. Differences + with the Arduino Due Rev 3 board have been reported. This selection + will enable work arounds specifically for the Rev 3 board. + config ARDUINO_ITHEAD_TFT bool "ITEAD 2.4 inch TFT w/Touch" default n diff --git a/configs/arduino-due/README.txt b/configs/arduino-due/README.txt index 1fbde5ea35..923db50542 100644 --- a/configs/arduino-due/README.txt +++ b/configs/arduino-due/README.txt @@ -13,6 +13,7 @@ Contents ^^^^^^^^ - PIO Pin Usage + - Rev 2 vs. Rev 3 - ITEAD 2.4" TFT with Touch - Development Environment - GNU Toolchain Options @@ -105,6 +106,17 @@ PIO Pin Usage PD31 N/A5 N/A PE31 N/A N/A PF31 N/A N/A ----- ---------- ---- -------- ----- ------------ ---- ------ ----- ----------- ---- --------- +Rev 2 vs. Rev 3 +^^^^^^^^^^^^^^^ + + This port was performed on the Arduino Due Rev 2 board. NuttX users + have reported issues with the serial port on his Aduino Due Rev 3 board. + That problem was resolved as by configuring the UART0 RXD with a pull-up + (see include/board.h). That fix as well as any others that we may find + will be enabled by selecting + + CONFIG_ADRUINO_DUE_REV3=y + ITEAD 2.4" TFT with Touch ^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/configs/arduino-due/include/board.h b/configs/arduino-due/include/board.h index 43d3fe0167..b9059131e3 100644 --- a/configs/arduino-due/include/board.h +++ b/configs/arduino-due/include/board.h @@ -195,6 +195,32 @@ /* Button definitions ***************************************************************/ /* There are no buttons on the Arduino Due board. */ +/* GPIO pin configurations **********************************************************/ + +#ifdef CONFIG_ADRUINO_DUE_REV3 +/* This port was performed on the Arduino Due Rev 2 board. A NuttX user reported + * issues with the serial port on his Aduino Due Rev 3 board. That problem was + * resolved as follows: + * + * "... The issue was in my hardware. I found the difference between Arduino + * Due shematics (revision R2) and actual PCB layout of my Arduino (revision + * R3). On a schematics which I download from arduino.cc was shown that 2nd + * pin of IC10 is connected to the ground, but on my Arduino the 2nd pin + * of IC10 was connected to its 1st pin instead of ground and in my case + * IC10 works in open-drain mode, but RX0 pin on SAM3x doesn't have pull-up + * and thus TX signal from AtMega16U2 can't reach the SAM3x input pin, on + * this pin always '0'. + * + * "My solution is to enable internal pull-up in SAM3x. ... + * Now shell console on UART0 (via USB programming connector) of Arduino Due + * Due works as expected." + */ + +# undef GPIO_UART0_RXD +# define GPIO_UART0_RXD (GPIO_PERIPHA | GPIO_CFG_DEFAULT | GPIO_PORT_PIOA | \ + GPIO_PIN8 | GPIO_CFG_PULLUP) +#endif + /************************************************************************************ * Public Data ************************************************************************************/