Repository navigation
variant(wb55): fix STeaMi P19/P20, expander pad defines and tone timer - #3131
Merged
Merged
Conversation
The STM32WB55 has no TIM6/TIM7, so tone() used TIM16. If I read PeripheralPins.c correctly, TIM16 is the only timer of PA6 (P10 on the edge connector), so tone() and analogWrite(P10) shared the same timer. TIM17 has no default PWM pin on the edge connector. The board has a buzzer and tone() is the more common call, so give it TIM17 and let Servo use TIM16. Servo now shares TIM16 with analogWrite(P10). Both defines are still guarded by #ifndef, so the previous choice can be restored with build flags. Signed-off-by: Sébastien Nedjar <sebastien.nedjar@univ-amu.fr>
On the board schematic, PC0 is I2C3_SCL_EDGE and goes to the P19 edge contact, and PC1 is I2C3_SDA_EDGE and goes to P20, as on the micro:bit edge connector (P19 = SCL, P20 = SDA). The variant .cpp already says "PC_0, // P19/D17" and "PC_1, // P20/D18", and I2C_EXT_SCL/I2C_EXT_SDA are right, but the P19 and P20 aliases were swapped. Signed-off-by: Sébastien Nedjar <sebastien.nedjar@univ-amu.fr>
P24, P25, P28 and P29 expanded to GPIO1..GPIO4, which are not defined anywhere, so a sketch using them did not compile. These pads are on the MCP23009E I2C expander, not on the MCU, so they cannot have an Arduino pin number. Remove the four defines and keep the expander mapping as a comment, with the datasheet pin names GP0..GP7 instead of the schematic net names GPIO1..GPIO8. Signed-off-by: Sébastien Nedjar <sebastien.nedjar@univ-amu.fr>
1 of 15 tasks
fpistm
approved these changes
Dec 2, 2026
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.
Follow-up to #2526 and #3126 (STeaMi board,
STEAM32_WB55RG).Summary
Three small changes to
variant_STEAM32_WB55RG.h, one commit each, if I read the board files correctly:Bug:
P19andP20are swapped. On the board schematic, PC0 isI2C3_SCL_EDGEand goes to the P19 edge contact, PC1 isI2C3_SDA_EDGEand goes to P20, as on the micro:bit edge connector (P19 = SCL, P20 = SDA). The.cppof the variant already saysPC_0, // P19/D17andPC_1, // P20/D18, andI2C_EXT_SCL/I2C_EXT_SDA(soWire) are right; only theP19/P20aliases were swapped.Small change:
TIMER_TONEandTIMER_SERVOare swapped (TIM17 for tone, TIM16 for Servo). The STM32WB55 has no TIM6/TIM7. TIM16 is the only timer of PA6 (edge contact P10), so todaytone()andanalogWrite(P10)share a timer, while TIM17 has no default PWM pin on the edge connector. The board has a buzzer, and most sketches usetone(), so I thought it better to givetone()the timer without edge pins. Servo then shares TIM16 withanalogWrite(P10), which I think is a rarer case.Small change: Remove
P24,P25,P28andP29expand toGPIO1..GPIO4which are not defined anywhere.Motivation
The P19/P20 and pad disagree with the board and its documentation. For the timers, an LED on P10 driven with
analogWrite()is disturbed as soon as the sketch plays a sound.Validation
Built with PlatformIO (STM32duino core 3.1.0 package, with this variant folder):
Servoon P0,analogWrite(P10, 128)andtone(SPEAKER, 440), plus a check thatTIMER_TONE == TIM17andTIMER_SERVO == TIM16;P19/P20as GPIO and withWire.setSCL(P19)/Wire.setSDA(P20), which checksP19 == PC0,P20 == PC1and thatP24..P29are no longer defined;