nRF9160dk onboard controller crash

Ever since I updated the onboard controller for nRF9160dk ( see  jLink USB-UART chip on nRF9160dk malfunction )

I've been experiencing a crash whenever I try to erase or program the nRF52840 chip, while the USB UART interfaces are in use.

I tried using different USB cables and ports. I reproduce the crash on both macOS and Windows. The USB UARTs may be open in KiTTY or gncom https://httpstorm.com/download/g-net-com/

Steps to reproduce:

1. Toggle the onboard switch to program the nRF52840 chip

2. Open the USB UARTs in gncom or KiTTY

2a. macOS

gncom -r 115200 -T -f /dev/cu.usbmodem0009600613711
gncom -r 115200 -T -f /dev/cu.usbmodem0009600613713

2b. Windows

gncom -r 115200 -T -f \\.\COM10
gncom -r 115200 -T -f \\.\COM11

3a. Start nRF Connect for Desktop, and open Programmer

3b. Make sure Auto read memory is enabled

3c. SELECT DEVICE, nRF9160 DK

3d. The board controller reboots, USB UARTS are disconnected

3e. on macOS gncom reports "ERROR: 6, Device not configured"

3f. on Windows gncom reports

AlG_SO_TASK::h_pipe.read()
^ERROR: 995, The I/O operation has been aborted because of either a thread exit or an application request.

3g. on macOS Programmer reports

19:43:05.013 Using nrf-device-lib-js version: 0.4.15
19:43:05.014 Using nrf-device-lib version: 0.12.8
19:43:05.337 Using nrfjprog DLL version: 10.16.0
19:43:05.337 Using JLink version: JLink_V7.80d
19:43:05.398 Installed JLink version does not match the provided version (V7.66a)
19:43:14.215 Using @nordicsemiconductor/nrf-device-lib-js to communicate with target via JLink
19:43:14.215 JLink OB firmware version J-Link OB-K22-NordicSemi compiled Dec 3 2021 15:46:55
19:43:14.219 Device family NRF52_FAMILY
19:43:14.220 Device version NRF52840_xxAA_REV2
19:43:14.221 Board version PCA10090
19:43:14.223 Loading readback protection status for Application core
19:43:14.929 Readback protection status: NRFDL_PROTECTION_STATUS_NONE
19:43:15.611 Parse memory regions for Application core
19:43:15.616 Update files regions according to Application core
19:43:15.616 Parse memory regions for file
19:43:15.624 Device is loaded and ready for further operation
19:43:15.628 Reading memory for NRFDL_DEVICE_CORE_APPLICATION core
19:43:16.339 Target device closed
19:43:16.498 Failed to get device memory map: async task failure for id: 338167846 msg: JLINKARM_DLL_TIME_OUT_ERROR (Origin: "Error when running fw program.")
19:43:16.500 Error when reading device

3h. on Windows Programmer reports

20:00:08.848 Using nrf-device-lib-js version: 0.4.13
20:00:08.849 Using nrf-device-lib version: 0.12.8
20:00:08.849 Using nrfjprog DLL version: 10.16.0
20:00:08.850 Using JLink version: JLink_V7.80d
20:00:09.000 Installed JLink version does not match the provided version (V7.66a)
20:00:12.145 Using @nordicsemiconductor/nrf-device-lib-js to communicate with target via JLink
20:00:12.146 JLink OB firmware version J-Link OB-K22-NordicSemi compiled Dec 3 2021 15:46:55
20:00:12.146 Device family NRF52_FAMILY
20:00:12.147 Device version NRF52840_xxAA_REV2
20:00:12.147 Board version PCA10090
20:00:12.148 Loading readback protection status for Application core
20:00:13.043 Readback protection status: NRFDL_PROTECTION_STATUS_NONE
20:00:13.844 Parse memory regions for Application core
20:00:13.857 Update files regions according to Application core
20:00:13.857 Parse memory regions for file
20:00:13.877 Device is loaded and ready for further operation
20:00:13.884 Reading memory for NRFDL_DEVICE_CORE_APPLICATION core
20:00:14.958 Failed to get device memory map: async task failure for id: 2171690943 msg: JLINKARM_DLL_TIME_OUT_ERROR (Origin: "Error when running fw program.")
20:00:14.959 Error when reading device
20:00:15.076 Target device closed

if step 3c is repeated a few times, the board controller LED is switched off, and the board is no longer recognised until power is switched off/on or the USB interface is reconnected.

4a. Start nRF Connect for Desktop, and open Toolchain Manager, then VS code

4b. Add Application:
nrf/Applications/connectivity_bridge_dk (see jlink-crash.7z)

4c. Create build configuration for nrf9160dk_nrf52840 (see jlink-crash.7z)

4d. Flash

* Executing task: nRF Connect: Flash: connectivity_bridge_dk/build (active)

Flashing build to 960061371
west flash -d v:\nordic\v2.1.0\nrf\applications\connectivity_bridge_dk\build --skip-rebuild -r nrfjprog --dev-id 960061371

-- west flash: using runner nrfjprog
-- runners.nrfjprog: Flashing file: V:\nordic\v2.1.0\nrf\applications\connectivity_bridge_dk\build\zephyr\merged.hex
Parsing image file.
Verifying programming.
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.
NOTE: For additional output, try running again with logging enabled (--log).
NOTE: Any generated log error messages will be displayed.
FATAL ERROR: command exited with status 35: nrfjprog --program 'V:\nordic\v2.1.0\nrf\applications\connectivity_bridge_dk\build\zephyr\merged.hex' --sectoranduicrerase --verify -f NRF52 --snr 960061371

* The terminal process terminated with exit code: 35.
* Terminal will be reused by tasks, press any key to close it.

5a. Run the Segger J-Link GDB Server.

5b. Connect a debugger over the network or localhost.

5c. Try to reprogram the board using merged.hex (previously generated by VS-code in step 4c).

5d. The GDB server reports an error and disconnects.

Mitigating factors:

All previously described errors are reproduced even if the nRF52840 chip is erased.

In my tests I have the used SEGGER - J-Link V7.80d drivers installed on both macOS and Windows. I also tried installing some older versions, but this did not make any difference. Segger may also want to investigate BSOD on Windows. After playing with the onboard controller crash for some time, I got a blue screen. I also got a blue screen when I first installed V7.80d and connected the board. I should note that I've been experiencing these with older versions of Segger drivers in the past years with different computers, jTAG interfaces and boards.

With JLink_Windows_V754a_x86_64 installed, J-Link Configurator shows that the board controller firmware is newer 2021 Dec 3 15:46, then the host firmware, but it does not allow me to downgrade.

If the USB UARTs are being used, any read, erase and program operation will fail.
If the USB UARTs are NOT in use, there is a 50% chance that a read, erase or program operation will fail.


jlink-crash.7z

Parents
  • Hi,

    I will try to reproduce this. What DK version are you using?

    I've been experiencing a crash whenever I try to erase or program the nRF52840 chip, while the USB UART interfaces are in use

    Are you referring to the on-board interface MCU, that provides the three virtual COM ports?

    4b. Add Application:
    nrf/Applications/connectivity_bridge_dk (see jlink-crash.7z)

    1) Is it only this application you are having issues with? or could I try to flash any application?

    2) This is the connectivity_bridge application that you have modified so that it can run on the DK, instead of the Thingy:91 ?

  • Hi Sigurd!

    I will try to reproduce this.

    Also try this:

    1. Connect the board
    2. Open the UARTs which connect to nRF9160 and nRF52840 in KiTTY
    3. Run J-Flash (I use V7.80d, though the version should not matter)
    4. Create new project, Start J-Flash
    5. Target device, ..., Device: nRF52840_xxAA, OK, OK
    6. Target, Connect
    7. Target, Manual Programming, Read Back, Entire chip (F10)
    8. KiTTY shows the two UARTs as disconnected, and I get the following error in j-Flash

    Or using J-Link

    jlink
    SEGGER J-Link Commander V7.80d (Compiled Oct 4 2022 16:42:18)
    DLL version V7.80d, compiled Oct 4 2022 16:40:52

    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: 960061371
    License(s): RDI, FlashBP, FlashDL, JFlash, GDB
    VTref=3.300V


    Type "connect" to establish a target connection, '?' for help
    J-Link>connect
    Please specify device / core. <Default>: NRF52840_XXAA
    Type '?' for selection dialog
    Device>
    Please specify target interface:
    J) JTAG (Default)
    S) SWD
    T) cJTAG
    TIF>S
    Specify target interface speed [kHz]. <Default>: 4000 kHz
    Speed>
    Device "NRF52840_XXAA" selected.


    Connecting to target via SWD
    InitTarget() start
    InitTarget() end
    Found SW-DP with ID 0x2BA01477
    DPIDR: 0x2BA01477
    CoreSight SoC-400 or earlier
    Scanning AP map to find all available APs
    AP[2]: Stopped AP scan as end of AP map has been reached
    AP[0]: AHB-AP (IDR: 0x24770011)
    AP[1]: JTAG-AP (IDR: 0x02880000)
    Iterating through AP map to find AHB-AP to use
    AP[0]: Core found
    AP[0]: AHB-AP ROM base: 0xE00FF000
    CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
    Found Cortex-M4 r0p1, Little endian.
    FPUnit: 6 code (BP) slots and 2 literal slots
    CoreSight components:
    ROMTbl[0] @ E00FF000
    [0][0]: E000E000 CID B105E00D PID 000BB00C SCS-M7
    [0][1]: E0001000 CID B105E00D PID 003BB002 DWT
    [0][2]: E0002000 CID B105E00D PID 002BB003 FPB
    [0][3]: E0000000 CID B105E00D PID 003BB001 ITM
    [0][4]: E0040000 CID B105900D PID 000BB9A1 TPIU
    [0][5]: E0041000 CID B105900D PID 000BB925 ETM
    Cortex-M4 identified.
    J-Link>mem
    Syntax: mem <Addr>, <NumBytes>
    J-Link>mem 0, 8192

    ****** Error: Communication timed out: Requested 8196 bytes, received 0 bytes !
    Could not read memory.

    I wonder if the MCU is running out of memory?

    J-Link>mem 0, 2048

    ****** Error: Communication timed out: Requested 8196 bytes, received 0 bytes !
    Could not read memory.

    J-Link>mem 0, 1024
    00000000 = 20 38 00 20 B5 20 00 00 05 67 00 00 89 20 00 00 8. . ...g... ..

    If I close KiTTY to release the USB UARTs, I can ready 0x100000 bytes without any issues.

    What DK version are you using?

    I have two boards, both of which experience the issue, and both had their firmware upgraded to 2021 Dec 3 15:46 using J-Link Configurator from Segger.

    nRF9160dk, PCA10090, 1.0.0, 2021.6, 960061371
    nRF9160dk, PCA10090, 0.9.0, 2019.21, 960094834

    Are you referring to the on-board interface MCU, that provides the three virtual COM ports?

    Yes, the big chip which provides jTAG and three UARTs over USB. MK22FN128VLL10

    1) Is it only this application you are having issues with? or could I try to flash any application?

    Any application. Attempting to read 8KB at address 0 also triggers a crash.

    2) This is the connectivity_bridge application that you have modified so that it can run on the DK, instead of the Thingy:91 ?

    Correct. Suggestion: It would be nice if Nordic integrates my changes in the original connectivity_bridge. This would allow access to data from the nRF9160 chip over BLE. Having the nRF52840 on board without using BLE makes no sense. Nordic has my permission to use the code ttached here and integrate it in nRF Connect SDK.

  • Hi,

    I see it's crashing here as well. Simply opening 2 COM-ports, and doing 'nrfjprog --memrd 0 --n 8192' makes it crash. I have reported it internally. I will update the case here when I have more info to share.

    BR,

    Sigurd

  • Hi,

    This issue is likely caused by overloading the J-Link OB, causing it to miss USB timings and crashing. We will report it to Segger.
Reply Children
Related