Skip to main content
GRoas
Visitor II
April 15, 2019
Question

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

  • April 15, 2019
  • 3 replies
  • 992 views

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.

This topic has been closed for replies.

3 replies

Clive1 (HNL)
Explorer
April 15, 2019

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
April 15, 2019

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
April 16, 2019

You can extract the PC via the debug interface.