zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.48k stars 6.41k forks source link

nrf53: nrf5340dk_nrf5340_cpunet not executing. #34469

Closed Mattemagikern closed 3 years ago

Mattemagikern commented 3 years ago

Describe the bug Received my nrf53 a couple of days ago. After testing it for a day I attached a debugger to it to solve ble problem, after I detached the debugger, I was unable to flash the board again.

$ nrfjprog -f NRF53 --sectorerase --program build/zephyr/zephyr.hex --coprocessor CP_NETWORK --reset
Parsing image file.
ERROR: The operation attempted is unavailable due to readback protection in
ERROR: your device. Please use --recover to unlock the device.
exit status 16

This issue was solved by a tip in the zephyr slack channel by executing:

nrfjprog  --recover --coprocessor CP_NETWORK
nrfjprog  --recover

However after this I'm able to flash the device but the network cpu dosn't seem to be executing any code. I'm not able to see any output from ACM0,ACM1,ACM2 when flashing the network cpu. But I do get output If I flash the application CPU. I'm not sure where to go from here.

To Reproduce Steps to reproduce the behavior:

  1. west build zephyr/samples/hello_world -b nrf5340dk_nrf5340_cpuapp && west flash
  2. See output in /dev/ttyACM2
  3. rm -rf build && west build zephyr/samples/hello_world -b nrf5340dk_nrf5340_cpunet && west flash
  4. No output in any of the nrf com ports.

Expected behavior I expect to see:

*** Booting Zephyr OS build zephyr-v2.5.0-2332-g10fc05ced659  ***
Hello World! nrf5340dk_nrf5340_cpuapp

and

*** Booting Zephyr OS build zephyr-v2.5.0-2332-g10fc05ced659  ***
Hello World! nrf5340dk_nrf5340_cpunet

from the device.

Environment (please complete the following information):

jfischer-no commented 3 years ago

You need to build and flash a cpuapp firmware with BOARD_ENABLE_CPUNET enabled:

west build samples/hello_world -b nrf5340dk_nrf5340_cpuapp -- -DCONFIG_BOARD_ENABLE_CPUNET
west flash
rm build -r
west build samples/hello_world -b nrf5340dk_nrf5340_cpunet && west flash

You should see cpuapp output on /dev/ttyACM2 and cpunet output on /dev/ttyACM0.