I have been using SWO with STM32 chips for debugging for a number of years. I have managed to side-step this issue until now. I would like to be able to use SWO for debugging while varying the SysClock frequency.
This is an issue because OpenOCD requires that I specify the SysClock when setting up SWO:
tpiu config internal swv uart off 48000000
This works fine at a fixed HCLK frequency of 48MHz. But as soon as I change HCLK, either up or down, the data coming from the port is garbled.
In hardware, I am taking SWO straight from the CPU into an ST/Link SWD interface. The documentation for openocd does not mention how to deal with a varying HCLK (or, if it does, I have not found it). I have found hints online that using Manchester encoding might work.
I have tried using both UART and Manchester modes. Both work at fixed frequencies and neither appear to work when changing the clock speed.
Is it possible to configure openocd for SWO with a varying HCLK? If so, how does one do it?