I am having trouble with the PWM. While it works, the resolution is very coarse. With 64kHz, the duty cycle (measured with a scope) stays the same for set values 0.51 … 0.56 (it seems to take 6.4% steps). with 32 kHz this is 3.2%. Indicating there is a fixed 1µs hiding somewhere.
I did try fast_PWM, however this killed the CAN bus.
Sorry I missed that. The standard mbed pwmout is very limiting and I ran into the same problem using the stm32f303 a couple years ago. I’ve never used the CAN bus. I did have some problems with I2C and fastPWM. Later I changed the PWM pin and it mysteriously worked. Perhaps they were on the same timer before switching pins?
The main timer in mbed is set to 1uS. Someone can probably answer better than me, but when you start messing with prescalers there can be unintended consequences. I think the 1uS timer settings has something to do with free-RTOS compatibility.