Watchpoint on STM32 GPIO register

873 Views Asked by At

using Keil µVision on a STM32F4 I am trying to add a watchpoint to a GPIO data register, which just does not trigger. I want the watchpoint to be triggered as soon as output data gets writting into this register. Setting the watchpoint to the os timer work fine. Peripheral registers are memory mapped in STM32 F4, as far as I know.

Any (simple) explanation that I am missing here? Any hint is very much appreciated.

3

There are 3 best solutions below

1
Richard at ImageCraft On BEST ANSWER

While the ARM core can access the peripheral I/O registers in the same flat 32-bit address space as SRAM or flash, peripheral I/O registers are located in separate buses on the MCU, and not accessed by the same bus as the SRAM. For example, on the STM32F, there are the ABH bus which are usually further divided into the APB1 and APB2 buses, depending on the device. In any case, the debug controller unit defined by ARM ("CoreSight"), provides data watchpoint capability, and it only works on "real" data access.

Would be great if it did though ;-)

0
domen On

No source, or personal experience, but I can think of a few reasons why this wouldn't work.

Often value isn't "there" like in RAM, but is created when you access a peripheral register.

You could say periodic access could then solve this, but that wouldn't work for registers where reading has side effects (usually clearing some status flag).

I think you'll have to create an interrupt handler for GPIO, and a breakpoint for that.

3
0___________ On

there is a workaround if 12 cycles latency is a problem. Use Pin as a trigger which triggers memory to memory DMA transfer. Set the watchpoint on the destination (or source) RAM address.