cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to monitor the program counter (PC) at runtime through GPIOs (STM32F429 MCU)?

GRoas
Associate

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.

3 REPLIES 3
Clive1 (HNL)
Senior II

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.

S.Ma
Principal

Impractical unless you run your code on external parallel memory using FMC and you use a logic analyser to monitor the adress bus values.

Jeroen3
Senior

You can extract the PC via the debug interface.