From 05d828642df8e1861fb3dcb8bd89949a83ba1beb Mon Sep 17 00:00:00 2001 From: modaltb <50114502+modaltb@users.noreply.github.com> Date: Wed, 18 Jan 2023 20:01:57 -0800 Subject: [PATCH] boards/modalai: FCv1 DMA optimiziation for 2Mbit UART (#20956) - disable unused SPI3 DMA - enable USART2 RX/TX, UART5/6 TX, UART4 RX --- .../modalai/fc-v1/nuttx-config/include/board_dma_map.h | 10 +++++++--- boards/modalai/fc-v1/nuttx-config/nsh/defconfig | 5 +++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/boards/modalai/fc-v1/nuttx-config/include/board_dma_map.h b/boards/modalai/fc-v1/nuttx-config/include/board_dma_map.h index 249e6a0563..6a21b964e1 100644 --- a/boards/modalai/fc-v1/nuttx-config/include/board_dma_map.h +++ b/boards/modalai/fc-v1/nuttx-config/include/board_dma_map.h @@ -50,7 +50,7 @@ | Channel 8 | I2C3_TX | I2C4_RX | - | - | I2C2_TX | - | I2C4_TX | - | | Channel 9 | - | SPI2_RX | - | - | - | - | SPI2_TX | - | | | | | | | | | | | -| Usage | | SPI2_RX | SPI3_RX_2 | UART7_RX | SPI2_TX | SPI3_TX_1 | TIM4_UP | | +| Usage | UART5_RX | SPI2_RX | UART4_RX | UART7_RX | SPI2_TX | USART2_RX |TIM4_UP /USART2_TX| UART5_TX | | DMA2 | Stream 0 | Stream 1 | Stream 2 | Stream 3 | Stream 4 | Stream 5 | Stream 6 | Stream 7 | @@ -81,11 +81,15 @@ //--------------------------------------------//---------------------------//---------------- // DMAMAP_UART5_RX // DMA1, Stream 0, Channel 4 (TELEM2 RX) #define DMAMAP_SPI2_RX DMAMAP_SPI2_RX_1 // DMA1, Stream 1, Channel 9 (SPI2 RX) -#define DMAMAP_SPI3_RX DMAMAP_SPI3_RX_2 // DMA1, Stream 2, Channel 0 (SPI3 RX) +// DMAMAP_UART4_RX // DMA1, Stream 2, Channel 4 (EXPANSION RX) +//#define DMAMAP_SPI3_RX DMAMAP_SPI3_RX_2 // DMA1, Stream 2, Channel 0 (SPI3 RX) // DMAMAP_UART7_RX // DMA1, Stream 3, Channel 5 (TELEM1 RX) #define DMAMAP_SPI2_TX DMAMAP_SPI2_TX_2 // DMA1, Stream 4, Channel 0 (SPI2 TX) -#define DMAMAP_SPI3_TX DMAMAP_SPI3_TX_1 // DMA1, Stream 5, Channel 0 (SPI3 TX) +//#define DMAMAP_SPI3_TX DMAMAP_SPI3_TX_1 // DMA1, Stream 5, Channel 0 (ESC RX) +// DMAMAP_USART2_RX // DMA1, Stream 5, Channel 4 (SPI3 TX) // DMAMAP_TIM4_UP // DMA1, Stream 6, Channel 2 (DSHOT) +// DMAMAP_USART2_TX // DMA1, Stream 6, Channel 4 (ESC TX) +// DMAMAP_UART5_TX // DMA1, Stream 7, Channel 4 (TELEM2 TX) // DMA2 Channel/Stream Selections //--------------------------------------------//---------------------------//---------------- diff --git a/boards/modalai/fc-v1/nuttx-config/nsh/defconfig b/boards/modalai/fc-v1/nuttx-config/nsh/defconfig index b2d2e7eb77..574f7ec2f8 100644 --- a/boards/modalai/fc-v1/nuttx-config/nsh/defconfig +++ b/boards/modalai/fc-v1/nuttx-config/nsh/defconfig @@ -233,12 +233,14 @@ CONFIG_SYSTEM_NSH=y CONFIG_TASK_NAME_SIZE=24 CONFIG_UART4_BAUD=57600 CONFIG_UART4_RXBUFSIZE=600 +CONFIG_UART4_RXDMA=y CONFIG_UART4_TXBUFSIZE=1500 CONFIG_UART5_IFLOWCONTROL=y CONFIG_UART5_OFLOWCONTROL=y CONFIG_UART5_RXBUFSIZE=600 CONFIG_UART5_RXDMA=y CONFIG_UART5_TXBUFSIZE=1500 +CONFIG_UART5_TXDMA=y CONFIG_UART7_BAUD=57600 CONFIG_UART7_IFLOWCONTROL=y CONFIG_UART7_OFLOWCONTROL=y @@ -255,7 +257,9 @@ CONFIG_USART2_BAUD=57600 CONFIG_USART2_IFLOWCONTROL=y CONFIG_USART2_OFLOWCONTROL=y CONFIG_USART2_RXBUFSIZE=600 +CONFIG_USART2_RXDMA=y CONFIG_USART2_TXBUFSIZE=3000 +CONFIG_USART2_TXDMA=y CONFIG_USART3_BAUD=57600 CONFIG_USART3_RXBUFSIZE=180 CONFIG_USART3_SERIAL_CONSOLE=y @@ -264,6 +268,7 @@ CONFIG_USART6_BAUD=57600 CONFIG_USART6_RXBUFSIZE=600 CONFIG_USART6_RXDMA=y CONFIG_USART6_TXBUFSIZE=1500 +CONFIG_USART6_TXDMA=y CONFIG_USBDEV=y CONFIG_USBDEV_BUSPOWERED=y CONFIG_USBDEV_MAXPOWER=500