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

Enabling Monitor Mode Debugging in IAR for nRF52 when using SDK 17.0.2 and S132 soft device

I have run into the issue where the soft device is not being processed when I debug so it throws the assertion failed error. After a lot of searching on the forum I came across the Monitor Mode Debugging blog post which is out of date and now redirects to the Github repo. But Github doesnt reference IAR any more, and the last comments I found on the forum are 2 years old.

Would it be possible to either update the Github repo with IAR support or provide step by step details so I (and others) can get monitor mode debuggin up an running?

Thanks in advance

Mat

  • Hello Mat,

    Remember that Monitor Mode Debugging is a product from Segger, and not Nordic, so we don't provide the IAR project. 

    What we do have is a guide on how to perform MMD:

    https://github.com/NordicPlayground/j-link-monitoring-mode-debugging/#monitor-mode-debugging-in-keil-%C2%B5vision5-and-segger-embedded-studio

    Does the assert only occur when you enable Monitor Mode Debugging, or is it possible that the assert is coming from the application that you are trying to debug?

    Although Monitor Mode Debugging is an option, and it is working, I have never tried it. Are you trying this only because being able to step in the code is a Nice To Have feature? Did you run into any issues that caused you to want to try this?

    In case you need MMD, have you tried to follow the guide in the link above? We don't have any IAR specific, but you can try with SES (which is free of charge).

    BR,

    Edvin

  • I think you might have missed my point. Your SDK provides examples in SES, IAR and Keil, yet that Github project only gives me an example for SES and Keil. Just pointing out whats missing.

    We use IAR here and our previous nRF52 projects have been simple - basically porting from nRF51 to nRF52. So the application layer is basically the same. I am now porting over code from a legacy Silabs MCU+nRF8001 project over to the nRF52 so can you can imagine there is a LOT of debugging to go on. Stepping through the code with the radio is an absolute necessity. If I send my device a BLE command then I need to be able to break and step though what that command does.

    I did try and follow the steps in the Github project. Had it building and linking, but just not running - gave me the exception and I didnt get the JLink popup. This is why I am asking for a simple example project for IAR. For someone who has never used MMD before, it would help me (and everyone else searching the forums) as lot.

  • It might well be a Segger product (which I didnt know) but I (and everyone else) need to use it on IAR silicon.

  • Hello,

    I got this folder from a colleague:

    200506_MonitorMode.zip

    He said that it probably is a bit random whether the IAR version works or not, because IAR is quite version sensitive. 

    If it doesn't work, then you need to contact Segger to get the correct one (as they are the ones who implemented Monitor Mode Debugging (also for IAR)).

    The approach should be the same as with Segger and Keil from the github repository/guide that I linked in the previous reply.

    Best regards,

    Edvin

  • As a reference for everyone, I got in touch with Segger, and the only differences between what they provided and what Edvin attached above are a number change in the .S files.

    Cant link the new ZIP as Segger requested I didnt.

    The only change is below. This is the same change in all 3 .S files

    -#define _NUM_BYTES_EXTENDED_STACKFRAME  72

    +#define _NUM_BYTES_EXTENDED_STACKFRAME  104        // Values for stackframes are explained at location where they are used

Related