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

nRF52811 with IAR Embedded Workbench 8.42.1 s140 sd_softdevice_enable hardfault

Hello,

I am trying to port ble_app_hrs_rscs_relay example to nRF52811 with softdevice s140 7.2 and nRF5_SDK_17.1.0. Everything works fine and the app is running and I can debug the app. When i reset the app i get a hardfault in sd_softdevice_enable if i download and debug the app. If i just debug without downloading i get error code 8 Invalid state. I just have the app without bootloader. 

Am I missing something? I really appreciate your help.de

Parents
  • Hi,

    I'm not seeing this behavior here.

    Do you see the same with e.g. nRF52840 or nRF52832 DK, and the un-modified example? Or is this just happening with the modified example/project?

  • The example works fine with nRF52840, and it works with nrf52811 each time i erase the chip with nRFconnect  but when i reset it i get the hardfault. I use this board. 

  • nahro said:
    but when i reset it i get the hardfault

    I'm trying to reproduce it. Can you explain in detail how you reset it to trigger this?

  • Here i get the hardfault, if i download and debug:

    if I reset it and run it again i still get hardfault:

    But if I debug without downloading:

    sd_softdevice_enable return 8.

    I i erase the chip it will work just once:

    if i reset it i get the same error code:

  • Debug in IAR does not issue a hard reset which means the SoftDevice is not correctly initialised. Further any debug break or step requires the use of J-Link Monitor. Here are some notes:

       // Allow 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 IAR settings:
       // 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);

    j-link-monitoring-mode-debugging

    IAR comments here:

    must-re-flash-softdevice-every-time-i-debug

Reply
  • Debug in IAR does not issue a hard reset which means the SoftDevice is not correctly initialised. Further any debug break or step requires the use of J-Link Monitor. Here are some notes:

       // Allow 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 IAR settings:
       // 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);

    j-link-monitoring-mode-debugging

    IAR comments here:

    must-re-flash-softdevice-every-time-i-debug

Children
  • Thank you for your answer. If SoftDevice is not correctly initialized, why the device is working fine? advertising and i can  connect and read/write from characteristics? I have this issue when i debugging. Now I added DEVELOP_IN_NRF52840 flag and the issue disappear which is wired because i changed the target  to nrf52811 and the target is nrf52811 and i followed this:

    Updated: DEVELOP_IN_NRF52840  worked just once and i get the same issue again.

  • I fixed the problem by porting s112 nrf52811 example to s140

Related