aboutsummaryrefslogtreecommitdiff
path: root/nuttx
diff options
context:
space:
mode:
authorpx4dev <px4@purgatory.org>2012-09-07 02:35:58 -0700
committerpx4dev <px4@purgatory.org>2012-09-07 02:35:58 -0700
commite7b29c3eacdc97c409d5354b87d93067eb35d3b9 (patch)
treee777de7add0b7a7a46a35836a6771806d780bfb5 /nuttx
parente8307aba176dad21601c6e05db7d4d58999b992d (diff)
downloadpx4-firmware-e7b29c3eacdc97c409d5354b87d93067eb35d3b9.tar.gz
px4-firmware-e7b29c3eacdc97c409d5354b87d93067eb35d3b9.tar.bz2
px4-firmware-e7b29c3eacdc97c409d5354b87d93067eb35d3b9.zip
Fix receive DMA for the console device. Now maybe MAVLink will work better.
Diffstat (limited to 'nuttx')
-rw-r--r--nuttx/arch/arm/src/stm32/stm32_serial.c7
-rwxr-xr-xnuttx/configs/px4fmu/nsh/defconfig6
2 files changed, 12 insertions, 1 deletions
diff --git a/nuttx/arch/arm/src/stm32/stm32_serial.c b/nuttx/arch/arm/src/stm32/stm32_serial.c
index 265abfbf3..83acc676b 100644
--- a/nuttx/arch/arm/src/stm32/stm32_serial.c
+++ b/nuttx/arch/arm/src/stm32/stm32_serial.c
@@ -1835,6 +1835,13 @@ void up_serialinit(void)
#if CONSOLE_UART > 0
(void)uart_register("/dev/console", &uart_devs[CONSOLE_UART - 1]->dev);
(void)uart_register("/dev/ttyS0", &uart_devs[CONSOLE_UART - 1]->dev);
+
+ /* If we need to re-initialise the console (e.g. to enable DMA) do that here. */
+
+# if CONFIG_SERIAL_CONSOLE_REINIT
+ uart_devs[CONSOLE_UART - 1]->dev.ops->setup(&uart_devs[CONSOLE_UART - 1]->dev);
+# endif
+
#endif
/* Register all remaining USARTs */
diff --git a/nuttx/configs/px4fmu/nsh/defconfig b/nuttx/configs/px4fmu/nsh/defconfig
index 89322daf9..4d2b254bd 100755
--- a/nuttx/configs/px4fmu/nsh/defconfig
+++ b/nuttx/configs/px4fmu/nsh/defconfig
@@ -221,6 +221,9 @@ CONFIG_AT24XX_MTD_BLOCKSIZE=256
# tcflush, etc.). If this is not defined, then the terminal settings (baud,
# parity, etc.) are not configurable at runtime; serial streams cannot be
# flushed, etc.
+# CONFIG_SERIAL_CONSOLE_REINIT - re-initializes the console serial port
+# immediately after creating the /dev/console device. This is required
+# if the console serial port has RX DMA enabled.
#
# CONFIG_USARTn_SERIAL_CONSOLE - selects the USARTn for the
# console and ttys0 (default is the USART1).
@@ -234,6 +237,7 @@ CONFIG_AT24XX_MTD_BLOCKSIZE=256
# CONFIG_USARTn_2STOP - Two stop bits
#
CONFIG_SERIAL_TERMIOS=y
+CONFIG_SERIAL_CONSOLE_REINIT=y
CONFIG_USART1_SERIAL_CONSOLE=y
CONFIG_USART2_SERIAL_CONSOLE=n
@@ -285,7 +289,7 @@ CONFIG_USART4_2STOP=0
CONFIG_USART5_2STOP=0
CONFIG_USART6_2STOP=0
-CONFIG_USART1_RXDMA=n
+CONFIG_USART1_RXDMA=y
CONFIG_USART2_RXDMA=y
CONFIG_USART3_RXDMA=n
CONFIG_USART4_RXDMA=n