Not able to upload binaries to nRF5340-DK board

I am new to RIOT OS. Recently, I tried to use Arduino nano 33 BLE sense and nRF5340-DK boards to give a try to RIOT example projects.

I was able to program the Arduino nano 33 with hello_world application but the nRF5340-DK didn’t work.

The output of nrfjprog -v is the following

nrfjprog version: 10.12.1 JLinkARM.dll version: 6.99b

While trying to flash the board with

*make BOARD=nrf52840dk -C examples/myapp flash*

I get the error

× Flashing failed! (programmer: 'jlink' - duration: 4.02s)

    × Flashing failed! (programmer: 'jlink' - duration: 4.02s)
### Flashing Target ###
### Flashing at base address 0x0 with offset 0 ###
SEGGER J-Link Commander V6.99b (Compiled Mar 26 2021 16:31:39)
DLL version V6.99b, compiled Mar 26 2021 16:31:24

J-Link Commander will now exit on Error

J-Link Command File read successfully.
Processing script file...

J-Link connection not established yet but required for command.
Connecting to J-Link via USB...O.K.
Firmware: J-Link OB-K22-NordicSemi compiled Feb  2 2021 16:48:58
Hardware version: V1.00
S/N: 960128362
License(s): RDI, FlashBP, FlashDL, JFlash, GDB
VTref=3.300V
Target connection not established yet but required for command.
Device "NRF52" selected.


Connecting to target via SWD
InitTarget() start
InitTarget() end
Found SW-DP with ID 0x6BA02477
DPIDR: 0x6BA02477
Scanning AP map to find all available APs
AP[4]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x84770001)
AP[1]: AHB-AP (IDR: 0x84770001)
AP[2]: JTAG-AP (IDR: 0x12880000)
AP[3]: JTAG-AP (IDR: 0x12880000)
Iterating through AP map to find AHB-AP to use
AP[0]: Skipped. Could not read CPUID register
AP[1]: Skipped. Could not read CPUID register
AP[2]: Skipped. Not an AHB-AP
AP[3]: Skipped. Not an AHB-AP
InitTarget() start
InitTarget() end
Found SW-DP with ID 0x6BA02477
DPIDR: 0x6BA02477
Scanning AP map to find all available APs
AP[4]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x84770001)
AP[1]: AHB-AP (IDR: 0x84770001)
AP[2]: JTAG-AP (IDR: 0x12880000)
AP[3]: JTAG-AP (IDR: 0x12880000)
Iterating through AP map to find AHB-AP to use
AP[0]: Skipped. Could not read CPUID register
AP[1]: Skipped. Could not read CPUID register
AP[2]: Skipped. Not an AHB-AP
AP[3]: Skipped. Not an AHB-AP

****** Error: Could not find core in Coresight setup

InitTarget() start
InitTarget() end
Found SW-DP with ID 0x6BA02477
DPIDR: 0x6BA02477
Scanning AP map to find all available APs
AP[4]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x84770001)
AP[1]: AHB-AP (IDR: 0x84770001)
AP[2]: JTAG-AP (IDR: 0x12880000)
AP[3]: JTAG-AP (IDR: 0x12880000)
Iterating through AP map to find AHB-AP to use
AP[0]: Skipped. Could not read CPUID register
AP[1]: Skipped. Could not read CPUID register
AP[2]: Skipped. Not an AHB-AP
AP[3]: Skipped. Not an AHB-AP
InitTarget() start
InitTarget() end
Found SW-DP with ID 0x6BA02477
DPIDR: 0x6BA02477
Scanning AP map to find all available APs
AP[4]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x84770001)
AP[1]: AHB-AP (IDR: 0x84770001)
AP[2]: JTAG-AP (IDR: 0x12880000)
AP[3]: JTAG-AP (IDR: 0x12880000)
Iterating through AP map to find AHB-AP to use
AP[0]: Skipped. Could not read CPUID register
AP[1]: Skipped. Could not read CPUID register
AP[2]: Skipped. Not an AHB-AP
AP[3]: Skipped. Not an AHB-AP

****** Error: Could not find core in Coresight setup

Cannot connect to target.

Script processing completed.

@moderators maybe fix formatting?

How did you connect the nrf52840 to your machine? Have you checked, if the connection is correct? Have you tried to flashed an example provided by Nordic? Did you connect power to the board? As I remember there is also a switch for battery/USB. Check, if the correct mode is selected. If everything is fine, you might want to try an external J-Link, if you have one. In case everything is correct and it still doesn’t work, you may want to try a recoverr.

1 Like

Hi @citrullin,

Thanks for your reply. I have checked that the board is connected properly and the switch for power and power source is set correctly. The nrfjprog --recover might have worked as given on the recover page. but I again got a new error.

× Flashing failed! (programmer: ‘jlink’ - duration: 7.02s)

Flashing Target

Flashing at base address 0x0 with offset 0

SEGGER J-Link Commander V6.99b (Compiled Mar 26 2021 16:31:39) DLL version V6.99b, compiled Mar 26 2021 16:31:24

J-Link Commander will now exit on Error

J-Link Command File read successfully. Processing script file…

J-Link connection not established yet but required for command. Connecting to J-Link via USB…O.K. Firmware: J-Link OB-K22-NordicSemi compiled Feb 2 2021 16:48:58 Hardware version: V1.00 S/N: 960128362 License(s): RDI, FlashBP, FlashDL, JFlash, GDB VTref=3.300V Target connection not established yet but required for command. Device “NRF52” selected.

Connecting to target via SWD InitTarget() start InitTarget() end Found SW-DP with ID 0x6BA02477 DPIDR: 0x6BA02477 Scanning AP map to find all available APs AP[4]: Stopped AP scan as end of AP map has been reached AP[0]: AHB-AP (IDR: 0x84770001) AP[1]: AHB-AP (IDR: 0x84770001) AP[2]: JTAG-AP (IDR: 0x12880000) AP[3]: JTAG-AP (IDR: 0x12880000) Iterating through AP map to find AHB-AP to use AP[0]: Core found AP[0]: AHB-AP ROM base: 0xE00FE000 CPUID register: 0x410FD214. Implementer code: 0x41 (ARM) Found Cortex-M33 r0p4, Little endian. Identified core does not match configuration. (Found: Cortex-M33, Configured: Cortex-M4) FPUnit: 8 code (BP) slots and 0 literal slots Security extension: implemented Secure debug: enabled CoreSight components: ROMTbl[0] @ E00FE000 ROMTbl[0][0]: E00FF000, CID: B105100D, PID: 000BB4C9 ROM Table ROMTbl[1] @ E00FF000 ROMTbl[1][0]: E000E000, CID: B105900D, PID: 000BBD21 Cortex-M33 ROMTbl[1][1]: E0001000, CID: B105900D, PID: 000BBD21 DWT ROMTbl[1][2]: E0002000, CID: B105900D, PID: 000BBD21 FPB ROMTbl[1][3]: E0000000, CID: B105900D, PID: 000BBD21 ITM ROMTbl[1][5]: E0041000, CID: B105900D, PID: 002BBD21 ETM ROMTbl[1][6]: E0042000, CID: B105900D, PID: 000BBD21 CSS600-CTI ROMTbl[0][1]: E0040000, CID: B105900D, PID: 000BBD21 Cortex-M33 Cortex-M33 identified. Halting CPU for downloading file. Downloading file [/home/ujjval/RIOT/examples/hello-world/bin/nrf52840dk/hello-world.bin]…

****** Error: Timeout while preparing target, RAMCode did not respond in time. (PC = 0xFFFFFFFF, CPSR = 0xFFFFFFFF, LR = 0x01000003)! Failed to prepare RAMCode using RAM Unspecified error -1

Script processing completed.

make: *** [/home/ujjval/RIOT/examples/hello-world/…/…/Makefile.include:726: flash] Error 1 make: Leaving directory ‘/home/ujjval/RIOT/examples/hello-world’

Are you sure your board is an nrf52840dk and not a nrf5340dk ?

1 Like

Sorry, It is nRF5340-DK! :sneezing_face: :zipper_mouth_face:

I changed the title of the topic. The MCU isn’t supported yet. I added it to the list of unsupported MCUs.