From e89db77a8f1156ae1bfc78f73ddb62ab4e448f96 Mon Sep 17 00:00:00 2001 From: Adam Feuer Date: Sat, 28 Dec 2019 00:31:43 +0000 Subject: [PATCH 1/8] fix uart2port in sam_serial --- arch/arm/src/sama5/sam_serial.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/src/sama5/sam_serial.c b/arch/arm/src/sama5/sam_serial.c index a368140eb56ce..531886450829c 100644 --- a/arch/arm/src/sama5/sam_serial.c +++ b/arch/arm/src/sama5/sam_serial.c @@ -119,8 +119,8 @@ # define TTYS0_DEV g_uart1port /* UART1 is ttyS0 */ # define UART1_ASSIGNED 1 #elif defined(CONFIG_UART2_SERIAL_CONSOLE) -# define CONSOLE_DEV g_uart1port /* UART2 is console */ -# define TTYS0_DEV g_uart1port /* UART2 is ttyS0 */ +# define CONSOLE_DEV g_uart2port /* UART2 is console */ +# define TTYS0_DEV g_uart2port /* UART2 is ttyS0 */ # define UART2_ASSIGNED 1 #elif defined(CONFIG_UART3_SERIAL_CONSOLE) # define CONSOLE_DEV g_uart1port /* UART3 is console */ @@ -194,7 +194,7 @@ # define TTYS1_DEV g_uart1port /* UART1 is ttyS1 */ # define UART1_ASSIGNED 1 #elif defined(CONFIG_SAMA5_UART2) && !defined(UART2_ASSIGNED) -# define TTYS1_DEV g_uart1port /* UART2 is ttyS1 */ +# define TTYS1_DEV g_uart2port /* UART2 is ttyS1 */ # define UART2_ASSIGNED 1 #elif defined(CONFIG_SAMA5_UART3) && !defined(UART3_ASSIGNED) # define TTYS1_DEV g_uart1port /* UART3 is ttyS1 */ From f4a99ee33155ff69f14bcad9b9ea29976df38d83 Mon Sep 17 00:00:00 2001 From: Adam Feuer Date: Sat, 28 Dec 2019 00:36:25 +0000 Subject: [PATCH 2/8] fix the rest of the uarts in sam_serial --- arch/arm/src/sama5/sam_serial.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/arch/arm/src/sama5/sam_serial.c b/arch/arm/src/sama5/sam_serial.c index 531886450829c..aaf26e7aee60b 100644 --- a/arch/arm/src/sama5/sam_serial.c +++ b/arch/arm/src/sama5/sam_serial.c @@ -123,12 +123,12 @@ # define TTYS0_DEV g_uart2port /* UART2 is ttyS0 */ # define UART2_ASSIGNED 1 #elif defined(CONFIG_UART3_SERIAL_CONSOLE) -# define CONSOLE_DEV g_uart1port /* UART3 is console */ -# define TTYS0_DEV g_uart1port /* UART3 is ttyS0 */ +# define CONSOLE_DEV g_uart3port /* UART3 is console */ +# define TTYS0_DEV g_uart3port /* UART3 is ttyS0 */ # define UART3_ASSIGNED 1 #elif defined(CONFIG_UART4_SERIAL_CONSOLE) -# define CONSOLE_DEV g_uart1port /* UART4 is console */ -# define TTYS0_DEV g_uart1port /* UART4 is ttyS0 */ +# define CONSOLE_DEV g_uart4port /* UART4 is console */ +# define TTYS0_DEV g_uart4port /* UART4 is ttyS0 */ # define UART4_ASSIGNED 1 #elif defined(CONFIG_USART0_SERIAL_CONSOLE) # define CONSOLE_DEV g_usart0port /* USART0 is console */ @@ -159,13 +159,13 @@ # define TTYS0_DEV g_uart1port /* UART1 is ttyS0 */ # define UART1_ASSIGNED 1 # elif defined(CONFIG_SAMA5_UART2) -# define TTYS0_DEV g_uart1port /* UART2 is ttyS0 */ +# define TTYS0_DEV g_uart2port /* UART2 is ttyS0 */ # define UART2_ASSIGNED 1 # elif defined(CONFIG_SAMA5_UART3) -# define TTYS0_DEV g_uart1port /* UART3 is ttyS0 */ +# define TTYS0_DEV g_uart3port /* UART3 is ttyS0 */ # define UART3_ASSIGNED 1 # elif defined(CONFIG_SAMA5_UART4) -# define TTYS0_DEV g_uart1port /* UART4 is ttyS0 */ +# define TTYS0_DEV g_uart4port /* UART4 is ttyS0 */ # define UART4_ASSIGNED 1 # elif defined(CONFIG_USART0_SERIALDRIVER) # define TTYS0_DEV g_usart0port /* USART0 is ttyS0 */ @@ -197,10 +197,10 @@ # define TTYS1_DEV g_uart2port /* UART2 is ttyS1 */ # define UART2_ASSIGNED 1 #elif defined(CONFIG_SAMA5_UART3) && !defined(UART3_ASSIGNED) -# define TTYS1_DEV g_uart1port /* UART3 is ttyS1 */ +# define TTYS1_DEV g_uart3port /* UART3 is ttyS1 */ # define UART3_ASSIGNED 1 #elif defined(CONFIG_SAMA5_UART4) && !defined(UART4_ASSIGNED) -# define TTYS1_DEV g_uart1port /* UART4 is ttyS1 */ +# define TTYS1_DEV g_uart4port /* UART4 is ttyS1 */ # define UART4_ASSIGNED 1 #elif defined(CONFIG_USART0_SERIALDRIVER) && !defined(USART0_ASSIGNED) # define TTYS1_DEV g_usart0port /* USART0 is ttyS1 */ @@ -228,13 +228,13 @@ # define TTYS2_DEV g_uart1port /* UART1 is ttyS2 */ # define UART1_ASSIGNED 1 #elif defined(CONFIG_SAMA5_UART2) && !defined(UART2_ASSIGNED) -# define TTYS2_DEV g_uart1port /* UART2 is ttyS2 */ +# define TTYS2_DEV g_uart2port /* UART2 is ttyS2 */ # define UART2_ASSIGNED 1 #elif defined(CONFIG_SAMA5_UART3) && !defined(UART3_ASSIGNED) -# define TTYS2_DEV g_uart1port /* UART3 is ttyS2 */ +# define TTYS2_DEV g_uart2port /* UART3 is ttyS2 */ # define UART3_ASSIGNED 1 #elif defined(CONFIG_SAMA5_UART4) && !defined(UART4_ASSIGNED) -# define TTYS2_DEV g_uart1port /* UART4 is ttyS2 */ +# define TTYS2_DEV g_uart4port /* UART4 is ttyS2 */ # define UART4_ASSIGNED 1 #elif defined(CONFIG_USART0_SERIALDRIVER) && !defined(USART0_ASSIGNED) # define TTYS2_DEV g_usart0port /* USART0 is ttyS2 */ @@ -259,10 +259,10 @@ */ #if defined(CONFIG_SAMA5_UART2) && !defined(UART2_ASSIGNED) -# define TTYS3_DEV g_uart1port /* UART2 is ttyS3 */ +# define TTYS3_DEV g_uart2port /* UART2 is ttyS3 */ # define UART2_ASSIGNED 1 #elif defined(CONFIG_SAMA5_UART3) && !defined(UART3_ASSIGNED) -# define TTYS3_DEV g_uart1port /* UART3 is ttyS3 */ +# define TTYS3_DEV g_uart3port /* UART3 is ttyS3 */ # define UART3_ASSIGNED 1 #elif defined(CONFIG_SAMA5_UART4) && !defined(UART4_ASSIGNED) # define TTYS3_DEV g_uart1port /* UART4 is ttyS3 */ @@ -290,10 +290,10 @@ */ #if defined(CONFIG_SAMA5_UART3) && !defined(UART3_ASSIGNED) -# define TTYS4_DEV g_uart1port /* UART3 is ttyS4 */ +# define TTYS4_DEV g_uart3port /* UART3 is ttyS4 */ # define UART3_ASSIGNED 1 #elif defined(CONFIG_SAMA5_UART4) && !defined(UART4_ASSIGNED) -# define TTYS4_DEV g_uart1port /* UART4 is ttyS4 */ +# define TTYS4_DEV g_uart4port /* UART4 is ttyS4 */ # define UART4_ASSIGNED 1 #elif defined(CONFIG_USART0_SERIALDRIVER) && !defined(USART0_ASSIGNED) # define TTYS4_DEV g_usart0port /* USART0 is ttyS4 */ From 716100c550ef3dfe67aabdc1498e86a5e4b8c911 Mon Sep 17 00:00:00 2001 From: Adam Feuer Date: Sat, 28 Dec 2019 00:36:45 +0000 Subject: [PATCH 3/8] fix some minor typos --- boards/arm/sama5/sama5d2-xult/README.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/boards/arm/sama5/sama5d2-xult/README.txt b/boards/arm/sama5/sama5d2-xult/README.txt index ea42732b36a93..912b03664e4d4 100644 --- a/boards/arm/sama5/sama5d2-xult/README.txt +++ b/boards/arm/sama5/sama5d2-xult/README.txt @@ -64,7 +64,7 @@ DRAMBOOT, AT25BOOT, SRAMBOOT The boards/arm/sama5/sama5d4-xult/README.txt also describes variants AT25BOOT and SRAMBOOT. This have not yet been ported to the SAMA5D2-XULT, but are - available if they are usefult too you. + available if they are useful too you. Running NuttX from SDRAM ======================== @@ -203,7 +203,7 @@ REVISIT: Unverified, cloned text from the SAMA5D4-EK README.txt http://www.at91.com/linux4sam/bin/view/Linux4SAM/U-Boot#Build_U_Boot_from_sources - A pre-Built binay image is available here: + A pre-Built binary image is available here: ftp://www.at91.com/pub/uboot/u-boot-v2013.07/u-boot-sama5d3_xplained-v2013.07-at91-r1.bin @@ -237,7 +237,7 @@ REVISIT: Unverified, cloned text from the SAMA5D4-EK README.txt - Press the "Send File" button - Close SAM-BA, remove the USB Device cable. - You should now be able to interrupt with U-Boot vie the DBGU interface. + You should now be able to interrupt with U-Boot via the DBGU interface. Load NuttX with U-Boot on AT91 boards ------------------------------------- @@ -489,7 +489,7 @@ Serial Console ---- ------------------------ ------------- Standard UART on Arduino connector (J21) is FLEXCOM4. - Terminology: FLEXCOM is the same as USART in previous SAMA5D versions. + Terminologicy: FLEXCOM is the same as USART in previous SAMA5D versions. ---- ------- ------------- J21 BOARD SAMA5D2 From e83f7845f6513eb1b5304b4cf4471431f70b1c0e Mon Sep 17 00:00:00 2001 From: Adam Feuer Date: Sat, 28 Dec 2019 00:41:50 +0000 Subject: [PATCH 4/8] fix typo --- boards/arm/sama5/sama5d2-xult/README.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/arm/sama5/sama5d2-xult/README.txt b/boards/arm/sama5/sama5d2-xult/README.txt index 912b03664e4d4..f0e3b99de4c02 100644 --- a/boards/arm/sama5/sama5d2-xult/README.txt +++ b/boards/arm/sama5/sama5d2-xult/README.txt @@ -489,7 +489,7 @@ Serial Console ---- ------------------------ ------------- Standard UART on Arduino connector (J21) is FLEXCOM4. - Terminologicy: FLEXCOM is the same as USART in previous SAMA5D versions. + Terminology: FLEXCOM is the same as USART in previous SAMA5D versions. ---- ------- ------------- J21 BOARD SAMA5D2 From 9b384125c28f467a24ef66c4d8b385594f8e6624 Mon Sep 17 00:00:00 2001 From: Adam Feuer Date: Sat, 28 Dec 2019 01:49:36 +0000 Subject: [PATCH 5/8] updating pinmap with default UARTn_RXD, _TXD - so nuttx will get further in the compile --- arch/arm/src/sama5/hardware/_sama5d2x_pinmap.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/src/sama5/hardware/_sama5d2x_pinmap.h b/arch/arm/src/sama5/hardware/_sama5d2x_pinmap.h index 1c9d4d59928b2..3f3d31d16817c 100644 --- a/arch/arm/src/sama5/hardware/_sama5d2x_pinmap.h +++ b/arch/arm/src/sama5/hardware/_sama5d2x_pinmap.h @@ -769,6 +769,8 @@ #define PIO_UART1_RXD_2 (PIO_PERIPHE | PIO_CFG_DEFAULT | PIO_PORT_PIOC | PIO_PIN7) #define PIO_UART1_TXD_1 (PIO_PERIPHA | PIO_CFG_DEFAULT | PIO_PORT_PIOD | PIO_PIN3) #define PIO_UART1_TXD_2 (PIO_PERIPHE | PIO_CFG_DEFAULT | PIO_PORT_PIOC | PIO_PIN8) +#define PIO_UART2_RXD PIO_UART1_RXD_1 +#define PIO_UART2_TXD PIO_UART1_TXD_1 #define PIO_UART2_RXD_1 (PIO_PERIPHA | PIO_CFG_DEFAULT | PIO_PORT_PIOD | PIO_PIN23) #define PIO_UART2_RXD_2 (PIO_PERIPHB | PIO_CFG_DEFAULT | PIO_PORT_PIOD | PIO_PIN4) @@ -776,6 +778,8 @@ #define PIO_UART2_TXD_1 (PIO_PERIPHA | PIO_CFG_DEFAULT | PIO_PORT_PIOD | PIO_PIN24) #define PIO_UART2_TXD_2 (PIO_PERIPHB | PIO_CFG_DEFAULT | PIO_PORT_PIOD | PIO_PIN5) #define PIO_UART2_TXD_3 (PIO_PERIPHC | PIO_CFG_DEFAULT | PIO_PORT_PIOD | PIO_PIN20) +#define PIO_UART2_RXD PIO_UART2_RXD_1 +#define PIO_UART2_TXD PIO_UART2_TXD_1 #define PIO_UART3_RXD_1 (PIO_PERIPHC | PIO_CFG_DEFAULT | PIO_PORT_PIOB | PIO_PIN11) #define PIO_UART3_RXD_2 (PIO_PERIPHC | PIO_CFG_DEFAULT | PIO_PORT_PIOC | PIO_PIN31) @@ -783,6 +787,8 @@ #define PIO_UART3_TXD_1 (PIO_PERIPHC | PIO_CFG_DEFAULT | PIO_PORT_PIOB | PIO_PIN12) #define PIO_UART3_TXD_2 (PIO_PERIPHC | PIO_CFG_DEFAULT | PIO_PORT_PIOD | PIO_PIN0) #define PIO_UART3_TXD_3 (PIO_PERIPHD | PIO_CFG_DEFAULT | PIO_PORT_PIOC | PIO_PIN13) +#define PIO_UART3_RXD PIO_UART3_RXD_1 +#define PIO_UART3_TXD PIO_UART3_TXD_1 #define PIO_UART4_RXD (PIO_PERIPHA | PIO_CFG_DEFAULT | PIO_PORT_PIOB | PIO_PIN3) #define PIO_UART4_TXD (PIO_PERIPHA | PIO_CFG_DEFAULT | PIO_PORT_PIOB | PIO_PIN4) From 5df08ca9fcb63cf54c30418178dd3fed42aa0971 Mon Sep 17 00:00:00 2001 From: Adam Feuer Date: Sat, 28 Dec 2019 02:30:30 +0000 Subject: [PATCH 6/8] moving UART pin disambiguation to board.h --- .../arm/src/sama5/hardware/_sama5d2x_pinmap.h | 6 ---- boards/arm/sama5/sama5d2-xult/include/board.h | 28 +++++++++++++++++++ 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/arch/arm/src/sama5/hardware/_sama5d2x_pinmap.h b/arch/arm/src/sama5/hardware/_sama5d2x_pinmap.h index 3f3d31d16817c..1c9d4d59928b2 100644 --- a/arch/arm/src/sama5/hardware/_sama5d2x_pinmap.h +++ b/arch/arm/src/sama5/hardware/_sama5d2x_pinmap.h @@ -769,8 +769,6 @@ #define PIO_UART1_RXD_2 (PIO_PERIPHE | PIO_CFG_DEFAULT | PIO_PORT_PIOC | PIO_PIN7) #define PIO_UART1_TXD_1 (PIO_PERIPHA | PIO_CFG_DEFAULT | PIO_PORT_PIOD | PIO_PIN3) #define PIO_UART1_TXD_2 (PIO_PERIPHE | PIO_CFG_DEFAULT | PIO_PORT_PIOC | PIO_PIN8) -#define PIO_UART2_RXD PIO_UART1_RXD_1 -#define PIO_UART2_TXD PIO_UART1_TXD_1 #define PIO_UART2_RXD_1 (PIO_PERIPHA | PIO_CFG_DEFAULT | PIO_PORT_PIOD | PIO_PIN23) #define PIO_UART2_RXD_2 (PIO_PERIPHB | PIO_CFG_DEFAULT | PIO_PORT_PIOD | PIO_PIN4) @@ -778,8 +776,6 @@ #define PIO_UART2_TXD_1 (PIO_PERIPHA | PIO_CFG_DEFAULT | PIO_PORT_PIOD | PIO_PIN24) #define PIO_UART2_TXD_2 (PIO_PERIPHB | PIO_CFG_DEFAULT | PIO_PORT_PIOD | PIO_PIN5) #define PIO_UART2_TXD_3 (PIO_PERIPHC | PIO_CFG_DEFAULT | PIO_PORT_PIOD | PIO_PIN20) -#define PIO_UART2_RXD PIO_UART2_RXD_1 -#define PIO_UART2_TXD PIO_UART2_TXD_1 #define PIO_UART3_RXD_1 (PIO_PERIPHC | PIO_CFG_DEFAULT | PIO_PORT_PIOB | PIO_PIN11) #define PIO_UART3_RXD_2 (PIO_PERIPHC | PIO_CFG_DEFAULT | PIO_PORT_PIOC | PIO_PIN31) @@ -787,8 +783,6 @@ #define PIO_UART3_TXD_1 (PIO_PERIPHC | PIO_CFG_DEFAULT | PIO_PORT_PIOB | PIO_PIN12) #define PIO_UART3_TXD_2 (PIO_PERIPHC | PIO_CFG_DEFAULT | PIO_PORT_PIOD | PIO_PIN0) #define PIO_UART3_TXD_3 (PIO_PERIPHD | PIO_CFG_DEFAULT | PIO_PORT_PIOC | PIO_PIN13) -#define PIO_UART3_RXD PIO_UART3_RXD_1 -#define PIO_UART3_TXD PIO_UART3_TXD_1 #define PIO_UART4_RXD (PIO_PERIPHA | PIO_CFG_DEFAULT | PIO_PORT_PIOB | PIO_PIN3) #define PIO_UART4_TXD (PIO_PERIPHA | PIO_CFG_DEFAULT | PIO_PORT_PIOB | PIO_PIN4) diff --git a/boards/arm/sama5/sama5d2-xult/include/board.h b/boards/arm/sama5/sama5d2-xult/include/board.h index dd813233a47b8..187680df31eed 100644 --- a/boards/arm/sama5/sama5d2-xult/include/board.h +++ b/boards/arm/sama5/sama5d2-xult/include/board.h @@ -228,6 +228,34 @@ #define PIO_UART1_RXD PIO_UART1_RXD_1 #define PIO_UART1_TXD PIO_UART1_TXD_1 +/* Standard UART on Arduino connector (J22) is UART2. + * + * ---- ------- ------------- + * J22 BOARD SAMA5D2 + * PIN NAME PIO FUNCTION + * ---- ------- ------------- + * 7 URXD2 PD4 UART2 + * 8 URXD2 PD5 UART2 + * ---- ------- ------------- + */ + +#define PIO_UART2_RXD PIO_UART2_RXD_2 +#define PIO_UART2_TXD PIO_UART2_TXD_2 + +/* Standard UART on Arduino connector (J17) is UART3. + * + * ---- ------- ------------- + * J17 BOARD SAMA5D2 + * PIN NAME PIO FUNCTION + * ---- ------- ------------- + * 27 URXD3 PB11 UART3 + * 28 URXD3 PB12 UART3 + * ---- ------- ------------- + */ + +#define PIO_UART3_RXD PIO_UART3_RXD_1 +#define PIO_UART3_TXD PIO_UART3_TXD_1 + /* Standard UART on Arduino connector (J21) is FLEXCOM4. * * ---- ------- ------------- From dbc2d546157f6ad962da8d528bc5864915f19be3 Mon Sep 17 00:00:00 2001 From: Adam Feuer Date: Sat, 28 Dec 2019 02:33:28 +0000 Subject: [PATCH 7/8] fixing typo in USART pin docs --- boards/arm/sama5/sama5d2-xult/include/board.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/boards/arm/sama5/sama5d2-xult/include/board.h b/boards/arm/sama5/sama5d2-xult/include/board.h index 187680df31eed..4a3a1728fa8d0 100644 --- a/boards/arm/sama5/sama5d2-xult/include/board.h +++ b/boards/arm/sama5/sama5d2-xult/include/board.h @@ -235,7 +235,7 @@ * PIN NAME PIO FUNCTION * ---- ------- ------------- * 7 URXD2 PD4 UART2 - * 8 URXD2 PD5 UART2 + * 8 UTXD2 PD5 UART2 * ---- ------- ------------- */ @@ -249,7 +249,7 @@ * PIN NAME PIO FUNCTION * ---- ------- ------------- * 27 URXD3 PB11 UART3 - * 28 URXD3 PB12 UART3 + * 28 UTXD3 PB12 UART3 * ---- ------- ------------- */ From 076e6ab76a12eeb0ae9a9f0c09d459b63be28542 Mon Sep 17 00:00:00 2001 From: Adam Feuer Date: Sat, 28 Dec 2019 02:35:28 +0000 Subject: [PATCH 8/8] clarified UART pin function in comments --- boards/arm/sama5/sama5d2-xult/include/board.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/boards/arm/sama5/sama5d2-xult/include/board.h b/boards/arm/sama5/sama5d2-xult/include/board.h index 4a3a1728fa8d0..5680c90b2a5a7 100644 --- a/boards/arm/sama5/sama5d2-xult/include/board.h +++ b/boards/arm/sama5/sama5d2-xult/include/board.h @@ -234,8 +234,8 @@ * J22 BOARD SAMA5D2 * PIN NAME PIO FUNCTION * ---- ------- ------------- - * 7 URXD2 PD4 UART2 - * 8 UTXD2 PD5 UART2 + * 7 URXD2 PD4 UART2 URXD2 + * 8 UTXD2 PD5 UART2 UTXD2 * ---- ------- ------------- */ @@ -248,8 +248,8 @@ * J17 BOARD SAMA5D2 * PIN NAME PIO FUNCTION * ---- ------- ------------- - * 27 URXD3 PB11 UART3 - * 28 UTXD3 PB12 UART3 + * 27 URXD3 PB11 UART3 URXD3 + * 28 UTXD3 PB12 UART3 UTXD3 * ---- ------- ------------- */