Cannot consistently flash my custom nrf5340 board and logging does not always work either

I am having problems flashing my custom board with a nrf5340 chip. Sometimes it works, sometimes it does not, but more often than not it doesn't work and I cannot figure out why. It also doesn't log consistently.

First, I do a pristine build with code which has worked. Then I try and flash and see this in the console:



I have run it from the command line as well and get the log (as it recommends). It was recommeded that I try recover so I ran this command: nrfjprog --recover --log and saw this in the terminal:

I try to reflash from the VS Code Add-In where it command exited with status 33:


 Sometimes I get this with a command exited with status 25:


I run this but it doesn't seem to work:


Twice after trying this for a while and gtiving it a break I will flash it and it will take. I don't see the logging but eventually that starts as well.

My prj.conf looks like this:


My sysboot.conf:


Parents
  • Hello,

    The errors and behavior indicates that the communication between the debug probe and target is unstable. What kind of Jlink debugger are you using, is it the on-board debugger on one of our development kits, or a standalone Jlink programmer? 

    I run this but it doesn't seem to work:

    Please ensure you recover the network core first. Ref.

    https://docs.nordicsemi.com/bundle/ncs-2.6.1/page/nrf/device_guides/working_with_nrf/nrf53/nrf5340.html#readback_protection 

    Best regards,

    Vidar

  • I'm using a jlink plus compact.

    I'm not sure I solved the problem because I have another problem, but I do seem to be able to flash it consistently. However, my ble_enable now gives me a -11.

  • Thanks for confirming. 

    I'm not sure I solved the problem because I have another problem, but I do seem to be able to flash it consistently. However, my ble_enable now gives me a -11.

    -11 corresponds to -EAGAIN ("try again") and it usually indicates that the host is unable to communicate with the Bluetooth controller on the network core. Does the terminal log show that both cores are being programmed? I.e., merged.hex and merged_CPUNET.hex

  • It doesn't look like it. This seems to be the command I see:

    Previously it looked like:

    and at the end it had:

    I must have changed something accidentially in the configuration or something.

  • It is only programming the application core because of the "--domain blinky_custom_board " argument passed to west flash. To ensure both cores are programmed, you must select the "build context" before clicking on "Flash"

Reply
  • It is only programming the application core because of the "--domain blinky_custom_board " argument passed to west flash. To ensure both cores are programmed, you must select the "build context" before clicking on "Flash"

Children
  • Ok. Thank you.

    Back to the main issue, it seemed to flash this time. Let me try a few times and on the other board.