Unable to flash nrf5340.bin in the Getting Started example

Hi! I have a new out-of-the-box nrf5340DK and recommended Nucleo expansion board.
I am trying to follow the instructions in https://docs.edgeimpulse.com/docs/nordic-semi-nrf5340-dk however I can not successfully flash my nrf5340 with the downloaded nrf5340.bin file.
I first tried the “drag and drop” method but got the FAIL.txt message file which had the contents “error during erase”.
I then installed the nRF Command Line Tools and attempted to flash nrf5340.bin. I used the command line

 nrfjprog --program nrf5340.bin -f NRF53 --sectoranduicrerase --log

which terminated abnormally. I am including the log file contents below.
I do not believe there is a problem with the nrf5340 device itself as I am able to successfully flash and run the Heart Rate Monitor sample successfully.
Any help would be appreciated, as my task is to demonstrate Edge Impulse features running on the nrf5340 asap. Thanks!
== nrfjprog log file contents - the output stops abruptly when the nrfjprog executable ‘crashes’ ==
[2021-Feb-06 13:05:01] [ info] --------------------------------------------------------------------------------
[2021-Feb-06 13:05:01] [ info] nrfjprog --program nrf5340.bin -f NRF53 --sectoranduicrerase --log
[2021-Feb-06 13:05:01] [ info] nrfjprog version 10.12.1
[2021-Feb-06 13:05:01] [ info] --------------------------------------------------------------------------------
[2021-Feb-06 13:05:01] [debug] [ nRF0x0] - open_dll
[2021-Feb-06 13:05:01] [ info] [ nRF0x0] - Load library at C:\Program Files (x86)\Nordic Semiconductor\nrf-command-line-tools\bin\JLINKARM_NRF53_NRFJPROG.dll.
[2021-Feb-06 13:05:01] [ info] [ nRF0x0] - Library loaded, loading member functions.
[2021-Feb-06 13:05:01] [ info] [ nRF0x0] - Member functions succesfully loaded.
[2021-Feb-06 13:05:01] [ info] [Backend] - Logger callback at 0x262020 registered in Segger backend logger.
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] Logger callback at 0x262020 registered in JLink logger.
[2021-Feb-06 13:05:01] [debug] [nRF530x0] - open
[2021-Feb-06 13:05:01] [debug] [Backend] - open_dll
[2021-Feb-06 13:05:01] [ info] [Backend] - No J-Link DLL path was provided. Attempting to auto detect.
[2021-Feb-06 13:05:01] [ info] [Backend] - Load library at C:\Program Files (x86)\SEGGER\JLink\JLinkARM.dll.
[2021-Feb-06 13:05:01] [ info] [Backend] - Library loaded, loading member functions.
[2021-Feb-06 13:05:01] [ info] [Backend] - Member functions succesfully loaded.
[2021-Feb-06 13:05:01] [debug] [Backend] - dll_version
[2021-Feb-06 13:05:01] [ info] [Backend] - Segger dll version 6.88.a loaded.
[2021-Feb-06 13:05:01] [debug] [ nRF0x0] - enum_emu_snr
[2021-Feb-06 13:05:01] [debug] [nRF530x0] - enum_emu_snr
[2021-Feb-06 13:05:01] [debug] [Backend] - is_connected_to_emu
[2021-Feb-06 13:05:01] [debug] [Backend] - enum_emu_snr
[2021-Feb-06 13:05:01] [debug] [Backend] - —just_enum_emu_snr
[2021-Feb-06 13:05:01] [debug] [Backend] - —just_get_num_emus
[2021-Feb-06 13:05:01] [debug] [Backend] - is_connected_to_emu
[2021-Feb-06 13:05:01] [debug] [ nRF0x0] - connect_to_emu_with_snr
[2021-Feb-06 13:05:01] [debug] [nRF530x0] - connect_to_emu_with_snr
[2021-Feb-06 13:05:01] [debug] [Backend] - is_connected_to_emu
[2021-Feb-06 13:05:01] [debug] [Backend] - connect_to_emu_with_snr
[2021-Feb-06 13:05:01] [debug] [Backend] - is_connected_to_emu
[2021-Feb-06 13:05:01] [debug] [Backend] - —just_enum_emu_snr
[2021-Feb-06 13:05:01] [debug] [Backend] - —just_get_num_emus
[2021-Feb-06 13:05:01] [debug] [Backend] - —just_connect_to_emu_with_snr
[2021-Feb-06 13:05:01] [debug] [Backend] - —just_connect_to_emu_without_snr
[2021-Feb-06 13:05:01] [ info] [Backend] - Segger logging enabled.
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] Firmware: J-Link OB-K22-NordicSemi compiled Jan 21 2020 17:33:01
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] Decompressing FW timestamp took 104 us
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] Hardware: V1.00
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] S/N: 960137168
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] OEM: SEGGER
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] Feature(s): RDI, FlashBP, FlashDL, JFlash, GDB
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] TELNET listener socket opened on port 19021
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] WEBSRV Starting webserver
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] WEBSRV Webserver running on local port 19080
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] - 17.086ms returns “O.K.”
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] JLINK_Lock()
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] JLINK_GetHWStatus(…)
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] - 0.172ms returns 0
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] JLINK_ExecCommand(“SetRestartOnClose = 0”, …).
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] - 0.007ms returns 0x01
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] JLINK_ExecCommand(“DisableFlashDL”, …).
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] - 0.004ms returns 0x00
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] JLINK_ExecCommand(“ExcludeFlashCacheRange 0x0-0xFFFFFFFF”, …).
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] - 0.003ms returns 0x00
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] JLINK_SetHookUnsecureDialog
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] JLINK_SetHookUnsecureDialog(…)
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] - 0.017ms returns 0
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] JLINK_TIF_Select(JLINKARM_TIF_SWD)
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] - 0.525ms returns 0x00
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] JLINK_SetSpeed(2000)
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] - 0.056ms
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] JLINK_GetSN()
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] - 0.007ms returns 960137168
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-06 13:05:01] [debug] [Backend] - —just_load_core_data
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] JLINK_ExecCommand(“CORESIGHT_SetIndexAHBAPToUse = 0”, …).
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] - 0.004ms returns 0x00
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] JLINK_ExecCommand(“device = Cortex-M33”, …).
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] XML file found at: C:\Program Files (x86)\SEGGER\JLink\JLinkDevices.xml
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] C:\Program Files (x86)\SEGGER\JLink\JLinkDevices.xml evaluated successfully.
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] Device “CORTEX-M33” selected.
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] Device “CORTEX-M33” selected.
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] - 28.247ms returns 0x00
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-06 13:05:01] [debug] [Backend] - read_debug_port_idr
[2021-Feb-06 13:05:01] [debug] [Backend] - read_debug_port_register
[2021-Feb-06 13:05:01] [debug] [Backend] - —just_read_debug_port_register
[2021-Feb-06 13:05:01] [debug] [Backend] - coresight_configure
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] JLINK_CORESIGHT_Configure()
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] - 0.552ms returns 0
[2021-Feb-06 13:05:01] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-06 13:05:01] [debug] [Backend] - —just_select_debug_port_register
[2021-Feb-06 13:05:01] [debug] [Backend] - Select AP 255, DP Bank 0, AP Bank 255
[2021-Feb-06 13:05:01] [ info] [ JLi[2021-Feb-06 13:09:06] [ info] --------------------------------------------------------------------------------
[2021-Feb-06 13:09:06] [ info] nrfjprog --program nrf5340.bin -f NRF53 --sectoranduicrerase --log
[2021-Feb-06 13:09:06] [ info] nrfjprog version 10.12.1
[2021-Feb-06 13:09:06] [ info] --------------------------------------------------------------------------------
[2021-Feb-06 13:09:06] [debug] [ nRF0x0] - open_dll
[2021-Feb-06 13:09:06] [ info] [ nRF0x0] - Load library at C:\Program Files (x86)\Nordic Semiconductor\nrf-command-line-tools\bin\JLINKARM_NRF53_NRFJPROG.dll.
[2021-Feb-06 13:09:06] [ info] [ nRF0x0] - Library loaded, loading member functions.
[2021-Feb-06 13:09:06] [ info] [ nRF0x0] - Member functions succesfully loaded.
[2021-Feb-06 13:09:06] [ info] [Backend] - Logger callback at 0x262020 registered in Segger backend logger.
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] Logger callback at 0x262020 registered in JLink logger.
[2021-Feb-06 13:09:06] [debug] [nRF530x0] - open
[2021-Feb-06 13:09:06] [debug] [Backend] - open_dll
[2021-Feb-06 13:09:06] [ info] [Backend] - No J-Link DLL path was provided. Attempting to auto detect.
[2021-Feb-06 13:09:06] [ info] [Backend] - Load library at C:\Program Files (x86)\SEGGER\JLink\JLinkARM.dll.
[2021-Feb-06 13:09:06] [ info] [Backend] - Library loaded, loading member functions.
[2021-Feb-06 13:09:06] [ info] [Backend] - Member functions succesfully loaded.
[2021-Feb-06 13:09:06] [debug] [Backend] - dll_version
[2021-Feb-06 13:09:06] [ info] [Backend] - Segger dll version 6.88.a loaded.
[2021-Feb-06 13:09:06] [debug] [ nRF0x0] - enum_emu_snr
[2021-Feb-06 13:09:06] [debug] [nRF530x0] - enum_emu_snr
[2021-Feb-06 13:09:06] [debug] [Backend] - is_connected_to_emu
[2021-Feb-06 13:09:06] [debug] [Backend] - enum_emu_snr
[2021-Feb-06 13:09:06] [debug] [Backend] - —just_enum_emu_snr
[2021-Feb-06 13:09:06] [debug] [Backend] - —just_get_num_emus
[2021-Feb-06 13:09:06] [debug] [Backend] - is_connected_to_emu
[2021-Feb-06 13:09:06] [debug] [ nRF0x0] - connect_to_emu_with_snr
[2021-Feb-06 13:09:06] [debug] [nRF530x0] - connect_to_emu_with_snr
[2021-Feb-06 13:09:06] [debug] [Backend] - is_connected_to_emu
[2021-Feb-06 13:09:06] [debug] [Backend] - connect_to_emu_with_snr
[2021-Feb-06 13:09:06] [debug] [Backend] - is_connected_to_emu
[2021-Feb-06 13:09:06] [debug] [Backend] - —just_enum_emu_snr
[2021-Feb-06 13:09:06] [debug] [Backend] - —just_get_num_emus
[2021-Feb-06 13:09:06] [debug] [Backend] - —just_connect_to_emu_with_snr
[2021-Feb-06 13:09:06] [debug] [Backend] - —just_connect_to_emu_without_snr
[2021-Feb-06 13:09:06] [ info] [Backend] - Segger logging enabled.
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] Firmware: J-Link OB-K22-NordicSemi compiled Jan 21 2020 17:33:01
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] Decompressing FW timestamp took 143 us
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] Hardware: V1.00
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] S/N: 960137168
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] OEM: SEGGER
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] Feature(s): RDI, FlashBP, FlashDL, JFlash, GDB
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] TELNET listener socket opened on port 19021
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] WEBSRV Starting webserver
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] WEBSRV Webserver running on local port 19080
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] - 16.619ms returns “O.K.”
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] JLINK_Lock()
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] JLINK_GetHWStatus(…)
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] - 0.184ms returns 0
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] JLINK_ExecCommand(“SetRestartOnClose = 0”, …).
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] - 0.006ms returns 0x01
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] JLINK_ExecCommand(“DisableFlashDL”, …).
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] - 0.004ms returns 0x00
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] JLINK_ExecCommand(“ExcludeFlashCacheRange 0x0-0xFFFFFFFF”, …).
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] - 0.003ms returns 0x00
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] JLINK_SetHookUnsecureDialog
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] JLINK_SetHookUnsecureDialog(…)
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] - 0.018ms returns 0
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] JLINK_TIF_Select(JLINKARM_TIF_SWD)
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] - 0.600ms returns 0x00
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] JLINK_SetSpeed(2000)
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] - 0.069ms
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] JLINK_GetSN()
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] - 0.007ms returns 960137168
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-06 13:09:06] [debug] [Backend] - —just_load_core_data
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] JLINK_ExecCommand(“CORESIGHT_SetIndexAHBAPToUse = 0”, …).
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] - 0.004ms returns 0x00
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] JLINK_ExecCommand(“device = Cortex-M33”, …).
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] XML file found at: C:\Program Files (x86)\SEGGER\JLink\JLinkDevices.xml
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] C:\Program Files (x86)\SEGGER\JLink\JLinkDevices.xml evaluated successfully.
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] Device “CORTEX-M33” selected.
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] Device “CORTEX-M33” selected.
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] - 27.612ms returns 0x00
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-06 13:09:06] [debug] [Backend] - read_debug_port_idr
[2021-Feb-06 13:09:06] [debug] [Backend] - read_debug_port_register
[2021-Feb-06 13:09:06] [debug] [Backend] - —just_read_debug_port_register
[2021-Feb-06 13:09:06] [debug] [Backend] - coresight_configure
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] JLINK_CORESIGHT_Configure()
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] - 0.545ms returns 0
[2021-Feb-06 13:09:06] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
[2021-Feb-06 13:09:06] [debug] [Backend] - —just_select_debug_port_register
[2021-Feb-06 13:09:06] [debug] [Backend] - Select AP 255, DP Bank 0, AP Bank 255
[2021-Feb-06 13:09:06] [ info] [ JLi

@mdoser,

  1. Are you flashing with the shield attached? I have the feeling something goes wrong sometimes with it (some pin conncected on the Cortex header or something?). Can you try without?
  2. How are you flashing the heart rate example? Also with nrfjprog or drag & drop or via west ?

Hello!
I did have the shield attached, however after removing the shield and attempting to flash again via File Explorer drag-and-drop, I still get the same FAIL.txt message, and also when attempting to flash via the nRF command line tools (version 10.12.1) the process abnormally terminates in the same way.
I used the nrf Connect v. 3.6.1 Programmer app to successfully flash the heart rate demo via its drag-and-drop interface - this programmer accepts HEX files, which I believe are not the same format as the .bin files, which I believe are not compatible with this programming utility.
I will next try building the nrf5340.bin file using the Docker image or the SDK directly and flash the device that way. Any other diagnostic ideas would be appreciated - I am currently using Windows 10 , and will also try using Linux instead.
Thanks!

@mdoser I’ve emailed you the HEX version of the same image, and have pinged Nordic as well.

The weird thing is that I also have a board that has the erase error when flashing through drag and drop programming, but that board goes fine through nrfjprog (same version as you have, but on macOS).

@mdoser Nordic noticed this might be due to the readback protection, and running:

nrfjprog --recover

Might work.

Didn’t help getting drag & drop programming back for me, but might solve your issue when flashing with nrfjprog…

I was able to flash this hex file then start the edge-impulse-daemon, and my device was recognized and registered with my project. Looks like my issue has been solved. Thanks!

We’ve now added the .hex file to the firmware download as well, I’m still unsure on why you ran into issues, hopefully Nordic will be able to clear it up!

Hi, I’m also facing the same issue.

I tried with the hex file, but still, it’s not connecting the demon.


In the device manager it showing these ports.

image

System: Windows 10
Tool: Edge Impulse serial daemon v1.13.3

@salmanfarisvp Some things to consider:

  1. Recover the board first: nrfjprog --recover
  2. Flash without any shields attached.
  3. Do you see anything when you run edge-impulse-run-impulse --raw and reset the board?
1 Like

Thanks, @janjongboom, Sorry for the late reply. it was solved. I was running EI CLI same time while trying to connect the WebUSB :relieved:

1 Like

Hi @janjongboom

I have met the similar error.

  1. Recover the board first: nrfjprog --recover
  2. Flash without any shields attached.
  3. Do you see anything when you run edge-impulse-run-impulse --raw and reset the board?

I have done these three steps.
For step 3, I get following message whenever I hit the reset button.

*** Booting Zephyr OS build v2.7.99-ncs1-1  ***
Using flash device: MX25R64
Hello from Edge Impulse Device SDK.
Compiled on May 27 2022 14:14:05

I think this probably means that the file has flashed to the board.

But when I run edge-impulse-daemon , I still get error shown below

Edge Impulse serial daemon v1.19.3
Endpoints:
    Websocket: wss://remote-mgmt.edgeimpulse.com
    API:       https://studio.edgeimpulse.com
    Ingestion: https://ingestion.edgeimpulse.com

? Which device do you want to connect to? COM6 (SEGGER)
[SER] Connecting to COM6
[SER] Serial is connected, trying to read config...
[SER] Failed to get info off device Timeout when waiting for >  (timeout: 5000) onConnected

I tried attached the shiled and without shiled, both give me above error. I am not sure whether I have attached the shiled correctly or not. If the shiled is pushed to deep, some pin below will touch the shiled. If the shiled is not pushed to deep, I am not sure whether the pins from the shiled are connected to the board.

Hello @Yang1991,

You need to attach the shield to use edge-impulse-daemon.
Can you make sure you have this exact version of the shield?
X-NUCLEO-IKS02A1?

Best,

Louis

HI @louis
Thanks for reply. Yes, the version is X-NUCLEO-IKS02A1.
I have uploaded two pictures to show how it looks like.

Another Image for another direction

@louis

Do you know what I should test next?

Hello @Yang1991,

Unfortunately, I have not that board anymore, I’ll check with our embedded team if they can reproduce and find a solution.

Best,

Louis

Hi @Yang1991
It looks like your nRF5340DK is faulty. We are observing in a few cases that external QSPI Flash memory on the nRF5340DK could be broken. Our firmware is using this memory to store the configuration (like sampling rate, sensor type etc.).
We tried to flash our pre-built firmware on a few boards, and there is no issue. Only one board has the same issue, and we confirmed that it’s QSPI Flash is broken.

One thing that you can try is to run the simple example from Zephyr. To do that, first install nRF Connect SDK, then go to the Zephyr directory, build and flash the example:

west build -b nrf5340dk_nrf5340_cpuapp
west flash

Then check on UART if you see a successful test.

Best regards,
Matt

@Yang1991
One more thing, you can try to run the following command (with nRF5340DK connected to your computer):

nrfjprog --qspieraseall

It will take some time and try to erase a whole QSPI memory. Check if it succeed.

Best regards,
Matt

Thanks, I am building this example via VS code and NRF connect plugins.

Image above is the build configuration I used for building.

The build succeeds with following output in the end:

Memory region         Used Size  Region Size  %age Used
           FLASH:       36520 B       960 KB      3.72%
             RAM:        4696 B       480 KB      0.96%
        IDT_LIST:          0 GB         2 KB      0.00%
[253/254] Generating zephyr/tfm_nonsecure.hex
[254/254] Generating zephyr/merged.hex

Then I flash it using VS code as well with following output in the terminal:

Building spi_flash
C:\Windows\system32\cmd.exe /d /s /c "west build --build-dir f:\TAM\NRF_research\first_app\spi_flash\build f:\TAM\NRF_research\first_app\spi_flash"

[0/20] Performing build step for 'tfm'
ninja: no work to do.
 *  Terminal will be reused by tasks, press any key to close it. 

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

Flashing build to 1050019043
C:\Windows\system32\cmd.exe /d /s /c "west flash -d f:\TAM\NRF_research\first_app\spi_flash\build --skip-rebuild --dev-id 1050019043"

-- west flash: using runner nrfjprog
-- runners.nrfjprog: Flashing file: f:\TAM\NRF_research\first_app\spi_flash\build\zephyr\merged.hex
[ #################### ]   3.326s | Erase file - Done erasing                                                          
[ #################### ]   0.611s | Program file - Done programming                                                    
[ #################### ]   0.502s | Verify file - Done verifying                                                       
Applying pin reset.
-- runners.nrfjprog: Board with serial number 1050019043 flashed successfully.

Then I run edge-impulse-run-impulse --raw and press reset button when connected, I got following output.

edge-impulse-run-impulse --raw
Edge Impulse impulse runner v1.19.3
? Which device do you want to connect to? COM6 (SEGGER)
[SER] Connecting to COM6
[SER] Connected to COM6
*** Booting Zephyr OS build v3.3.99-ncs1 ***

mx25r6435f@0 SPI flash testing
==========================

Perform test on single sector
Test 1: Flash erase
Flash erase succeeded!

Test 2: Flash write
Attempting to write 4 bytes
Data read matches data written. Good!!

Does this mean that the QSPI Flash memory is not faulty?

I have also run this command, output is shown below:

nrfjprog --qspieraseall
WARNING: An operation that can take up to several minutes is being executed.
WARNING: Please remain patient.
Initializing the QSPI peripheral.
Erasing.
Uninitializing the QSPI peripheral.