Article From:https://www.cnblogs.com/praiseslow/p/9969118.html

mcuThe debugging of PWM and timer

One thing must be clear: Compare signals that change in real time. It’s impossible to pause for viewing. Even if paused, it was found that the value was totally wrong.
That is to say, by pausing to debug, the results are misleading. This is misleading because you don’t know that your hardware is out of order and your code is out of order.
In other words, there is a problem with your debugging method.
So we need a better, more credible and more robust debugging method.
In fact, in the development of application layer, printf is a good way. In the debugging of the bottom layer, printf is used in combination with uart.
In this way, the real-time performance of debugging mode is mostly solved.
In Freescale mpc5XXX series MCU, using freemaster or trace32 can get better debugging effect similar to trace function.
It is said that in the debugging of stm32, st-link V2 with trace function can be used.

Leave a Reply

Your email address will not be published. Required fields are marked *