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

  • And as a follow on, I appear to have working Monitor Mode Debugging in IAR v8.50.9

    So for everyone else viewing this, this is how I got it working.

    Made a MonitorModeDebugging directory and copied in the files from 200506_MonitorMode.zip linked above. Made the change(s) to the .S file(s) above - I only needed the  JLINK_MONITOR_ISR_IAR.s file obviously.

    Added this directory to the Project Options -> C/C++ Compiler -> Preprocessor -> Additional Include Directories

    Added JLINK_MONITOR_ISR_IAR.s and JLINK_MONITOR.c to my IAR project

    Copied over the EnableMonMode.mac file listed in the original blog post (https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/monitor-mode-debugging---revolutionize-the-way-you-debug-ble-applications) from the 4382.EnableMonMode.zip folder. I have pasted this below just in case that link goes away in future

    /*********************************************************************
    * *
    execUserSetup()
    * *
    Function description
    * Called once after the target application is downloaded.
    * Implement this macro to set up the memory map, breakpoints,
    * interrupts, register macro files, etc.
    */
    execUserSetup() {
    __message "Macro-execUserSetup(): Enabling monitor mode";
    __jlinkExecCommand("SetMonModeDebug=1");
    __jlinkExecCommand("SetMonModeVTableAddr=0x26000");
    }

    In Project Options -> Debugger -Setup -> Setup Macros I have selected this .MAC file and ticked the User Macro(s) file checkbox.

    Added the below to the start of main.c

    NVIC_SetPriority(DebugMonitor_IRQn, 7ul);

    Build the code and run. The original blog post and the Github project both talk about seeing a popup with the title of "Monitor Mode missing license". I have NOT seen this however. I am using the uBlox BMD-350 Eval Board so maybe that matters...who knows.

    I am now able to put a breakpoint in Bluetooth write handlers and debug. The radio stays connected to my Android device and at the end of the debugging I can "run" without hitting the app_error_fault_handler

  • That is great news! Thank you for sharing! As you say, this may be useful for other IAR users.

    Best regards,

    Edvin

Related