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

IAR Flash Loader Error nRF52810

I am developing for an nRF52810 target application.

I am using IAR 8.42 with a PE Micro debugger.  If I debug a project (call it project A), the linker ROM space starts at 0x0, I can program a device with the debugger, and run and step through the code. 

If I create a project (project B) that loads S112 at offset 0 and the linker ROM space starts at 0x190000, I can run the code.

However, if I then want to go back and load a different project at 0, and restart the debugging session, the flash loader fails, and I can’t recover my board.  I try to erase the device, but it doesn’t completely erase.  The addresses from 0x0 to 0xAFF do not return to 0xFF.

I have burned through a few boards now.

THe, if I try to start the ROM space at 0x190000, the stack pointer does not align, and I can’t run the code.

Any idea of what is happening?  Thanks

Parents
  • Hi, I don't have a PE Micro to test with, unfortunately. I tried to replicate this with the regular J-link by adding automatic loading of the Softdevice in a BLE example then went back and debugged the blinky example starting at 0x0, but the Softdevice got overwritten successfully so didn't encounter any problems with debugging.

    The problem in your case appears to be that the debugger fails to erase the MBR section of the Softdevice at address 0 for some reason. Does the PE Micro have a separate programming utility you can use to perform a chiperase? Alternatively, give you register access so you can do the "Erase all" manually?

    And probably not related but the following option must be enabled when debugging applications that uses the Softdevice:

    Also, it may be worth trying to update to the most recent MDK release in case it includes improvements to the flash loader. It's available for download at https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-MDK/Download#infotabs

Reply
  • Hi, I don't have a PE Micro to test with, unfortunately. I tried to replicate this with the regular J-link by adding automatic loading of the Softdevice in a BLE example then went back and debugged the blinky example starting at 0x0, but the Softdevice got overwritten successfully so didn't encounter any problems with debugging.

    The problem in your case appears to be that the debugger fails to erase the MBR section of the Softdevice at address 0 for some reason. Does the PE Micro have a separate programming utility you can use to perform a chiperase? Alternatively, give you register access so you can do the "Erase all" manually?

    And probably not related but the following option must be enabled when debugging applications that uses the Softdevice:

    Also, it may be worth trying to update to the most recent MDK release in case it includes improvements to the flash loader. It's available for download at https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-MDK/Download#infotabs

Children
Related