Add STM32WL Support to SX126x Radio Driver#1619
Open
spike314 wants to merge 5 commits into
Open
Conversation
- Load SUBGHZSPI of STM32WL used - Use STM32 HAL for CS
- Add support for both High and Low Power PA - Add RF control and enable pins - Move pin setting to rx, tx, and standby functions - Adapt PA clamping for switching betweeh HP and LP PA - Add generic encryption for SX16x
- Add configuration examples - Align defines with MyConfig.h
spike314
marked this pull request as ready for review
May 11, 2026 03:33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR changes the MySensors SX126x radio driver to allow use by STM32WL processors.
The STM32 series processors combine an STM32 processor and SX126x radio on the same chip. The MySensors SX126x driver needs to be updated to work with the on-chip radio in the STM32WL processors. The PR addresses 3 main differences between the SX126x radios and the internal radios in the STM32WL processors.
For transmitting, the SX1261 radio has only a low power amplifier and the SX1262 radio has only a high power amplifier. Depending on the processor, STM32WL chips can support either low power, high power, or both amplifiers. The PR adds code to handle Power Amplifier selection based on chip capability and desired power setting.
Since the STM32WL processors combine the processor and radio on chip, they do not expose the normal SPI pins used by Arduino SPI libraries. The PR adds code to use the STM32 HAL SUBGHZSPI functions to handle low level SPI calls when the STM32WL is used.
STM32WL modules require extra pins for control of the RF front end. This PR adds an option to use MY_SX126x_RF_SWITCH_PIN and MY_SX126x_RF_ENABLE_PIN in addition to the MY_SX126x_ANT_SWITCH_PIN already provided in the SX126x driver. In the MySensors examples folder, the PR adds STM32WLConfiguration examples for the WIO-E5, WIO-E5-LE, and STM32WL55-Nucleo modules that show the correct defines needed for the pins in these modules.
Addresses issue #1620
I tested these changes on STM32WLE5 (WIO-E5 and WIO-E5-LE modules)