2026-02-08 6:16 AM
Hello. I have a custom board with original f103c8t6 (sampled from eStore). PWM for pin PB4 is not functional, but bit banging with gpio write works. If tim3 respective channel is configured as pwm output, the output is stuck at VCC.
I configured the board correctly in CubeMX, as every other pin works correctly (including pin PB5, same timer, different channel) and double checked it again and again.
Unfortunately I can't attach a project that reproduces the bug at the moment as I moved forward by changing the operating mode of the board (it commands a MC33926PNB H bridge and instead of having the H bridges enabled and sending PWM over IN1 and IN2, i set them as high or low depending on the direction and pwm the enable input, which functions well), but in a few days I can reproduce it.
I am curios about what can cause the strange behaviour. It's not a conflict between JTAG reset as I have SWD enabled and even disabled it for a test which led to the same results.
Here are the schematic files and the current project that makes use of the GPIO, along with some code that reads data from an I2C magnetic encoder and PID loop for motor control with USB commands.
2026-02-08 6:44 AM
Create a stripped down project that only toggles PB4. Does this work?
How are you confirming that it isn't working? Reading IDR/ODR bits would be the most direct.
Show a large in focus picture of the board. Might help.