This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

keil breakpoint for register change

Can I set breakpoint for register change in keil(for e.g GPIO)?

  • Hello stas

    You can do this while in debug mode. You can find the hardware peripheral register address in the product specification under the registers subsection. For the nRF52832 the GPIO address is 0x50000000. Further down you will find the offsetfor the different specific registers. the OUT register for instance has an offset of 0x504, so it's actual address is 0x50000504.

    In Keil, while in debug, you can press view->memory window->memory1. Type in the desired address. This will show you the contents of the registers in hexadecimal values. Right click on the desired register location you want to have a breakpoint for and press the "Set breakpoint at..." option. This brings up the breakpoint window where you can define what address you want the breakpoint for, how many bytes you want to monitor, and if you want it to trigger for read or write accesses.

    Best regards

    Jørn Frøysa

Related