This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Warning : Stack pointer is setup to incorrect alignment. Stack Addr = 0xFFFFFFFF

Dear sir,

Hope you are doing well.

I am trying to debug my project using the IAR toolchain. I am using nRF 52832. In my project, I have added dfu init service for performing OTA. 

Now I want to debug my project using IAR toolchain. For that, I have commented the DFU portion for debugging. While debugging I am getting the error of "Stack pointer is setup to incorrect path. Stack Addr = 0xFFFFFFFF". I am using Jlink for compilation.

Any help would be appreciated.

Thanks 

Parents
  • Here's a tip for IAR if you haven't come across this before; debugging when (eventually) running the SoftDevice is not easy unless the SoftDevice interrupts are allowed to run during a breakpoint halt. Not sure about DFU without SoftDevice.

    #if defined(SOFTDEVICE_PRESENT)
       // This allows all interrupts higher than _PRIO_SD_LOW (ie 4, BLE SD stuff) to continue execution even during a break
       // note Two J-Link commands are required in command file:
       // SetMonModeDebug = 1
       // SetMonModeVTableAddr = ADDR
       //  where ADDR is the application's vector table located in FLASH, ie the start address for the
       // application, probably either 0x1B000 or 0x1C000 or 0x26000 depending on SoftDevice
       // See https://github.com/NordicPlayground/j-link-monitoring-mode-debugging
       NVIC_SetPriority(DebugMonitor_IRQn, _PRIO_SD_LOW);
    #endif
    

    IAR-Specific:  enabling-monitor-mode-debugging-in-iar-for-nrf52-when-using-sdk-17-0-2-and-s132-soft-device

    Keil and SES:  j-link-monitoring-mode-debugging

    iar-monitor-mode-debugging-not-linking-correctly

    Ensure JLinkMonitor subdirectory is enabled in the project (not greyed out)
    When finished debugging, in the BLE project settings under Options->Common->Debug->Set Addional J-Link Options
    SetMonModeDebug = 0
    Depending on your J-Link and licence there is an irritating message pop-up at the start of very debug session; this is why we usually leave SetMonModeDebug = 0
    Do not use this for non-BLE projects.

Reply
  • Here's a tip for IAR if you haven't come across this before; debugging when (eventually) running the SoftDevice is not easy unless the SoftDevice interrupts are allowed to run during a breakpoint halt. Not sure about DFU without SoftDevice.

    #if defined(SOFTDEVICE_PRESENT)
       // This allows all interrupts higher than _PRIO_SD_LOW (ie 4, BLE SD stuff) to continue execution even during a break
       // note Two J-Link commands are required in command file:
       // SetMonModeDebug = 1
       // SetMonModeVTableAddr = ADDR
       //  where ADDR is the application's vector table located in FLASH, ie the start address for the
       // application, probably either 0x1B000 or 0x1C000 or 0x26000 depending on SoftDevice
       // See https://github.com/NordicPlayground/j-link-monitoring-mode-debugging
       NVIC_SetPriority(DebugMonitor_IRQn, _PRIO_SD_LOW);
    #endif
    

    IAR-Specific:  enabling-monitor-mode-debugging-in-iar-for-nrf52-when-using-sdk-17-0-2-and-s132-soft-device

    Keil and SES:  j-link-monitoring-mode-debugging

    iar-monitor-mode-debugging-not-linking-correctly

    Ensure JLinkMonitor subdirectory is enabled in the project (not greyed out)
    When finished debugging, in the BLE project settings under Options->Common->Debug->Set Addional J-Link Options
    SetMonModeDebug = 0
    Depending on your J-Link and licence there is an irritating message pop-up at the start of very debug session; this is why we usually leave SetMonModeDebug = 0
    Do not use this for non-BLE projects.

Children
No Data
Related