2019-04-15 08:28 AM
Hi, I'm using STM32F429 microcontroller and I would like to program a subset of GPIOs for automatically shadowing the value of the program counter (PC) at every clock cycle WITHOUT interrupting the CPU activity, maybe exploiting the bus matrix connections, the debug circuitry of the Cortex-M4 or something like that. Is there a way to do that? Thanks in advance.
2019-04-15 08:38 AM
No, you can't shadow it. Not something you can use DMA with either. You could perhaps use the SysTick interrupt to periodically output the value it sees on LR upon entry.
Your other alternative is to better instrument your code to report flow and control data, so you can understand what is happening.
Another is to invest $1000-1500 in a TRACE pod and use that to generate execution data in the manner you have described.
2019-04-15 08:53 AM
Impractical unless you run your code on external parallel memory using FMC and you use a logic analyser to monitor the adress bus values.
2019-04-15 10:52 PM
You can extract the PC via the debug interface.