J-Link OB not working on nrf9160dk

Hi,

I have an nrf9160dk which is not modified in any way as far as I can tell. I am not sure exactly which hardware revision (it just says 1.0.0 on the label), but it has the nrf9160-SICA-B1 on it and the build date is 2020.49. It has a freescale/NXP part as the J-Link programmer.

First issue is that when I connect it to an ubuntu 20.04 system (vmware fusion running on a x86-64 mac), the mass storage device doesn't mount correctly. dmesg shows the following:

[ 2045.196188] sd 33:0:0:0: [sdb] Attached SCSI removable disk
[ 2051.273706] FAT-fs (sdb): error, corrupted directory (invalid entries)
[ 2051.273713] FAT-fs (sdb): Filesystem has been set read-only

Erase appears to work fine:

$ nrfjprog -e
Erasing user available code and UICR flash areas.
Applying system reset.

But when I try to flash a hex file using nrfjprog I get the following output:


Parsing image file.
Verifying programming.
ERROR: [  JLink] - Communication timed out: Requested 8196 bytes, received 0 bytes !
ERROR: [SeggerBackend] - JLinkARM.dll ReadMem returned error 1.
ERROR: [SeggerBackend] - JLinkARM.dll ReadMem returned error 1.
ERROR: [SeggerBackend] - JLinkARM.dll ReadMem returned error 1.
ERROR: [SeggerBackend] - JLinkARM.dll ReadMem returned error 1.
ERROR: [SeggerBackend] - JLinkARM.dll ReadMem returned error 1.
ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
ERROR: [  nRF91] - The read access failed due to memory protection.
ERROR: [  nRF91] - Failed to read from flash
ERROR: [  nRF91] - Flash verification failed.
ERROR: [  nRF91] - Failed while verifying file merged.hex.
ERROR: [SeggerBackend] - JLinkARM.dll reported error -256 at line 3790.
ERROR: [SeggerBackend] - JLinkARM.dll reported error -256 at line 4535.
ERROR: [SeggerBackend] - JLinkARM.dll reported error -256 at line 3790.
ERROR: [SeggerBackend] - JLinkARM.dll reported error -256 at line 4535.
ERROR: [SeggerBackend] - JLinkARM.dll reported error -256 at line 4244.
ERROR: [SeggerBackend] - JLinkARM.dll reported error -256 at line 4292.
ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
ERROR: [SeggerBackend] - JLinkARM.dll reported error -256 at line 4365.
ERROR: [SeggerBackend] - JLinkARM.dll reported error -256 at line 4292.
ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
ERROR: [SeggerBackend] - JLinkARM.dll reported error -256 at line 4365.
ERROR: [SeggerBackend] - JLinkARM.dll reported error -256 at line 4292.
ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
ERROR: [SeggerBackend] - JLinkARM.dll reported error -256 at line 4365.
ERROR: [SeggerBackend] - JLinkARM.dll reported error -256 at line 4292.
ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
ERROR: [SeggerBackend] - JLinkARM.dll reported error -256 at line 4365.
ERROR: [SeggerBackend] - JLinkARM.dll reported error -256 at line 4292.
ERROR: [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
ERROR: [SeggerBackend] - JLinkARM.dll reported error -256 at line 4365.
ERROR: The JLinkARM DLL timed out while communicating to the J-Link probe.
ERROR: If the error condition persists, run the same command again with
ERROR: argument -- log, contact Nordic Semiconductor and provide the generated
ERROR: log.log file to them.

I have attached the log file to this post. Looking through it, it seems that there is a read error due to flash protection, but even if I "--recover" the device, it makes no difference. I also observe a USB reset, implying that the J-Link device has crashed. Occasionally it even starts up in bootloader mode.

I am also unable to flash the nrf52840 on thet board using the J-Link OB (even after erasing/recovering):

$ nrfjprog --program nrf9160_dk_board_controller_fw.hex --verify --log
Parsing image file.
Verifying programming.
ERROR: [  nRF53] - Data does not match in address range [0x00000000-0x0000b106] (APP Flash)
ERROR: [  nRF53] - Expected byte value 0x08 but read 0x00 at address 0x00000000.
ERROR: [  nRF53] - Flash verification failed.
ERROR: [  nRF53] - Failed while verifying file nrf9160_dk_board_controller_fw.hex.
ERROR: Write verify failed.

1781.log2.log

I have confirmed with JLinkConfigExe that the device is running the latest firmware ("2021 Dec 3 15:46"):

$ ./JLinkExe 
SEGGER J-Link Commander V7.70c (Compiled Aug 18 2022 17:30:05)
DLL version V7.70c, compiled Aug 18 2022 17:29:50

Connecting to J-Link via USB...O.K.
Firmware: J-Link OB-K22-NordicSemi compiled Dec  3 2021 15:46:55
Hardware version: V1.00
J-Link uptime (since boot): N/A (Not supported by this model)
S/N: 960005960
License(s): RDI, FlashBP, FlashDL, JFlash, GDB
VTref=3.300V


I have also upgraded the J-Link tools to v7.70c without any improvement.

If I then disconnect the IF MCU using the switch on the board and connect my real J-Link Plus (not an OB one), everything works fine with both erasing and flashing the nrf9160.

Also, if I connect an nrf5340dk (hw rev 2.0.0, it has the nrf5340 as the J-Link also) debug out to the debug in port of the nrf9160dk, enable the IF MCU on the nrf9160dk and switch the IF MCU to the nrf52 on the nrf9160dk to disconnect the J-Link OB from the nrf9160, then I am also able to program the nrf9160 via the nrf5340dk.

Can you please help me understand what is wrong with this board? It seems like a firmware bug in the J-Link OB.

Thanks,

Jeremy

Parents Reply Children
No Data
Related