From 373573aa39596a4b0825cbd8158d07bfc4cf8aa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Nedjar?= Date: Wed, 2 Dec 2026 12:06:15 +0100 Subject: [PATCH 1/3] variant(wb55): swap STeaMi tone and Servo timers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- variants/STM32WBxx/WB55R(C-E-G)V/variant_STEAM32_WB55RG.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/variants/STM32WBxx/WB55R(C-E-G)V/variant_STEAM32_WB55RG.h b/variants/STM32WBxx/WB55R(C-E-G)V/variant_STEAM32_WB55RG.h index 71980c46af..37e6260aaf 100644 --- a/variants/STM32WBxx/WB55R(C-E-G)V/variant_STEAM32_WB55RG.h +++ b/variants/STM32WBxx/WB55R(C-E-G)V/variant_STEAM32_WB55RG.h @@ -179,12 +179,14 @@ #define PIN_WIRE_SCL I2C_EXT_SCL // Timer Definitions -// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin +// No TIM6/TIM7 on STM32WB55. TIM17 has no default PWM pin on the edge +// connector, so tone() (used with the on-board buzzer) does not disturb +// analogWrite(). Servo takes TIM16, shared with analogWrite() on P10 (PA6). #ifndef TIMER_TONE - #define TIMER_TONE TIM16 + #define TIMER_TONE TIM17 #endif #ifndef TIMER_SERVO - #define TIMER_SERVO TIM17 + #define TIMER_SERVO TIM16 #endif // UART Definitions From fe26d9b3f43d8891a710386b56cb29aa73bb7d1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Nedjar?= Date: Wed, 2 Dec 2026 12:06:47 +0100 Subject: [PATCH 2/3] variant(wb55): fix swapped STeaMi P19 and P20 pins MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- variants/STM32WBxx/WB55R(C-E-G)V/variant_STEAM32_WB55RG.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/variants/STM32WBxx/WB55R(C-E-G)V/variant_STEAM32_WB55RG.h b/variants/STM32WBxx/WB55R(C-E-G)V/variant_STEAM32_WB55RG.h index 37e6260aaf..31b0427044 100644 --- a/variants/STM32WBxx/WB55R(C-E-G)V/variant_STEAM32_WB55RG.h +++ b/variants/STM32WBxx/WB55R(C-E-G)V/variant_STEAM32_WB55RG.h @@ -115,8 +115,8 @@ #define P14 PB14 #define P15 PB15 #define P16 PE4 -#define P19 PC1 -#define P20 PC0 +#define P19 PC0 +#define P20 PC1 #define P24 GPIO3 #define P25 GPIO4 #define P28 GPIO1 From df37c6e4e01865244fd8ae5f1695233e29519fcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Nedjar?= Date: Wed, 2 Dec 2026 12:07:01 +0100 Subject: [PATCH 3/3] variant(wb55): remove STeaMi expander pad defines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../WB55R(C-E-G)V/variant_STEAM32_WB55RG.h | 26 ++++--------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/variants/STM32WBxx/WB55R(C-E-G)V/variant_STEAM32_WB55RG.h b/variants/STM32WBxx/WB55R(C-E-G)V/variant_STEAM32_WB55RG.h index 31b0427044..9a6531b280 100644 --- a/variants/STM32WBxx/WB55R(C-E-G)V/variant_STEAM32_WB55RG.h +++ b/variants/STM32WBxx/WB55R(C-E-G)V/variant_STEAM32_WB55RG.h @@ -67,19 +67,10 @@ #define NUM_DIGITAL_PINS 44 #define NUM_ANALOG_INPUTS 6 -// GPIO expander -// Not used by Arduino only here for documentation purpose -// Upper pad -// GPIO1 --> P28 -// GPIO2 --> P29 -// GPIO3 --> P24 -// GPIO4 --> P25 - -// 4 directions switches -// GPIO5 -// GPIO6 -// GPIO7 -// GPIO8 +// MCP23009E GPIO expander (I2C_INT bus, address 0x20), documentation only: +// these are expander pins, not MCU pins, so they have no Arduino pin number. +// Upper pads: GP0 --> P28, GP1 --> P29, GP2 --> P24, GP3 --> P25 +// Direction buttons: GP4 --> RIGHT, GP5 --> DOWN, GP6 --> LEFT, GP7 --> UP // STeaMi's PinName #define ACTIVATE_3V3_STLINK PB2 @@ -117,10 +108,6 @@ #define P16 PE4 #define P19 PC0 #define P20 PC1 -#define P24 GPIO3 -#define P25 GPIO4 -#define P28 GPIO1 -#define P29 GPIO2 #define RST_DISPLAY PA12 #define RST_EXPANDER PB1 @@ -159,10 +146,7 @@ #define B_BUTTON PA8 #define MENU_BUTTON PA0 -// DOWN_BUTTON --> GPIO6 -// LEFT_BUTTON --> GPIO7 -// RIGHT_BUTTON --> GPIO5 -// UP_BUTTON --> GPIO8 +// UP, DOWN, LEFT and RIGHT buttons are on the MCP23009E expander (see above) #ifndef USER_BTN #define USER_BTN MENU_BUTTON