Debugging fails on nRF5340 after flashing firmware

Hello!

I have designed a custom board with the nRF5340, powered at 1.8V. I am able to program the chip successfully, but after the firmware is downloaded (Zephyr RTOS, programmed with Nordic SDK: v2.5.0, Toolchain: v2.5.0), the nRF5340 becomes unresponsive, and I can’t debug or reprogram it without doing a full chip erase. Once I erase the full chip , I am able to reprogram it, but debugging still fails with the following error:

"ERROR: Unexpected GDB output from command "-exec-next". Cannot find bounds of current function". 

I suspected that APPROTECT or SECUREAPPROTECT might be causing the issue, so I tried disabling them via the command line:


nrfjprog --memwr 0x00FF8000 --val 0x50FA50FA --snr 801050626
nrfjprog --memwr 0x00FF801C --val 0x50FA50FA --snr 801050626nrfjprog --memrd 0x00FF8000 --n 4 --snr 801050626
#output: 0x00FF8000: 50FA50FAnrfjprog --memrd 0x00FF801C --n 4 --snr 801050626
#output: 0x00FF801C: 50FA50FA

The UICR values confirm that both protections are disabled, but the issue persists. After programming, the chip locks up again and requires a full erase before I can flash it. Debugging continues to fail regardless.

Anyone have any ideas what might be causing this?

Cheers,

Parker

  • I would suggest you flash the image in the nRF5340 DK and see if you have similar issue. If you do have similar issue, then something is wrong with the image which might be making the boot process crash pretty early not giving the debugger enough time to plug and halt the CPU. 

    If you do not have the same issue on the DK, then there is something on your hardware that we need to look into. Check of you have selected all clocks configurations in the software to match your hardware.

  • Thank you for your response, Susheel.
    The firmware is working well on the nRF5340 DK. The issue appears to be specific to my custom hardware. I based my design on the nrf5340_claa_config4 reference from the nrf5340-xxaa-reference-layout-1_2.zip.
    I would appreciate your help in debugging this issue.

  • Sorry for late response Parker, If you have used the reference layout as is then it should have worked since thousands of other designs are using the same reference layout and have been successfully working with the development of their custom boards. If there are any modifications (however minor) it would help if you could upload your schematics and layout files here and in short write to us what difference you made on your custom board with respect to the reference design and we can do a review of your design. 

  • Hi Susheel,

    Thank you very much for your response.

    You can find the design files here:
    github.com/.../nRF534_CamV8

    And the debug logs are available here:
    github.com/.../DebugLog

    We are using the following pins to interface with the HM01B0 camera:
    P0.6, P0.25, P0.26, P0.27, P1.01, P1.02, P1.03, P1.04, P1.05, P1.11

    For the two I2C sensors, we are using:
    P0.3, P0.5, P0.23, P0.28

    The board has been fabricated on an FPC substrate.

    I am able to flash the nRF5340 successfully, but after a power-on reset, the chip appears to get locked. I tried running a simple blinky program to toggle pins P0.3 and P0.5, but there is no response — the pins are not toggling.

    Thank you for the support.

Related