I'm trying to debug firmware on our production device, but after programming the device a couple of times, I am unable to program.
Inside of Segger I see this log:
Connecting ‘J-Link’ using ‘USB’ Connecting to target using SWD Loaded C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.10b/bin/JLink_x64.dll Firmware Version: J-Link ARM V8 compiled Nov 28 2014 13:44:46 DLL Version: 6.88a Hardware Version: V8.00 Target Voltage: 3.228 Device "NRF52832_XXAA" selected. InitTarget() start InitTarget() end Found SW-DP with ID 0x2BA01477 Unknown DP version. Assuming DPv0 Scanning AP map to find all available APs AP[0]: Stopped AP scan as end of AP map has been reached Iterating through AP map to find AHB-AP to use RESET (pin 15) high, but should be low. Please check target hardware. InitTarget() start InitTarget() end Found SW-DP with ID 0x2BA01477 Unknown DP version. Assuming DPv0 Scanning AP map to find all available APs AP[0]: Stopped AP scan as end of AP map has been reached Iterating through AP map to find AHB-AP to use Could not find core in Coresight setup connect failed Failed to connect to target. No idcode detected. Please check connection and Target Interface Type
j-flash shows this:
Connecting ... - Connecting via USB to probe/ programmer device 0 - Probe/ Programmer firmware: J-Link ARM V8 compiled Nov 28 2014 13:44:46 - Device "NRF52832_XXAA" selected. - Target interface speed: 4000 kHz (Fixed) - VTarget = 3.228V - InitTarget() start - InitTarget() end - Found SW-DP with ID 0x2BA01477 - Failed to power up DAP - RESET (pin 15) high, but should be low. Please check target hardware. - InitTarget() start - InitTarget() end - Found SW-DP with ID 0x2BA01477 - Failed to power up DAP - ERROR: Failed to connect. Could not establish a connection to target.
Attempting to use nrfjprog --recover --log has this as output:
Console Output: ERROR: JLinkARM DLL reported an error. Try again. If error condition ERROR: persists, run the same command again with argument --log, contact Nordic ERROR: Semiconductor and provide the generated log.log file to them. Log: [2021-Mar-02 12:42:43] [ info] -------------------------------------------------------------------------------- [2021-Mar-02 12:42:43] [ info] nrfjprog --recover --log [2021-Mar-02 12:42:43] [ info] nrfjprog version 10.12.1 [2021-Mar-02 12:42:43] [ info] -------------------------------------------------------------------------------- [2021-Mar-02 12:42:43] [debug] [ nRF0x0] - open_dll [2021-Mar-02 12:42:43] [ info] [ nRF0x0] - Load library at C:\Program Files (x86)\Nordic Semiconductor\nrf-command-line-tools\bin\JLINKARM_UNKNOWN_NRFJPROG.dll. [2021-Mar-02 12:42:43] [ info] [ nRF0x0] - Library loaded, loading member functions. [2021-Mar-02 12:42:43] [ info] [ nRF0x0] - Member functions succesfully loaded. [2021-Mar-02 12:42:43] [ info] [Backend] - Logger callback at 0x182020 registered in Segger backend logger. [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] Logger callback at 0x182020 registered in JLink logger. [2021-Mar-02 12:42:43] [debug] [nRFUnknown] - Just_open_dll_tagged_callback [2021-Mar-02 12:42:43] [debug] [Backend] - open_dll [2021-Mar-02 12:42:43] [ info] [Backend] - No J-Link DLL path was provided. Attempting to auto detect. [2021-Mar-02 12:42:43] [ info] [Backend] - Load library at C:\Program Files (x86)\SEGGER\JLink\JLinkARM.dll. [2021-Mar-02 12:42:43] [ info] [Backend] - Library loaded, loading member functions. [2021-Mar-02 12:42:43] [ info] [Backend] - Member functions succesfully loaded. [2021-Mar-02 12:42:43] [debug] [Backend] - dll_version [2021-Mar-02 12:42:43] [ info] [Backend] - Segger dll version 6.88.a loaded. [2021-Mar-02 12:42:43] [debug] [Backend] - set_core_data [2021-Mar-02 12:42:43] [debug] [ nRF0x0] - enum_emu_snr [2021-Mar-02 12:42:43] [debug] [nRFUnknown] - Just_enum_emu_snr [2021-Mar-02 12:42:43] [debug] [Backend] - enum_emu_snr [2021-Mar-02 12:42:43] [debug] [Backend] - ---just_enum_emu_snr [2021-Mar-02 12:42:43] [debug] [Backend] - ---just_get_num_emus [2021-Mar-02 12:42:43] [debug] [ nRF0x0] - connect_to_emu_with_snr [2021-Mar-02 12:42:43] [debug] [nRFUnknown] - Just_connect_to_emu_with_snr [2021-Mar-02 12:42:43] [debug] [Backend] - connect_to_emu_with_snr [2021-Mar-02 12:42:43] [debug] [Backend] - is_connected_to_emu [2021-Mar-02 12:42:43] [debug] [Backend] - ---just_enum_emu_snr [2021-Mar-02 12:42:43] [debug] [Backend] - ---just_get_num_emus [2021-Mar-02 12:42:43] [debug] [Backend] - ---just_connect_to_emu_with_snr [2021-Mar-02 12:42:43] [debug] [Backend] - ---just_connect_to_emu_without_snr [2021-Mar-02 12:42:43] [ info] [Backend] - Segger logging enabled. [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] Firmware: J-Link ARM V8 compiled Nov 28 2014 13:44:46 [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] Hardware: V8.00 [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] S/N: 4294967295 [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] OEM: SEGGER [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] Feature(s): RDI,FlashDL,FlashBP,JFlash,GDB [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] TELNET listener socket opened on port 19021 [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] WEBSRV Starting webserver [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] WEBSRV Webserver running on local port 19080 [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] - 9.513ms returns "O.K." [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError() [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] JLINK_GetHWStatus(...) [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] - 0.402ms returns 0 [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError() [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] JLINK_ExecCommand("SetRestartOnClose = 0", ...). [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] - 0.009ms returns 0x01 [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError() [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] JLINK_ExecCommand("DisableFlashDL", ...). [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] - 0.006ms returns 0x00 [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError() [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] JLINK_ExecCommand("ExcludeFlashCacheRange 0x0-0xFFFFFFFF", ...). [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] - 0.005ms returns 0x00 [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError() [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] JLINK_SetHookUnsecureDialog [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] JLINK_SetHookUnsecureDialog(...) [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] - 0.023ms returns 0 [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError() [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] JLINK_TIF_Select(JLINKARM_TIF_SWD) [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] - 1.250ms returns 0x00 [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError() [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] JLINK_SetSpeed(2000) [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] - 0.230ms [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError() [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] JLINK_GetSN() [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] - 0.010ms returns -1 [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError() [2021-Mar-02 12:42:43] [ info] [Backend] - JLinkARM.dll reported "-1", an unknown error. [2021-Mar-02 12:42:43] [ info] [ JLink] - [Info ] [JLink ] JLINK_Close() [2021-Mar-02 12:42:43] [debug] [ nRF0x0] - close_dll [2021-Mar-02 12:42:43] [debug] [nRFUnknown] - Just_close_dll [2021-Mar-02 12:42:43] [debug] [Backend] - close [2021-Mar-02 12:42:43] [debug] [Backend] - disconnect_from_emu [2021-Mar-02 12:42:43] [debug] [Backend] - is_connected_to_emu [2021-Mar-02 12:42:43] [debug] [Backend] - Segger Backend closed.
A couple of items of note:
- I have several j-flash devices and even the nRF-52 DK, the same results (less log output on the nRF52-DK)
- I have tried rebooting and on multiple computers
- I have tried this on several production devices. They let me write to them sometimes
- I have found and terminated an errant j-flash process in the past which let me write to the device
- When writing the firmware to the nRF-52 DK or the Fanstel EV-BM832 board, I do not have any trouble
- The production device is using the internal oscillator settings rather than a crystal. These settings are:
nrf_clock_lf_cfg_t const clock_lf_cfg = { .source = 0, .rc_ctiv = 16, .rc_temp_ctiv = 2, .accuracy = 7 };
I am a little worried that the header got a little fancy with the "ESD" protection.
Any ideas or help would be appreciated!