Correct several errors in STM32 serial port configuration
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3744 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
eb138a3ef7
commit
ba9d75a05a
11
ChangeLog
11
ChangeLog
@ -1856,4 +1856,15 @@
|
||||
Storage Demo Board," Model DB-DP11215 (http://www.sureelectronics.net/goods.php?id=1168).
|
||||
This board features the MicroChip PIC32MX440F512H MCU. (Untested on initial
|
||||
check-in).
|
||||
* configs/stm3210e-eval/nsh2: Add another NSH configuration for the STM32 with
|
||||
some different properties.
|
||||
* CONFIG_NSH_CONDEV: Add a configuration option to allow using a different character
|
||||
device (such a a different UART) for the NSH interface. This allows, for example,
|
||||
debug output to come from the console device while using another device for NSH.
|
||||
There are some issues on initial check-in: NuttX doesn't have termios and the
|
||||
console device has special properties that make using NSH awkward. Examples:
|
||||
No CR-LF expansion, no character echoing, no command line editting.
|
||||
* arch/arm/src/stm32/stm32_lowputc.c and stm32_serial.c. Correct severl bugs
|
||||
involving serial port configuration. These bugs are only critical if you
|
||||
are trying to using multiple UARTs on STM32.
|
||||
|
||||
|
@ -2155,6 +2155,12 @@ nsh>
|
||||
This is useful, for example, to separate the NSH command line from the system console
|
||||
when the system console is used to provide debug output.
|
||||
Default: <code>stdin</code> and <code>stdout</code> (probably "<code>/dev/console</code>")
|
||||
<ul><small>
|
||||
NOTE: When any other device other than <code>/dev/console</code> is used for a user interface,
|
||||
(1) linefeeds (<code>\n</code>) will not be expanded to carriage return / linefeeds (<code>\r\n</code>).
|
||||
You will need to configure your terminal program to account for this.
|
||||
And (2) input is not automatically echoed so you will have to turn local echo on.
|
||||
</small></ul>
|
||||
</td>
|
||||
<tr>
|
||||
<td valign="top"><b><code>CONFIG_NSH_TELNET</code></b></td>
|
||||
|
@ -162,9 +162,9 @@
|
||||
|
||||
#define STM32_USARTDIV32 (STM32_APBCLOCK / (STM32_CONSOLE_BAUD >> 1))
|
||||
|
||||
/* The mantissa is then usartdiv32 * 32:
|
||||
/* The mantissa is then usartdiv32 / 32:
|
||||
*
|
||||
* mantissa = 32 * usartdiv32
|
||||
* mantissa = usartdiv32 / 32/
|
||||
*
|
||||
* Eg. usartdiv32=1250, mantissa = 39
|
||||
*/
|
||||
@ -247,7 +247,7 @@ void stm32_lowsetup(void)
|
||||
uint32_t cr;
|
||||
#endif
|
||||
|
||||
/* Enable the selected USARTs and configure GPIO pins need byed the
|
||||
/* Enable the selected USARTs and configure GPIO pins need by the
|
||||
* the selected USARTs. NOTE: The serial driver later depends on
|
||||
* this pin configuration -- whether or not a serial console is selected.
|
||||
*
|
||||
|
@ -425,8 +425,8 @@ static inline void up_disableusartint(struct up_dev_s *priv, uint16_t *ie)
|
||||
static int up_setup(struct uart_dev_s *dev)
|
||||
{
|
||||
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
|
||||
#ifdef CONFIG_SUPPRESS_UART_CONFIG
|
||||
uint32_t uartdiv32;
|
||||
#ifndef CONFIG_SUPPRESS_UART_CONFIG
|
||||
uint32_t usartdiv32;
|
||||
uint32_t mantissa;
|
||||
uint32_t fraction;
|
||||
uint32_t brr;
|
||||
@ -483,7 +483,7 @@ static int up_setup(struct uart_dev_s *dev)
|
||||
|
||||
/* Configure hardware flow control -- Not yet supported */
|
||||
|
||||
up_serialout(priv, STM32_USART_CR1_OFFSET, regval);
|
||||
up_serialout(priv, STM32_USART_CR3_OFFSET, regval);
|
||||
|
||||
/* Configure the USART Baud Rate. The baud rate for the receiver and
|
||||
* transmitter (Rx and Tx) are both set to the same value as programmed
|
||||
@ -521,7 +521,7 @@ static int up_setup(struct uart_dev_s *dev)
|
||||
up_serialout(priv, STM32_USART_CR1_OFFSET, regval);
|
||||
#endif
|
||||
|
||||
/* Set up the cache interrupt enables value */
|
||||
/* Set up the cached interrupt enables value */
|
||||
|
||||
priv->ie = 0;
|
||||
return OK;
|
||||
|
@ -430,13 +430,13 @@ Where <subdir> is one of the following:
|
||||
=========== ======================= ================================
|
||||
nsh nsh2
|
||||
=========== ======================= ================================
|
||||
Toolchain: NuttX buildroot for Codesourcery for Windows*
|
||||
Linux or Cygwin*,**
|
||||
Toolchain: NuttX buildroot for Codesourcery for Windows *
|
||||
Linux or Cygwin *,**
|
||||
----------- ----------------------- --------------------------------
|
||||
Loader: DfuSe DfuSe
|
||||
----------- ----------------------- --------------------------------
|
||||
Serial Debug output: USART1 Debug output: USART1
|
||||
Console: NSH output: USART1 NSH output: USART2
|
||||
Console: NSH output: USART1 NSH output: USART2 ***
|
||||
----------- ----------------------- --------------------------------
|
||||
I2C1 Disabled Enabled
|
||||
=========== ======================= ================================
|
||||
@ -445,7 +445,12 @@ Where <subdir> is one of the following:
|
||||
to set up the correct PATH variable for whichever toolchain you
|
||||
may use.
|
||||
** Since DfuSe is assumed, this configuration may only work under
|
||||
Cygwin.
|
||||
Cygwin without modification.
|
||||
*** When any other device other than /dev/console is used for a user
|
||||
interface, (1) linefeeds (\n) will not be expanded to carriage return
|
||||
/ linefeeds \r\n). You will need to configure your terminal program
|
||||
to account for this. And (2) input is not automatically echoed so
|
||||
you will have to turn local echo on.
|
||||
|
||||
ostest:
|
||||
------
|
||||
|
@ -727,7 +727,7 @@ CONFIG_NSH_DISABLESCRIPT=n
|
||||
CONFIG_NSH_DISABLEBG=n
|
||||
CONFIG_NSH_ROMFSETC=n
|
||||
CONFIG_NSH_CONSOLE=y
|
||||
#CONFIG_NSH_CONDEV="/dev/ttyS1"
|
||||
CONFIG_NSH_CONDEV="/dev/ttyS1"
|
||||
CONFIG_NSH_TELNET=n
|
||||
CONFIG_NSH_ARCHINIT=y
|
||||
CONFIG_NSH_IOBUFFER_SIZE=512
|
||||
|
Loading…
Reference in New Issue
Block a user