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

Since Nordic SDK release v1.0.0 our nRF9160 start having issues flashing and erasing. Coincidence?

Hi,

I'm using the latest release of software V1.0.0 with the nRF9160 DK and today started flashing the examples.

at_client worked fine (just tried flashing it once, but remember there was something going on there as well).
the sample application asset_tracker worked first time, I made some modifications to the code, and flashing it after, is very problematic.
See the log below.
* Erasing sectors fails.
* RAM doesn't respond in time..
I had to try several times, and also try to manually "erase all" but even that option took several tries before succeeding.

/Johan

LOG

Connecting ‘J-Link’ using ‘USB’
Connecting to target using SWD
Loaded F:/arm_segger_embedded_studio_v418_win_x64_nordic/bin/JLink_x64.dll
Firmware Version: J-Link OB-K22-NordicSemi compiled Feb 14 2019 14:03:18
DLL Version: 6.46h
Hardware Version: V1.00
Target Voltage: 3.300
Device "NRF9160" selected.
Found SW-DP with ID 0x6BA02477
Scanning AP map to find all available APs
AP[5]: Stopped AP scan as end of AP map seems to be reached
AP[0]: AHB-AP (IDR: 0x84770001)
AP[1]: AHB-AP (IDR: 0x24770011)
AP[2]: AHB-AP (IDR: 0x84770001)
AP[3]: APB-AP (IDR: 0x54770002)
AP[4]: JTAG-AP (IDR: 0x12880000)
Iterating through AP map to find AHB-AP to use
AP[0]: Core found
AP[0]: AHB-AP ROM base: 0xE00FF000
CPUID register: 0x410FD212. Implementer code: 0x41 (ARM)
Found Cortex-M33 r0p2, Little endian.
FPUnit: 8 code (BP) slots and 0 literal slots
Security extension: implemented
Secure debug: enabled
CoreSight components:
ROMTbl[0] @ E00FF000
ROMTbl[0][0]: E000E000, CID: B105900D, PID: 000BBD21 Cortex-M33
ROMTbl[0][1]: E0001000, CID: B105900D, PID: 000BBD21 DWT
ROMTbl[0][2]: E0002000, CID: B105900D, PID: 000BBD21 FPB
ROMTbl[0][3]: E0000000, CID: B105900D, PID: 000BBD21 ITM
ROMTbl[0][5]: E0041000, CID: B105900D, PID: 002BBD21 ETM
ROMTbl[0][6]: E0042000, CID: B105900D, PID: 000BBD21 CTI
Preparing target for download
Executing Reset script TargetInterface.resetAndStop()
Reset: Halt core after reset via DEMCR.VC_CORERESET.
Reset: Reset device via AIRCR.SYSRESETREQ.
Reset: CPU may have not been reset (DHCSR.S_RESET_ST never gets set).
Reset: Using fallback: Reset pin.
Reset: Halt core after reset via DEMCR.VC_CORERESET.
Reset: Reset device via reset pin
Reset: VC_CORERESET did not halt CPU. (Debug logic also reset by reset pin?).
Reset: Reconnecting and manually halting CPU.
Found SW-DP with ID 0x6BA02477
AP map detection skipped. Manually configured AP map found.
AP[0]: AHB-AP (IDR: Not set)
AP[0]: Core found
AP[0]: AHB-AP ROM base: 0xE00FF000
CPUID register: 0x410FD212. Implementer code: 0x41 (ARM)
Found Cortex-M33 r0p2, Little endian.
Erasing Chip
J-Link: Flash download: Total time needed: 0.211s (Prepare: 0.032s, Compare: 0.000s, Erase: 0.172s, Program: 0.000s, Verify: 0.000s, Restore: 0.007s)
J-Link: Flash download: Total time needed: 0.213s (Prepare: 0.034s, Compare: 0.000s, Erase: 0.171s, Program: 0.000s, Verify: 0.000s, Restore: 0.007s)
Timeout while erasing sectors, RAMCode did not respond in time. (PC = 0x00000000, CPSR = 0x00000000, LR = 0x01000003)!
Failed to erase sectors.
J-Link: Flash download: Total time needed: 20.736s (Prepare: 0.034s, Compare: 0.000s, Erase: 20.690s, Program: 0.000s, Verify: 0.000s, Restore: 0.011s)
Preparing target for download
Executing Reset script TargetInterface.resetAndStop()
Reset: Halt core after reset via DEMCR.VC_CORERESET.
Reset: Reset device via AIRCR.SYSRESETREQ.
Erasing Chip
J-Link: Flash download: Total time needed: 0.243s (Prepare: 0.047s, Compare: 0.000s, Erase: 0.172s, Program: 0.000s, Verify: 0.000s, Restore: 0.024s)
J-Link: Flash download: Total time needed: 0.245s (Prepare: 0.049s, Compare: 0.000s, Erase: 0.172s, Program: 0.000s, Verify: 0.000s, Restore: 0.024s)
J-Link: Flash download: Total time needed: 21.993s (Prepare: 0.077s, Compare: 0.000s, Erase: 21.866s, Program: 0.000s, Verify: 0.000s, Restore: 0.049s)

Parents Reply
  • This happened the first time. Try to do an eraseall via command line first (nrfjprog -e), then program a separate hex file via command line & then program your application via SES again. You can then program the first hex file via command line:

    nrfjprog --program merged.hex -f nrf91 --sectorerase --verify

    & then program via SES again. You can continue this loop a few times. After the first error, I never saw this error again.

    If you still see the error, you may want to try to use the latest version of SES.

Children
  • I'm trying your suggestions.

    Newer Segger version:
    To download a version newer than 4.20a isn't possible. From using your nRF Connect V3.2.0-tool to download the nordic-version of segger, it only gives me 4.20a. On the segger homepage there is a version 4.22, but using that one, just forces me to request a valid license through email from nordic, and putting that licence in, doesnt open up segger to nordic projects. The "Open nRF connect...SDK"-menu option under "File" isn't there. And every time I restart the segger 4.22 it asks for a valid licence over and over again. It doesn't work.

    And your solution above, worked 1 time.
    I erased all via commandline.
    I flashed another hex via commandline.
    I built my SES application vid RUN and it flashed.
    Looked good and it starts and the change in printk message is different.
    I try it again in SES, modify the printk message and press run.
    Now it hangs on the Erase operation like before.


    The bug isn't fixed. Sorry Nordic. More debugging to do.

  • Sorry, my bad. I was under the impression nrfjprog was being used on SES, but it seems the bug has not yet been fixed in the newest version of JLINK, which is used directly by SES. I will report this internally. I noticed the same undocumented error issue if I erased via nrfjprog -e first, then programmed asset tracker via SES & then programmed at client via SES.

    However, it does seem to work fine via command line now, so it's one step forward in the right direction:

    $ nrfjprog --program at.hex -f nrf91 --verify --sectorerase
    Parsing hex file.
    Erasing page at address 0x0.
    Erasing page at address 0x1000.
    Erasing page at address 0x2000.
    Erasing page at address 0x3000.
    Erasing page at address 0x4000.
    Erasing page at address 0x5000.
    Erasing page at address 0x6000.
    Erasing page at address 0x7000.
    Erasing page at address 0xC000.
    Erasing page at address 0xD000.
    Erasing page at address 0xE000.
    Erasing page at address 0xF000.
    Erasing page at address 0x10000.
    Erasing page at address 0x11000.
    Erasing page at address 0x12000.
    Erasing page at address 0x13000.
    Erasing page at address 0x14000.
    Erasing page at address 0x15000.
    Erasing page at address 0x16000.
    Erasing page at address 0x17000.
    Erasing page at address 0x18000.
    Erasing page at address 0x19000.
    Erasing page at address 0x1A000.
    Erasing page at address 0x1B000.
    Erasing page at address 0x1C000.
    Erasing page at address 0x1D000.
    Erasing page at address 0x1E000.
    Erasing page at address 0x1F000.
    Erasing page at address 0x20000.
    Erasing page at address 0x21000.
    Erasing page at address 0x22000.
    Erasing page at address 0x23000.
    Erasing page at address 0x24000.
    Erasing page at address 0x25000.
    Erasing page at address 0x26000.
    Erasing page at address 0x27000.
    Applying system reset.
    Checking that the area to write is not protected.
    Programming device.
    Verifying programming.
    Verified OK.
    
    $ nrfjprog --program asset.hex -f nrf91 --verify --sectorerase
    Parsing hex file.
    Erasing page at address 0x0.
    Erasing page at address 0x1000.
    Erasing page at address 0x2000.
    Erasing page at address 0x3000.
    Erasing page at address 0x4000.
    Erasing page at address 0x5000.
    Erasing page at address 0x6000.
    Erasing page at address 0x7000.
    Erasing page at address 0xC000.
    Erasing page at address 0xD000.
    Erasing page at address 0xE000.
    Erasing page at address 0xF000.
    Erasing page at address 0x10000.
    Erasing page at address 0x11000.
    Erasing page at address 0x12000.
    Erasing page at address 0x13000.
    Erasing page at address 0x14000.
    Erasing page at address 0x15000.
    Erasing page at address 0x16000.
    Erasing page at address 0x17000.
    Erasing page at address 0x18000.
    Erasing page at address 0x19000.
    Erasing page at address 0x1A000.
    Erasing page at address 0x1B000.
    Erasing page at address 0x1C000.
    Erasing page at address 0x1D000.
    Erasing page at address 0x1E000.
    Erasing page at address 0x1F000.
    Erasing page at address 0x20000.
    Erasing page at address 0x21000.
    Erasing page at address 0x22000.
    Erasing page at address 0x23000.
    Erasing page at address 0x24000.
    Erasing page at address 0x25000.
    Erasing page at address 0x26000.
    Erasing page at address 0x27000.
    Erasing page at address 0x28000.
    Erasing page at address 0x29000.
    Erasing page at address 0x2A000.
    Erasing page at address 0x2B000.
    Erasing page at address 0x2C000.
    Erasing page at address 0x2D000.
    Erasing page at address 0x2E000.
    Erasing page at address 0x2F000.
    Erasing page at address 0x30000.
    Erasing page at address 0x31000.
    Erasing page at address 0x32000.
    Erasing page at address 0x33000.
    Erasing page at address 0x34000.
    Erasing page at address 0x35000.
    Erasing page at address 0x36000.
    Erasing page at address 0x37000.
    Erasing page at address 0x38000.
    Applying system reset.
    Checking that the area to write is not protected.
    Programming device.
    Verifying programming.
    Verified OK.
    
    $ nrfjprog --program at.hex -f nrf91 --verify --sectorerase
    Parsing hex file.
    Erasing page at address 0x0.
    Erasing page at address 0x1000.
    Erasing page at address 0x2000.
    Erasing page at address 0x3000.
    Erasing page at address 0x4000.
    Erasing page at address 0x5000.
    Erasing page at address 0x6000.
    Erasing page at address 0x7000.
    Erasing page at address 0xC000.
    Erasing page at address 0xD000.
    Erasing page at address 0xE000.
    Erasing page at address 0xF000.
    Erasing page at address 0x10000.
    Erasing page at address 0x11000.
    Erasing page at address 0x12000.
    Erasing page at address 0x13000.
    Erasing page at address 0x14000.
    Erasing page at address 0x15000.
    Erasing page at address 0x16000.
    Erasing page at address 0x17000.
    Erasing page at address 0x18000.
    Erasing page at address 0x19000.
    Erasing page at address 0x1A000.
    Erasing page at address 0x1B000.
    Erasing page at address 0x1C000.
    Erasing page at address 0x1D000.
    Erasing page at address 0x1E000.
    Erasing page at address 0x1F000.
    Erasing page at address 0x20000.
    Erasing page at address 0x21000.
    Erasing page at address 0x22000.
    Erasing page at address 0x23000.
    Erasing page at address 0x24000.
    Erasing page at address 0x25000.
    Erasing page at address 0x26000.
    Erasing page at address 0x27000.
    Applying system reset.
    Checking that the area to write is not protected.
    Programming device.
    Verifying programming.
    Verified OK.
    

  • I see the ticket is closed, but it is not solved, or?

    How is that JLINK-bugfix going for the SES? 

    My collegue still experience the SES-problem, having to turn on and off the DK to be able to flash it repeatedly.

Related