Skip to content

fix(pl18): telemetry RX DMA can be enabled for non-DAC audio radios#7417

Open
richardclli wants to merge 4 commits into
mainfrom
richardclli/fix-el18-pl18u-telerxdma
Open

fix(pl18): telemetry RX DMA can be enabled for non-DAC audio radios#7417
richardclli wants to merge 4 commits into
mainfrom
richardclli/fix-el18-pl18u-telerxdma

Conversation

@richardclli

@richardclli richardclli commented Jun 1, 2026

Copy link
Copy Markdown
Member

Summary of changes:

Enable RX DMA for S.Port if non-DAC audio is used

Summary by CodeRabbit

  • Bug Fixes
    • Restored reliable telemetry reception on compatible VS1053B-based radio hardware by ensuring the correct RX DMA settings are enabled.
    • Fixed the VS1053B-related audio build selection so supported devices compile and run with the intended audio configuration.

@richardclli richardclli added this to the 2.11.7 milestone Jun 1, 2026
@richardclli richardclli self-assigned this Jun 1, 2026
@coderabbitai

coderabbitai Bot commented Jun 1, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Hardware-specific VS1053B audio configuration and telemetry DMA macros are now conditionally compiled using the USE_VS1053B feature flag instead of hardware family detection. The build configuration explicitly defines this macro when enabled.

Changes

VS1053B Feature Flag Configuration

Layer / File(s) Summary
VS1053B feature flag configuration and usage
radio/src/targets/pl18/CMakeLists.txt, radio/src/targets/pl18/hal.h
CMakeLists.txt adds -DUSE_VS1053B preprocessor definition. Telemetry DMA stream and channel macros are enabled within the #if defined(USE_VS1053B) guard. Audio configuration block guard changes from `RADIO_NV14_FAMILY

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

backport/2.12

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description provides a summary of changes but lacks required detail and omits the referenced issue number from the template. Add the issue number (Fixes #) and expand the summary to explain why RX DMA can now be enabled (DMA conflict only occurs with DAC audio).
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title accurately describes the main change: enabling telemetry RX DMA for non-DAC audio radios by refactoring conditional logic from radio model checks to audio driver type checks.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch richardclli/fix-el18-pl18u-telerxdma

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pfeerick pfeerick added the backport/2.11 To be backported to a 2.11 release also. label Jun 3, 2026
Comment thread radio/src/targets/pl18/hal.h Outdated
@raphaelcoeffic

Copy link
Copy Markdown
Member

@richardclli what about something like that:

diff --git a/radio/src/targets/pl18/CMakeLists.txt b/radio/src/targets/pl18/CMakeLists.txt
index f33a4ce130..83ee579f47 100644
--- a/radio/src/targets/pl18/CMakeLists.txt
+++ b/radio/src/targets/pl18/CMakeLists.txt
@@ -235,6 +235,7 @@ endif()
 
 if(USE_VS1053B)
   target_sources(board PRIVATE targets/common/arm/stm32/vs1053b.cpp)
+  add_definitions(-DUSE_VS1053B)
 else()
   target_sources(board PRIVATE targets/common/arm/stm32/audio_dac_driver.cpp)
   add_definitions(-DSOFTWARE_VOLUME)
diff --git a/radio/src/targets/pl18/hal.h b/radio/src/targets/pl18/hal.h
index 8e5961845a..3b453937e6 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

@richardclli

Copy link
Copy Markdown
Member Author

Commit your changes to my branch, it is in origin repository

@richardclli

Copy link
Copy Markdown
Member Author

I already amend the requested changes.

@pfeerick pfeerick changed the title fix(nv14/el18/pl18u): Telemetry RX DMA can be enabled for non-DAC audio radios fix(pl18): telemetry RX DMA can be enabled for non-DAC audio radios Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/2.11 To be backported to a 2.11 release also.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants