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

IAR still doesn't work with monitor mode debuger on nRF52

I followed this blog entry ( devzone.nordicsemi.com/.../) setup IAR to debug in monitor mode (by adding Jlink_monitor.c, jlink_monitor.h, jlink_monitor_isa_iar.s, add EnableMonMode.mac etc..) . It has improved (I can hit breakpoint after ble_stack_init and step over) without restarting.... But when I hit breakpoint on power_manage(); and step over, then system restarting again.

I used C:\allsrc\nRF5_SDK_12.0.0_12f24da\examples\ble_peripheral\ble_app_hrs example code. and selected IAR workspace: ble_app_hrs_pca10040_s132 - nrf52832_xxaa

  • The blogpost is using an earlier SoftDevice version. S132 v3, which is used in SDK 12, has APP_CODE_BASE at 0x1F000, see here. Therefore you need to change the macro file EnableMonMode.mac with this address:

    __jlinkExecCommand("SetMonModeVTableAddr=0x1F000");
    

    Here is the file already modified: EnableMonMode.mac

    If you follow all the instructions in the blog with this file instead it should work (I just tested it).

    BTW: The reason it worked with breakpoint right after ble_stack_init for you is probably because you have not started any time critical tasks yet (advertising or connection). You were probably still in halt mode debugging.

Related