From efc8da9f9a8615780d4faf054b5f462bd7a195fb Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 14 Feb 2019 07:22:44 +1100 Subject: [PATCH] HAL_ChibiOS: enable TX DMA on uarts on H7 --- libraries/AP_HAL_ChibiOS/hwdef/CubeH7/hwdef.dat | 16 ++++++++-------- .../AP_HAL_ChibiOS/hwdef/scripts/dma_resolver.py | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/CubeH7/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/CubeH7/hwdef.dat index a30d2ee8c4..f491a838d0 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/CubeH7/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/CubeH7/hwdef.dat @@ -33,7 +33,7 @@ UART_ORDER OTG1 UART4 USART2 USART3 UART8 UART7 # UART4 serial GPS PA0 UART4_TX UART4 -PA1 UART4_RX UART4 +PA1 UART4_RX UART4 NODMA PA2 BATT_VOLTAGE_SENS ADC1 SCALE(1) PA3 BATT_CURRENT_SENS ADC1 SCALE(1) @@ -106,7 +106,7 @@ PC4 AUX_ADC2 ADC1 SCALE(1) PC5 PRESSURE_SENS ADC1 SCALE(2) # USART6 to IO -PC6 USART6_TX USART6 NODMA +PC6 USART6_TX USART6 PC7 USART6_RX USART6 NODMA # Now setup the pins for the microSD card, if available. @@ -131,14 +131,14 @@ PE4 MPU_EXT_CS CS # Another USART, this one for telem1. This one has RTS and CTS lines. # USART2 serial2 telem1 -PD3 USART2_CTS USART2 NODMA -PD4 USART2_RTS USART2 NODMA -PD5 USART2_TX USART2 NODMA +PD3 USART2_CTS USART2 +PD4 USART2_RTS USART2 +PD5 USART2_TX USART2 PD6 USART2_RX USART2 NODMA # The telem2 USART, also with RTS/CTS available. # USART3 serial3 telem2 -PD8 USART3_TX USART3 NODMA +PD8 USART3_TX USART3 PD9 USART3_RX USART3 NODMA PD11 USART3_CTS USART3 NODMA PD12 USART3_RTS USART3 NODMA @@ -172,7 +172,7 @@ PD15 MPU_DRDY INPUT # the 2nd GPS UART # UART8 serial4 GPS2 PE0 UART8_RX UART8 NODMA -PE1 UART8_TX UART8 NODMA +PE1 UART8_TX UART8 # Now setup SPI bus4. PE2 SPI4_SCK SPI4 @@ -186,7 +186,7 @@ PE3 VDD_3V3_SENSORS_EN OUTPUT HIGH # UART7 maps to uartF in the HAL (serial5 in SERIALn_ parameters). PE7 UART7_RX UART7 NODMA -PE8 UART7_TX UART7 NODMA +PE8 UART7_TX UART7 # Define a LED, mapping it to GPIO(0). LOW will illuminate the LED PE12 FMU_LED_AMBER OUTPUT HIGH OPENDRAIN GPIO(0) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/scripts/dma_resolver.py b/libraries/AP_HAL_ChibiOS/hwdef/scripts/dma_resolver.py index 126bcfe5dc..170c8c1cba 100755 --- a/libraries/AP_HAL_ChibiOS/hwdef/scripts/dma_resolver.py +++ b/libraries/AP_HAL_ChibiOS/hwdef/scripts/dma_resolver.py @@ -182,7 +182,7 @@ def write_dma_header(f, peripheral_list, mcu_type, dma_exclude=[], shared = ' // shared %s' % ','.join(stream_assign[stream]) if curr_dict[key] == "STM32_DMA_STREAM_ID_ANY": f.write("#define %-30s STM32_DMA_STREAM_ID_ANY\n" % (chibios_dma_define_name(key)+'STREAM')) - f.write("#define %-30s 0U\n" % (chibios_dma_define_name(key)+'CHAN')) + f.write("#define %-30s STM32_DMAMUX1_%s\n" % (chibios_dma_define_name(key)+'CHAN', key)) continue else: f.write("#define %-30s STM32_DMA_STREAM_ID(%u, %u)%s\n" %