Hello,
i am facing issue with nRF5x Command Line Tools. I am using custom board with nRF52832. While i am using Segger J-flash Lite there is no problem to flash program (so it is not HW issue), but nRF5x Command Tool just does not work. I tried version 9.1 and 9.0. No commands working, i am not able to recover, erase neither flash MCU. All setup is same i just switch between nRF5x Command Tool and JFlash Lite. I captured logs where i see JFlash Lite first call JLINK_Connect() but nRF5x call JLINK_IsOpen() and then JLINK_IsConnected() that returns False.
Log of successful flash via JFlash Lite.
SEGGER J-Link V6.34g Log File DLL Compiled: Sep 26 2018 14:45:08 Logging started @ 2018-11-12 14:32 T0C90 000:000 JLINK_Api_MRU_GetList()JLINK_OpenEx(...) Firmware: J-Link OB-STM32F072-128KB-CortexM compiled Sep 27 2018 09:37:50 Hardware: V1.00 S/N: 760010486 TELNET listener socket opened on port 19021WEBSRV Starting webserver (0036ms, 0039ms total) T1234 019:906 WEBSRV Webserver running on local port 19080 (0036ms, 0039ms total) T1234 019:906 returns O.K. (0036ms, 0039ms total) T1234 019:942 JLINK_ExecCommand("device = NRF52832_XXAA", ...). XML file found at: C:\Program Files (x86)\SEGGER\JLink_V634g\JLinkDevices.xml (0000ms, 0039ms total) T1234 019:943 C:\Program Files (x86)\SEGGER\JLink_V634g\JLinkDevices.xml evaluated successfully. returns 0x00 (0094ms, 0133ms total) T1234 020:037 JLINK_TIF_Select(JLINKARM_TIF_SWD) returns 0x00 (0002ms, 0135ms total) T1234 020:039 JLINK_SetSpeed(4000) (0000ms, 0135ms total) T1234 020:039 JLINK_Connect() >0x10B TIF> >0x10F TIF> >0x10B TIF> >0x10F TIF> >0x10B TIF> >0x10F TIF> >0x10B TIF> >0x10F TIF> >0x10B TIF>Found SW-DP with ID 0x2BA01477 >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x28 TIF>SWD speed too high. Reduced from 2000 kHz to 1012 kHz for stability >0x10B TIF>Found SW-DP with ID 0x2BA01477 >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x28 TIF> >0x35 TIF> >0x0D TIF> >0x28 TIF>Scanning AP map to find all available APs >0x0D TIF> >0x28 TIF> >0x35 TIF> >0x35 TIF> >0x0D TIF> >0x28 TIF> >0x35 TIF> >0x35 TIF> >0x0D TIF> >0x28 TIF> >0x35 TIF> >0x35 TIF>AP[2]: Stopped AP scan as end of AP map has been reachedAP[0]: AHB-AP (IDR: 0x24770011)AP[1]: JTAG-AP (IDR: 0x02880000)Iterating through AP map to find AHB-AP to use >0x42 TIF> >0x28 TIF> >0x0D TIF> >0x28 TIF> >0x35 TIF> >0x35 TIF> >0x42 TIF> >0x28 TIF> >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x28 TIF> >0x35 TIF> >0x35 TIF>AP[0]: Core foundAP[0]: AHB-AP ROM base: 0xE00FF000 >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x28 TIF> >0x35 TIF> >0x35 TIF>CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)Found Cortex-M4 r0p1, Little endian. -- Max. mem block: 0x00001908 -- CPU_ReadMem(4 bytes @ 0xE000EDF0) -- CPU_WriteMem(4 bytes @ 0xE000EDF0) -- CPU_ReadMem(4 bytes @ 0xE0002000) -- CPU_ReadMem(4 bytes @ 0xE000EDFC) -- CPU_WriteMem(4 bytes @ 0xE000EDFC) -- CPU_ReadMem(4 bytes @ 0xE0001000) -- CPU_WriteMem(4 bytes @ 0xE0001000) -- CPU_ReadMem(4 bytes @ 0xE000ED88) -- CPU_WriteMem(4 bytes @ 0xE000ED88) -- CPU_ReadMem(4 bytes @ 0xE000ED88) -- CPU_WriteMem(4 bytes @ 0xE000ED88)CoreSight components:ROMTbl[0] @ E00FF000 -- CPU_ReadMem(16 bytes @ 0xE00FF000) -- CPU_ReadMem(16 bytes @ 0xE000EFF0) -- CPU_ReadMem(16 bytes @ 0xE000EFE0)ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS-M7 -- CPU_ReadMem(16 bytes @ 0xE0001FF0) -- CPU_ReadMem(16 bytes @ 0xE0001FE0)ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 003BB002 DWT -- CPU_ReadMem(16 bytes @ 0xE0002FF0) -- CPU_ReadMem(16 bytes @ 0xE0002FE0)ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB -- CPU_ReadMem(16 bytes @ 0xE0000FF0) -- CPU_ReadMem(16 bytes @ 0xE0000FE0)ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 003BB001 ITM -- CPU_ReadMem(16 bytes @ 0xE00FF010) -- CPU_ReadMem(16 bytes @ 0xE0040FF0) -- CPU_ReadMem(16 bytes @ 0xE0040FE0)ROMTbl[0][4]: E0040000, CID: B105900D, PID: 000BB9A1 TPIU -- CPU_ReadMem(16 bytes @ 0xE0041FF0) -- CPU_ReadMem(16 bytes @ 0xE0041FE0) ROMTbl[0][5]: E0041000, CID: B105900D, PID: 000BB925 ETM returns 0x00 (0377ms, 0512ms total) T1234 020:416 JLINK_Reset() -- CPU is running -- CPU_WriteMem(4 bytes @ 0xE000EDF0) -- CPU is running -- CPU_WriteMem(4 bytes @ 0xE000EDFC) >0x35 TIF> -- CPU is running -- CPU_WriteMem(4 bytes @ 0xE000ED0C) >0x0D TIF> >0x28 TIF> -- CPU_ReadMem(4 bytes @ 0xE000EDF0) -- CPU_ReadMem(4 bytes @ 0xE000EDF0) -- CPU is running -- CPU_WriteMem(4 bytes @ 0xE000EDF0) -- CPU is running -- CPU_WriteMem(4 bytes @ 0xE000EDFC) -- CPU_ReadMem(4 bytes @ 0xE000EDF0) -- CPU_WriteMem(4 bytes @ 0xE0002000) -- CPU_ReadMem(4 bytes @ 0xE000EDFC) -- CPU_ReadMem(4 bytes @ 0xE0001000) (0077ms, 0589ms total) T1234 020:495 JLINK_DownloadFile()JLINK_BeginDownload(Flags = 0x00) (0005ms, 0595ms total) T1234 020:495 JLINK_WriteMem(0x00000000, 0x114A0 Bytes, ...) - Data: 00 00 01 20 89 B3 00 00 CD B3 00 00 CF B3 00 00 ... -- Read from flash cache (70816 bytes @ 0x00000000) returns 0x114A0 (0008ms, 0598ms total) T1234 020:495 JLINK_EndDownload() -- CPU_ReadMem(4 bytes @ 0xE000ED90) -- CPU_ReadMem(4 bytes @ 0xE000ED94) -- -------------------------------------- -- Start of determining dirty areas in flash cache -- End of determining dirty areas -- Start of preparing flash programming -- Calculating RAM usage -- RAM usage = 5804 Bytes -- Preserving CPU registers -- Preparing memory -- Preparing target -- Downloading RAMCode -- Checking target RAM -- Preparing RAMCode -- End of preparing flash programming -- CPU speed could not be measured. -- Start of comparing flash -- CRC check was estimated as fastest method -- Comparing range 0x0000 - 0x11FFF (18 Sectors, 72 KB), using multi-block CRC calculation -- All CRCs match -- Comparing range 0x0000 - 0x11FFF (18 Sectors, 72 KB), using alternative multi-block CRC calculation -- All CRCs match -- End of comparing flash -- Start of erasing sectors -- End of erasing sectors -- Start of flash programming -- End of flash programming -- Start of verifying flash -- End of verifying flash -- Start of restoring -- Restoring RAMCode -- Restore target -- Restore memory -- Restoring CPU registers -- End of restoring -- Bank 0 @ 0x00000000: Skipped. Contents already match -- Bank 0 @ 0x00000000: Skipped. Contents already match returns 0x00 (0156ms, 0746ms total) T1234 020:495 returns 0x00 (0156ms, 0746ms total) T1234 020:679 JLINK_Close() -- CPU_ReadMem(4 bytes @ 0xE0001000) >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x28 TIF> >0x0D TIF> >0x28 TIF> >0x35 TIF> >0x0D TIF> >0x28 TIF> (0019ms, 0765ms total) T1234 020:679 (0019ms, 0765ms total) T1234 020:679 Closed (0019ms, 0765ms total)
Log of unsuccessful flash via nRF5x Command Line Tools:
SEGGER J-Link V6.34g Log File DLL Compiled: Sep 26 2018 14:45:08 Logging started @ 2018-11-12 14:36 T351C 000:000 JLINK_GetDLLVersion() returns 63407 (0000ms, 0000ms total) T351C 000:000 JLINK_IsOpen() returns 0x00 (0000ms, 0000ms total) T351C 000:000 JLINK_EMU_GetNumDevices() returns 0x01 (0003ms, 0003ms total) T351C 000:003 JLINK_EMU_SelectByUSBSN(SerialNo = 760010486) returns 0x00 (0001ms, 0004ms total) T351C 000:004 JLINK_OpenEx(...) Firmware: J-Link OB-STM32F072-128KB-CortexM compiled Sep 27 2018 09:37:50 Hardware: V1.00 S/N: 760010486 TELNET listener socket opened on port 19021WEBSRV Starting webserver (0031ms, 0035ms total) T351C 000:004 WEBSRV Webserver running on local port 19080 (0032ms, 0036ms total) T351C 000:004 returns O.K. (0032ms, 0036ms total) T351C 000:036 JLINK_GetHWStatus(...) returns 0x00 (0000ms, 0036ms total) T351C 000:036 JLINK_ExecCommand("Device = NRF52832_xxAA", ...). XML file found at: C:\Program Files (x86)\SEGGER\JLink_V634g\JLinkDevices.xml (0001ms, 0037ms total) T351C 000:036 C:\Program Files (x86)\SEGGER\JLink_V634g\JLinkDevices.xml evaluated successfully.Device "NRF52832_XXAA" selected. returns 0x00 (0090ms, 0126ms total) T351C 000:126 JLINK_ExecCommand("SetRestartOnClose = 0", ...). returns 0x01 (0000ms, 0126ms total) T351C 000:126 JLINK_ExecCommand("DisableFlashDL", ...). returns 0x00 (0000ms, 0126ms total) T351C 000:126 JLINK_ExecCommand("SetDbgPowerDownOnClose = 1", ...). returns 0x01 (0000ms, 0126ms total) T351C 000:126 JLINK_ExecCommand("ExcludeFlashCacheRange 0x0-0xFFFFFFFF", ...). returns 0x00 (0000ms, 0126ms total) T351C 000:126 JLINK_TIF_Select(JLINKARM_TIF_SWD) returns 0x00 (0002ms, 0128ms total) T351C 000:128 JLINK_SetSpeed(2000) (0000ms, 0128ms total) T351C 000:129 JLINK_IsOpen() returns 0x01 (0000ms, 0128ms total) T351C 000:129 JLINK_IsConnected() returns FALSE (0000ms, 0128ms total) T351C 000:129 JLINK_CORESIGHT_Configure() returns 0 (0101ms, 0229ms total) T351C 000:230 JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000) returns -1 (0001ms, 0230ms total) T351C 000:232 JLINK_IsOpen() returns 0x01 (0000ms, 0230ms total) T351C 000:232 JLINK_IsConnected() returns FALSE (0000ms, 0230ms total) T351C 000:249 JLINK_Close() (0004ms, 0234ms total) T351C 000:249 (0004ms, 0234ms total) T351C 000:249 Closed (0004ms, 0234ms total)
nRF5x Command Line Tools Log:
2018-Nov-12 14:38:24 -------------------------------------------------------------------------------- 2018-Nov-12 14:38:24 nrfjprog.exe -f NRF52 --program leo.hex --chiperase --log 2018-Nov-12 14:38:24 nrfjprog version 9.8.0 2018-Nov-12 14:38:24 -------------------------------------------------------------------------------- 2018-Nov-12 14:38:24 nRF_open_dll 2018-Nov-12 14:38:24 . nRF52_open_dll 2018-Nov-12 14:38:24 . . nRF52_dll_version 2018-Nov-12 14:38:24 nRF_enum_emu_snr 2018-Nov-12 14:38:24 . nRF52_enum_emu_snr 2018-Nov-12 14:38:24 . . nRF52_enum_emu_snr 2018-Nov-12 14:38:24 nRF_enum_emu_snr 2018-Nov-12 14:38:24 . nRF52_enum_emu_snr 2018-Nov-12 14:38:24 . . nRF52_enum_emu_snr 2018-Nov-12 14:38:24 nRF_connect_to_emu_with_snr 2018-Nov-12 14:38:24 . nRF52_connect_to_emu_with_snr 2018-Nov-12 14:38:24 . . nRF52_is_connected_to_emu 2018-Nov-12 14:38:24 . . nRF52_enum_emu_snr 2018-Nov-12 14:38:24 . . nRF52_connect_to_emu_with_snr 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: Firmware: J-Link OB-STM32F072-128KB-CortexM compiled Sep 27 2018 09:37:50 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: Hardware: V1.00 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: S/N: 760010486 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: TELNET listener socket opened on port 19021 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: WEBSRV Starting webserver 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: (0036ms, 0042ms total) 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: WEBSRV Webserver running on local port 19080 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: (0037ms, 0043ms total) 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: returns O.K. 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: (0037ms, 0043ms total) 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: JLINK_GetHWStatus(...) 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: returns 0x00 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: (0001ms, 0045ms total) 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: There is no generic nRF52 device in J-Link, so we select NRF52832_xxAA. 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: JLINK_ExecCommand("Device = NRF52832_xxAA", ...). 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: XML file found at: C:\Program Files (x86)\SEGGER\JLink_V634g\JLinkDevices.xml 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: (0001ms, 0047ms total) 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: C:\Program Files (x86)\SEGGER\JLink_V634g\JLinkDevices.xml evaluated successfully. 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: Device "NRF52832_XXAA" selected. 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: Device "NRF52832_XXAA" selected. 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: returns 0x00 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: (0099ms, 0145ms total) 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: JLINK_ExecCommand("SetRestartOnClose = 0", ...). 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: returns 0x01 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: (0000ms, 0147ms total) 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: JLINK_ExecCommand("DisableFlashDL", ...). 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: returns 0x00 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: (0000ms, 0148ms total) 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: JLINK_ExecCommand("SetDbgPowerDownOnClose = 1", ...). 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: returns 0x01 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: (0001ms, 0150ms total) 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: JLINK_ExecCommand("ExcludeFlashCacheRange 0x0-0xFFFFFFFF", ...). 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: returns 0x00 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: (0001ms, 0151ms total) 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: JLINK_TIF_Select(JLINKARM_TIF_SWD) 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: returns 0x00 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: (0002ms, 0153ms total) 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: JLINK_SetSpeed(2000) 2018-Nov-12 14:38:24 . . . nRF52_connect_to_emu_without_snr: JLink: (0000ms, 0153ms total) 2018-Nov-12 14:38:24 nRF_read_device_version 2018-Nov-12 14:38:24 . nRF52_read_device_version 2018-Nov-12 14:38:24 . . nRF52_is_connected_to_emu 2018-Nov-12 14:38:24 . . nRF52_is_connected_to_emu: JLink: JLINK_IsOpen() 2018-Nov-12 14:38:24 . . nRF52_is_connected_to_emu: JLink: returns 0x01 2018-Nov-12 14:38:24 . . nRF52_is_connected_to_emu: JLink: (0001ms, 0155ms total) 2018-Nov-12 14:38:24 . . nRF52_is_connected_to_device 2018-Nov-12 14:38:24 . . nRF52_is_connected_to_device: JLink: JLINK_IsConnected() 2018-Nov-12 14:38:24 . . nRF52_is_connected_to_device: JLink: returns FALSE 2018-Nov-12 14:38:24 . . nRF52_is_connected_to_device: JLink: (0001ms, 0156ms total) 2018-Nov-12 14:38:24 . . nRF52_readback_status 2018-Nov-12 14:38:24 . . . nRF52_is_ctrl_ap_available 2018-Nov-12 14:38:24 . . . . nRF52_read_access_port_register 2018-Nov-12 14:38:24 . . . . . nRF52_coresight_configure 2018-Nov-12 14:38:24 . . . . . nRF52_coresight_configure: JLink: JLINK_CORESIGHT_Configure() 2018-Nov-12 14:38:24 . . . . . nRF52_coresight_configure: JLink: returns 0 2018-Nov-12 14:38:24 . . . . . nRF52_coresight_configure: JLink: (0103ms, 0259ms total) 2018-Nov-12 14:38:24 . . . . . nRF52_power_debug_and_system_regions 2018-Nov-12 14:38:24 . . . . . . nRF52_write_debug_port_register 2018-Nov-12 14:38:24 . . . . . . nRF52_write_debug_port_register: JLink: JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000) 2018-Nov-12 14:38:24 . . . . . . nRF52_write_debug_port_register: JLink: returns -1 2018-Nov-12 14:38:24 . . . . . . nRF52_write_debug_port_register: JLink: (0005ms, 0266ms total) 2018-Nov-12 14:38:24 . . . . . . nRF52_write_debug_port_register: JLinkARM.dll CORESIGHT_WriteAPDPReg returned error -1. 2018-Nov-12 14:38:24 . . . . . nRF52_power_debug_and_system_regions: JLinkARM.dll CORESIGHT_WriteAPDPReg returned error -102. 2018-Nov-12 14:38:24 nRF_close_dll 2018-Nov-12 14:38:24 . nRF52_close_dll 2018-Nov-12 14:38:24 . . nRF52_is_connected_to_emu 2018-Nov-12 14:38:24 . . nRF52_is_connected_to_emu: JLink: JLINK_IsOpen() 2018-Nov-12 14:38:24 . . nRF52_is_connected_to_emu: JLink: returns 0x01 2018-Nov-12 14:38:24 . . nRF52_is_connected_to_emu: JLink: (0002ms, 0270ms total) 2018-Nov-12 14:38:24 . . nRF52_disconnect_from_emu 2018-Nov-12 14:38:24 . . . nRF52_is_connected_to_device 2018-Nov-12 14:38:24 . . . nRF52_is_connected_to_device: JLink: JLINK_IsConnected() 2018-Nov-12 14:38:24 . . . nRF52_is_connected_to_device: JLink: returns FALSE 2018-Nov-12 14:38:24 . . . nRF52_is_connected_to_device: JLink: (0002ms, 0273ms total) 2018-Nov-12 14:38:24 . . . nRF52_unpower_debug_and_system_regions 2018-Nov-12 14:38:24 . . nRF52_disconnect_from_emu: JLink: JLINK_Close()
Thank you for your help