From d72b8a873c8a3173f7eb342881e6f7b9cee120cb Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 11 Jun 2013 19:24:47 -0600 Subject: Use UART1 for the console on the SAM4S-Xplained not USART0 --- nuttx/arch/arm/src/sam34/Kconfig | 2 +- nuttx/arch/arm/src/sam34/chip/sam3u_pmc.h | 9 +++--- nuttx/configs/sam4s-xplained/README.txt | 44 ++++++++++++++++++--------- nuttx/configs/sam4s-xplained/ostest/defconfig | 28 ++++++++--------- 4 files changed, 50 insertions(+), 33 deletions(-) diff --git a/nuttx/arch/arm/src/sam34/Kconfig b/nuttx/arch/arm/src/sam34/Kconfig index 58085a236..2ca8cdc81 100644 --- a/nuttx/arch/arm/src/sam34/Kconfig +++ b/nuttx/arch/arm/src/sam34/Kconfig @@ -243,7 +243,7 @@ config SAM34_UART0 depends on ARCH_CHIP_SAM3U || ARCH_CHIP_SAM4S select ARCH_HAVE_UART0 -config SAM43_UART1 +config SAM34_UART1 bool "UART 1" default n depends on ARCH_CHIP_SAM4S diff --git a/nuttx/arch/arm/src/sam34/chip/sam3u_pmc.h b/nuttx/arch/arm/src/sam34/chip/sam3u_pmc.h index 1eebd7df5..500ad5701 100644 --- a/nuttx/arch/arm/src/sam34/chip/sam3u_pmc.h +++ b/nuttx/arch/arm/src/sam34/chip/sam3u_pmc.h @@ -181,7 +181,7 @@ * Peripheral Clock Status Register common bit-field definitions. */ -#define PMC_PID(n) (1 << (n)) +#define PMC_PIDL(n) (1 << (n)) #define PMC_PID2 (1 << 2) /* Bit 2: Peripheral Clock 2 Enable */ #define PMC_PID3 (1 << 3) /* Bit 3: Peripheral Clock 3 Enable */ #define PMC_PID4 (1 << 4) /* Bit 4: Peripheral Clock 4 Enable */ @@ -443,9 +443,10 @@ /* Peripheral Clock Status Register 1 */ #if defined(CONFIG_ARCH_CHIP_SAM4S) -# define PMC_PIC32 (1 << 0) /* Bit 0: PID32 */ -# define PMC_PIC33 (1 << 1) /* Bit 1: PID33 */ -# define PMC_PIC34 (1 << 2) /* Bit 2: PID34 */ +# define PMC_PIDH(n) (1 << ((n) - 32)) +# define PMC_PID32 (1 << 0) /* Bit 0: PID32 */ +# define PMC_PID33 (1 << 1) /* Bit 1: PID33 */ +# define PMC_PID34 (1 << 2) /* Bit 2: PID34 */ #endif /* Oscillator Calibration Register */ diff --git a/nuttx/configs/sam4s-xplained/README.txt b/nuttx/configs/sam4s-xplained/README.txt index 17863d7d3..01e5d9e65 100644 --- a/nuttx/configs/sam4s-xplained/README.txt +++ b/nuttx/configs/sam4s-xplained/README.txt @@ -318,8 +318,24 @@ Serial Consoles ------ If you have a TTL to RS-232 convertor then this is the most convenient - serial console to use. It is the default in all of these configurations. - An option is to use the virtual COM port. + serial console to use. UART1 is the default in all of these + configurations. + + UART1 RXD PB2 J1 pin 3 J4 pin 3 + UART1 TXD PB3 J1 pin 4 J4 pin 4 + GND J1 pin 9 J4 pin 9 + Vdd J1 pin 10 J4 pin 10 + + USART1 is another option: + + USART1 RXD PA21 J2 pin 6 + USART1 TXD PA22 J2 pin 1 + GND J2 pin 9 + Vdd J2 pin 10 + + Yet another option is to use UART0 and the virtual COM port. This + option may be more convenient for long term development, but was + painful to use during board bring-up. Virtual COM Port ---------------- @@ -516,25 +532,25 @@ Configurations NOTES: - 1. This configuration provides test output on USART0 which is available - on EXT1 or EXT4 (see the section "Serial Consoles" above). The + 1. This configuration provides test output on UART1 which is available + on J3 or J4 (see the section "Serial Consoles" above). The virtual COM port could be used, instead, by reconfiguring to use - USART1 instead of USART0: + UART0 instead of UART1: System Type -> AT91SAM3/4 Peripheral Support - CONFIG_SAM_USART0=y - CONFIG_SAM_USART1=n + CONFIG_SAM_UART0=y + CONFIG_SAM_UART1=n Device Drivers -> Serial Driver Support -> Serial Console - CONFIG_USART0_SERIAL_CONSOLE=y + CONFIG_UART0_SERIAL_CONSOLE=y Device Drivers -> Serial Driver Support -> USART0 Configuration - CONFIG_USART0_2STOP=0 - CONFIG_USART0_BAUD=115200 - CONFIG_USART0_BITS=8 - CONFIG_USART0_PARITY=0 - CONFIG_USART0_RXBUFSIZE=256 - CONFIG_USART0_TXBUFSIZE=256 + CONFIG_UART0_2STOP=0 + CONFIG_UART0_BAUD=115200 + CONFIG_UART0_BITS=8 + CONFIG_UART0_PARITY=0 + CONFIG_UART0_RXBUFSIZE=256 + CONFIG_UART0_TXBUFSIZE=256 2. This configuration is set up to use the NuttX OABI toolchain (see above). Of course this can be reconfigured if you prefer a different diff --git a/nuttx/configs/sam4s-xplained/ostest/defconfig b/nuttx/configs/sam4s-xplained/ostest/defconfig index 1202cc855..8603d32e6 100644 --- a/nuttx/configs/sam4s-xplained/ostest/defconfig +++ b/nuttx/configs/sam4s-xplained/ostest/defconfig @@ -139,8 +139,8 @@ CONFIG_ARCH_CHIP_SAM4S=y # CONFIG_SAM34_TWIM1 is not set # CONFIG_SAM34_TWIS1 is not set # CONFIG_SAM34_UART0 is not set -# CONFIG_SAM43_UART1 is not set -CONFIG_SAM34_USART0=y +CONFIG_SAM34_UART1=y +# CONFIG_SAM34_USART0 is not set # CONFIG_SAM34_USART1 is not set # CONFIG_SAM34_ADC12B is not set # CONFIG_SAM34_DACC is not set @@ -157,7 +157,6 @@ CONFIG_SAM34_USART0=y # # AT91SAM3/4 USART Configuration # -CONFIG_USART0_ISUART=y # # AT91SAM3/4 GPIO Interrupt Configuration @@ -318,22 +317,23 @@ CONFIG_DEV_NULL=y CONFIG_SERIAL=y CONFIG_DEV_LOWCONSOLE=y # CONFIG_16550_UART is not set -CONFIG_ARCH_HAVE_USART0=y +CONFIG_ARCH_HAVE_UART1=y CONFIG_MCU_SERIAL=y -CONFIG_USART0_SERIAL_CONSOLE=y +# CONFIG_USART0_SERIAL_CONSOLE is not set +CONFIG_UART1_SERIAL_CONSOLE=y # CONFIG_NO_SERIAL_CONSOLE is not set # -# USART0 Configuration +# UART1 Configuration # -CONFIG_USART0_RXBUFSIZE=256 -CONFIG_USART0_TXBUFSIZE=256 -CONFIG_USART0_BAUD=115200 -CONFIG_USART0_BITS=8 -CONFIG_USART0_PARITY=0 -CONFIG_USART0_2STOP=0 -# CONFIG_USART0_IFLOWCONTROL is not set -# CONFIG_USART0_OFLOWCONTROL is not set +CONFIG_UART1_RXBUFSIZE=256 +CONFIG_UART1_TXBUFSIZE=256 +CONFIG_UART1_BAUD=115200 +CONFIG_UART1_BITS=8 +CONFIG_UART1_PARITY=0 +CONFIG_UART1_2STOP=0 +# CONFIG_UART1_IFLOWCONTROL is not set +# CONFIG_UART1_OFLOWCONTROL is not set # CONFIG_SERIAL_IFLOWCONTROL is not set # CONFIG_SERIAL_OFLOWCONTROL is not set # CONFIG_USBDEV is not set -- cgit v1.2.3