From b47c0d735ae477d637cea1db9cfb42d5e397e581 Mon Sep 17 00:00:00 2001 From: Richard Li Date: Mon, 1 Jun 2026 15:28:58 +0800 Subject: [PATCH 1/4] Telemetry RX DMA can be enabled for non-DAC audio radios --- radio/src/targets/pl18/hal.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/radio/src/targets/pl18/hal.h b/radio/src/targets/pl18/hal.h index 4fd79ef25fe..1bfe538d8a3 100644 --- a/radio/src/targets/pl18/hal.h +++ b/radio/src/targets/pl18/hal.h @@ -212,8 +212,10 @@ #define TELEMETRY_DMA_TX_Stream_IRQ DMA1_Stream6_IRQn #define TELEMETRY_DMA_TX_IRQHandler DMA1_Stream6_IRQHandler #define TELEMETRY_DMA_TX_FLAG_TC DMA_IT_TCIF6 -// #define TELEMETRY_DMA_Stream_RX LL_DMA_STREAM_5 -// #define TELEMETRY_DMA_Channel_RX LL_DMA_CHANNEL_4 +#if defined(RADIO_NV14_FAMILY) || defined(RADIO_PL18U) +#define TELEMETRY_DMA_Stream_RX LL_DMA_STREAM_5 +#define TELEMETRY_DMA_Channel_RX LL_DMA_CHANNEL_4 +#endif #define TELEMETRY_USART_IRQHandler USART2_IRQHandler #define TELEMETRY_DIR_OUTPUT() TELEMETRY_DIR_GPIO->BSRRH = TELEMETRY_DIR_GPIO_PIN From 6269f1da68e423ed827c507d431544b1635dc0fe Mon Sep 17 00:00:00 2001 From: Richard Li Date: Mon, 1 Jun 2026 15:34:43 +0800 Subject: [PATCH 2/4] Added comments --- radio/src/targets/pl18/hal.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/radio/src/targets/pl18/hal.h b/radio/src/targets/pl18/hal.h index 1bfe538d8a3..8e5961845a6 100644 --- a/radio/src/targets/pl18/hal.h +++ b/radio/src/targets/pl18/hal.h @@ -213,6 +213,8 @@ #define TELEMETRY_DMA_TX_IRQHandler DMA1_Stream6_IRQHandler #define TELEMETRY_DMA_TX_FLAG_TC DMA_IT_TCIF6 #if defined(RADIO_NV14_FAMILY) || defined(RADIO_PL18U) +// RX DMA can only be enabled when DAC audio is not used, +// having DMA conflict with DAC audio #define TELEMETRY_DMA_Stream_RX LL_DMA_STREAM_5 #define TELEMETRY_DMA_Channel_RX LL_DMA_CHANNEL_4 #endif From 8fd9377b0099c02160bc3d4d3d79787c0ff1e750 Mon Sep 17 00:00:00 2001 From: Richard Li Date: Mon, 15 Jun 2026 13:28:55 +0800 Subject: [PATCH 3/4] Update with a better #define logic --- radio/src/targets/pl18/hal.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/radio/src/targets/pl18/hal.h b/radio/src/targets/pl18/hal.h index 8e5961845a6..3b453937e6d 100644 --- a/radio/src/targets/pl18/hal.h +++ b/radio/src/targets/pl18/hal.h @@ -212,9 +212,9 @@ #define TELEMETRY_DMA_TX_Stream_IRQ DMA1_Stream6_IRQn #define TELEMETRY_DMA_TX_IRQHandler DMA1_Stream6_IRQHandler #define TELEMETRY_DMA_TX_FLAG_TC DMA_IT_TCIF6 -#if defined(RADIO_NV14_FAMILY) || defined(RADIO_PL18U) +#if defined(USE_VS1053B) // RX DMA can only be enabled when DAC audio is not used, -// having DMA conflict with DAC audio +// as it would conflict with the DAC audio DMA (DMA1 Stream 5) #define TELEMETRY_DMA_Stream_RX LL_DMA_STREAM_5 #define TELEMETRY_DMA_Channel_RX LL_DMA_CHANNEL_4 #endif @@ -330,7 +330,7 @@ #define SDRAM_RCC_AHB3Periph RCC_AHB3Periph_FMC // Audio -#if defined(RADIO_NV14_FAMILY) || defined(RADIO_PL18U) +#if defined(USE_VS1053B) #define AUDIO_XDCS_GPIO GPIO_PIN(GPIOH, 14) // PH.14 #define AUDIO_CS_GPIO GPIO_PIN(GPIOH, 13) // PH.13 #define AUDIO_DREQ_GPIO GPIO_PIN(GPIOH, 15) // PH.15 From fe94fb41d6928c033a8810bb66bfbbb697e668c3 Mon Sep 17 00:00:00 2001 From: richardclli Date: Mon, 15 Jun 2026 21:19:42 +0800 Subject: [PATCH 4/4] Update CMakeLists.txt, fixed build error. --- radio/src/targets/pl18/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/radio/src/targets/pl18/CMakeLists.txt b/radio/src/targets/pl18/CMakeLists.txt index f33a4ce1304..6e31a47f071 100644 --- a/radio/src/targets/pl18/CMakeLists.txt +++ b/radio/src/targets/pl18/CMakeLists.txt @@ -234,6 +234,7 @@ if(PCBREV STREQUAL NB4P) endif() if(USE_VS1053B) + add_definitions(-DUSE_VS1053B) target_sources(board PRIVATE targets/common/arm/stm32/vs1053b.cpp) else() target_sources(board PRIVATE targets/common/arm/stm32/audio_dac_driver.cpp)