From d04903cae523ea29082c73a7e812b62360fe74ff Mon Sep 17 00:00:00 2001 From: alexklimaj Date: Tue, 22 Oct 2024 11:51:27 -0600 Subject: [PATCH] DMA --- boards/ark/fpv/default.px4board | 5 ++- boards/ark/fpv/init/rc.board_defaults | 3 ++ boards/ark/fpv/nuttx-config/include/board.h | 9 ++-- .../fpv/nuttx-config/include/board_dma_map.h | 41 ++++++++++--------- boards/ark/fpv/nuttx-config/nsh/defconfig | 26 +++++++++--- 5 files changed, 54 insertions(+), 30 deletions(-) diff --git a/boards/ark/fpv/default.px4board b/boards/ark/fpv/default.px4board index df724712dbd6..6155148d2a4b 100644 --- a/boards/ark/fpv/default.px4board +++ b/boards/ark/fpv/default.px4board @@ -1,10 +1,11 @@ CONFIG_BOARD_TOOLCHAIN="arm-none-eabi" CONFIG_BOARD_ARCHITECTURE="cortex-m7" CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS0" -CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS5" -CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS3" +CONFIG_BOARD_SERIAL_TEL3="/dev/ttyS1" CONFIG_BOARD_SERIAL_TEL4="/dev/ttyS2" +CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS3" CONFIG_BOARD_SERIAL_RC="/dev/ttyS4" +CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS5" CONFIG_DRIVERS_ADC_BOARD_ADC=y CONFIG_DRIVERS_BAROMETER_BMP388=y CONFIG_DRIVERS_CDCACM_AUTOSTART=y diff --git a/boards/ark/fpv/init/rc.board_defaults b/boards/ark/fpv/init/rc.board_defaults index 9998d562d1e3..50a497b742b8 100644 --- a/boards/ark/fpv/init/rc.board_defaults +++ b/boards/ark/fpv/init/rc.board_defaults @@ -26,3 +26,6 @@ then fi param set-default BAT1_V_DIV 21.0 + +param set-default RC_CRSF_PRT_CFG 300 +param set-default RC_SBUS_PRT_CFG 0 diff --git a/boards/ark/fpv/nuttx-config/include/board.h b/boards/ark/fpv/nuttx-config/include/board.h index c6c67e38b98f..62ce5a8f5ef1 100644 --- a/boards/ark/fpv/nuttx-config/include/board.h +++ b/boards/ark/fpv/nuttx-config/include/board.h @@ -363,8 +363,11 @@ /* Alternate function pin selections ************************************************/ -#define GPIO_USART1_RX GPIO_USART1_RX_3 /* PB7 */ -#define GPIO_USART1_TX GPIO_USART1_TX_3 /* PB6 */ +#define GPIO_USART1_RX GPIO_USART1_RX_3 /* PB7 */ +#define GPIO_USART1_TX GPIO_USART1_TX_3 /* PB6 */ + +#define GPIO_USART2_RX GPIO_USART2_RX_1 /* PA3 */ +#define GPIO_USART2_TX GPIO_USART2_TX_2 /* PD5 */ #define GPIO_USART3_RX GPIO_USART3_RX_3 /* PD9 */ #define GPIO_USART3_TX GPIO_USART3_TX_3 /* PD8 */ @@ -375,7 +378,7 @@ #define GPIO_UART5_RX GPIO_UART5_RX_3 /* PD2 */ #define GPIO_UART5_TX GPIO_UART5_TX_3 /* PC12 */ // GPIO_UART5_RTS No remap /* PC8 */ -#define GPIO_UART5_CTS (GPIO_ALT|GPIO_AF8|GPIO_PORTC|GPIO_PIN9|GPIO_PULLDOWN) /* PC9 */ +//#define GPIO_UART5_CTS (GPIO_ALT|GPIO_AF8|GPIO_PORTC|GPIO_PIN9|GPIO_PULLDOWN) /* PC9 */ #define GPIO_USART6_RX GPIO_USART6_RX_1 /* PC7 */ #define GPIO_USART6_TX GPIO_USART6_TX_1 /* PC6 */ diff --git a/boards/ark/fpv/nuttx-config/include/board_dma_map.h b/boards/ark/fpv/nuttx-config/include/board_dma_map.h index 62e278597243..38d2df588817 100644 --- a/boards/ark/fpv/nuttx-config/include/board_dma_map.h +++ b/boards/ark/fpv/nuttx-config/include/board_dma_map.h @@ -36,23 +36,23 @@ // DMAMUX1 Using at most 8 Channels on DMA1 -------- Assigned // V -#define DMAMAP_SPI1_RX DMAMAP_DMA12_SPI1RX_0 /* 1 DMA1:37 ICM-20649 */ -#define DMAMAP_SPI1_TX DMAMAP_DMA12_SPI1TX_0 /* 2 DMA1:38 ICM-20649 */ +#define DMAMAP_SPI1_RX DMAMAP_DMA12_SPI1RX_0 /* 1 DMA1:37 IIM-42653 */ +#define DMAMAP_SPI1_TX DMAMAP_DMA12_SPI1TX_0 /* 2 DMA1:38 IIM-42653 */ -#define DMAMAP_SPI2_RX DMAMAP_DMA12_SPI2RX_0 /* 3 DMA1:39 ICM-42688-P */ -#define DMAMAP_SPI2_TX DMAMAP_DMA12_SPI2TX_0 /* 4 DMA1:40 ICM-42688-P */ +//#define DMAMAP_SPI2_RX DMAMAP_DMA12_SPI2RX_0 /* 3 DMA1:39 ICM-42688-P */ +//#define DMAMAP_SPI2_TX DMAMAP_DMA12_SPI2TX_0 /* 4 DMA1:40 ICM-42688-P */ -//#define DMAMAP_USART1_RX DMAMAP_DMA12_USART1RX_0 /* DMA1:41 GPS1 */ -//#define DMAMAP_USART1_TX DMAMAP_DMA12_USART1TX_0 /* DMA1:42 GPS1 */ +#define DMAMAP_USART1_RX DMAMAP_DMA12_USART1RX_0 /* DMA1:41 GPS1 */ +#define DMAMAP_USART1_TX DMAMAP_DMA12_USART1TX_0 /* DMA1:42 GPS1 */ -//#define DMAMAP_USART3_RX DMAMAP_DMA12_USART3RX_0 /* DMA1:45 DEBUG */ -//#define DMAMAP_USART3_TX DMAMAP_DMA12_USART3TX_0 /* DMA1:46 DEBUG */ +#define DMAMAP_USART3_RX DMAMAP_DMA12_USART3RX_0 /* DMA1:45 DEBUG */ +#define DMAMAP_USART3_TX DMAMAP_DMA12_USART3TX_0 /* DMA1:46 DEBUG */ -//#define DMAMAP_UART4_RX DMAMAP_DMA12_UART4RX_0 /* DMA1:63 EXT2 */ -//#define DMAMAP_UART4_TX DMAMAP_DMA12_UART4TX_0 /* DMA1:64 EXT2 */ +#define DMAMAP_UART4_RX DMAMAP_DMA12_UART4RX_0 /* DMA1:63 UART4 */ +#define DMAMAP_UART4_TX DMAMAP_DMA12_UART4TX_0 /* DMA1:64 UART4 */ -#define DMAMAP_USART6_RX DMAMAP_DMA12_USART6RX_0 /* 5 DMA1:71 PX4IO */ -#define DMAMAP_USART6_TX DMAMAP_DMA12_USART6TX_0 /* 6 DMA1:72 PX4IO */ +#define DMAMAP_USART6_RX DMAMAP_DMA12_USART6RX_0 /* 5 DMA1:71 RC */ +#define DMAMAP_USART6_TX DMAMAP_DMA12_USART6TX_0 /* 6 DMA1:72 RC */ // Assigned in timer_config.cpp @@ -62,17 +62,20 @@ // DMAMUX2 Using at most 8 Channels on DMA2 -------- Assigned // V -#define DMAMAP_SPI3_RX DMAMAP_DMA12_SPI3RX_1 /* 1 DMA2:61 BMI088 */ -#define DMAMAP_SPI3_TX DMAMAP_DMA12_SPI3TX_1 /* 2 DMA2:62 BMI088 */ +#define DMAMAP_USART2_RX DMAMAP_DMA12_USART2RX_1 /* 3 DMA2:43 TELEM3 */ +#define DMAMAP_USART2_TX DMAMAP_DMA12_USART2TX_1 /* 4 DMA2:44 TELEM3 */ -#define DMAMAP_USART3_RX DMAMAP_DMA12_USART3RX_1 /* 3 DMA2:45 DEBUG */ -#define DMAMAP_USART3_TX DMAMAP_DMA12_USART3TX_1 /* 4 DMA2:46 DEBUG */ +//#define DMAMAP_USART3_RX DMAMAP_DMA12_USART3RX_1 /* 3 DMA2:45 DEBUG */ +//#define DMAMAP_USART3_TX DMAMAP_DMA12_USART3TX_1 /* 4 DMA2:46 DEBUG */ + +//#define DMAMAP_SPI3_RX DMAMAP_DMA12_SPI3RX_1 /* 1 DMA2:61 BMI088 */ +//#define DMAMAP_SPI3_TX DMAMAP_DMA12_SPI3TX_1 /* 2 DMA2:62 BMI088 */ #define DMAMAP_UART5_RX DMAMAP_DMA12_UART5RX_1 /* 5 DMA2:65 TELEM2 */ -#define DMAMAP_UART5_TX DMAMAP_DMA12_UART5TX_1 /* 6 DMA2:66 TELEM2 */ +#define DMAMAP_UART5_TX DMAMAP_DMA12_UART5TX_1 /* 6 DMA2:66 TELEM2 */ -#define DMAMAP_UART7_RX DMAMAP_DMA12_UART7RX_1 /* 7 DMA1:79 TELEM1 */ -#define DMAMAP_UART7_TX DMAMAP_DMA12_UART7TX_1 /* 8 DMA1:80 TELEM1 */ +#define DMAMAP_UART7_RX DMAMAP_DMA12_UART7RX_1 /* 7 DMA1:79 TELEM1 */ +#define DMAMAP_UART7_TX DMAMAP_DMA12_UART7TX_1 /* 8 DMA1:80 TELEM1 */ // DMAMUX2 Using at most 8 Channels on BDMA -------- Assigned // V diff --git a/boards/ark/fpv/nuttx-config/nsh/defconfig b/boards/ark/fpv/nuttx-config/nsh/defconfig index 82633920ecd2..c808011aa34b 100644 --- a/boards/ark/fpv/nuttx-config/nsh/defconfig +++ b/boards/ark/fpv/nuttx-config/nsh/defconfig @@ -213,14 +213,18 @@ CONFIG_STM32H7_SPI1_DMA_BUFFER=1024 CONFIG_STM32H7_SPI6=y CONFIG_STM32H7_SPI6_DMA=y CONFIG_STM32H7_SPI6_DMA_BUFFER=1024 -CONFIG_STM32H7_TIM12=y CONFIG_STM32H7_TIM1=y +CONFIG_STM32H7_TIM2=y +CONFIG_STM32H7_TIM3=y CONFIG_STM32H7_TIM4=y CONFIG_STM32H7_TIM5=y +CONFIG_STM32H7_TIM8=y +CONFIG_STM32H7_TIM12=y CONFIG_STM32H7_UART4=y CONFIG_STM32H7_UART5=y CONFIG_STM32H7_UART7=y CONFIG_STM32H7_USART1=y +CONFIG_STM32H7_USART2=y CONFIG_STM32H7_USART3=y CONFIG_STM32H7_USART6=y CONFIG_STM32H7_USART_BREAKS=y @@ -231,12 +235,13 @@ CONFIG_SYSTEM_CDCACM=y CONFIG_SYSTEM_NSH=y CONFIG_TASK_NAME_SIZE=24 CONFIG_UART4_BAUD=57600 +CONFIG_UART4_RXDMA=y +CONFIG_UART4_TXDMA=y CONFIG_UART4_RXBUFSIZE=600 CONFIG_UART4_TXBUFSIZE=1500 -CONFIG_UART5_IFLOWCONTROL=y -CONFIG_UART5_OFLOWCONTROL=y CONFIG_UART5_RXDMA=y -CONFIG_UART5_TXBUFSIZE=10000 +CONFIG_UART5_RXBUFSIZE=600 +CONFIG_UART5_TXBUFSIZE=3000 CONFIG_UART5_TXDMA=y CONFIG_UART7_BAUD=57600 CONFIG_UART7_IFLOWCONTROL=y @@ -246,15 +251,24 @@ CONFIG_UART7_RXDMA=y CONFIG_UART7_TXBUFSIZE=3000 CONFIG_UART7_TXDMA=y CONFIG_USART1_BAUD=57600 +CONFIG_USART1_RXDMA=y +CONFIG_USART1_TXDMA=y CONFIG_USART1_RXBUFSIZE=600 CONFIG_USART1_TXBUFSIZE=1500 +CONFIG_USART2_BAUD=57600 +CONFIG_USART2_RXDMA=y +CONFIG_USART2_TXDMA=y +CONFIG_USART2_RXBUFSIZE=600 +CONFIG_USART2_TXBUFSIZE=1500 CONFIG_USART3_BAUD=57600 CONFIG_USART3_RXBUFSIZE=180 -CONFIG_USART3_RXDMA=y CONFIG_USART3_SERIAL_CONSOLE=y CONFIG_USART3_TXBUFSIZE=1500 -CONFIG_USART3_TXDMA=y CONFIG_USART6_BAUD=57600 +CONFIG_USART6_RXDMA=y +CONFIG_USART6_RXBUFSIZE=600 +CONFIG_USART6_TXDMA=y +CONFIG_USART6_TXBUFSIZE=1500 CONFIG_USART6_RXBUFSIZE=600 CONFIG_USART6_TXBUFSIZE=1500 CONFIG_USBDEV=y