timer - STM32 NUCLEO64: PWM has no output - Stack Overflow
stm32 - stm32f103c8t6 : Problem in PWM generation on timer output channel - Electrical Engineering Stack Exchange
TIMER->PWM GENERATION NO OUTPUT->DMA->GPIO
STM32 bare metal non-halting PWM generation?
Videos
I have an STM32F407 board.
I have a main function which measures tilt values using a gyroscope. This value is processed in a PID controller, which results in a float output value.
I would like to use this output to change the frequency of a square wave on one of my output pins without halting the main process. So the signal is continuously generated in the background, the main loop just sets it's speed in every cycle.
I am not using CubeMX and HAL, so I would like to implement this using registers too.
Can someone point me in the right direction?
From the user manual of the board : https://www.st.com/resource/en/user_manual/dm00231744-stm32-nucleo-32-boards-mb1180-stmicroelectronics.pdf
PA6 is connected to PB6 through the jumper SB16 (which is its default state):
*Arduino pin A5 being Stm32 pin PA5
Maybe you have PB6 high, pulled up or in Hi-Z state and that's causing the signal to float @ 2.4V.
If that's the case, you need to remove the 0R resistor on the board :

Calling the PWM stop command releases the control of the PWM to the GPIO controller, and if that is not set, it reverts to reset state - nothing is driving it.
What you seem to want is that your PWM duty is zero, so... Just write that.
htim3.Instance->CCR1 = 0;
Then you can put it back using
htim3.Instance->CCR1 = 327.
There are also HAL macros to set this for you, but I prefer the register access method. Avoids ST deciding to not do things for you.
EDIT, following comment below: You can start and stop the timer counter by setting the CEN bit in control register 1. This will stop it counting. Or you can change it to forced output mode. Something like: htim3.Instance->CR1 &= !0x1; //to clear the CEN bit htim3.Instance->CR1|=0x1; //To set CEN
You can do likewise with the interrupt enable bits if you want to disable interrupts, but they will not trigger with CEN disabled...
But if you are creating a phase delay between timers, beware that you might have to resynchronise them.