NRF5340 Seems to flash, but fails to debug using VSC

Hello,

I am having issues debugging my nRF5340 chip using VS code. When I flash, there is no indication that it fails from the console. When I try to debug however, my debugger launches but is always paused. When I try to step through or step out, I get an error saying "Unable to step out. Operation failed with error code 0x80004004."

A few notes on what I've tried:

  • Using SDK version 2.2.0
  • Verified that my chip is receiving 3 volts
  • Different combinations of the following in my prj.conf:
    • CONFIG_DEBUG_OPTIMIZATIONS=y
    • CONFIG_DEBUG_THREAD_INFO=y
    • CONFIG_BOARD_ENABLE_CPUNET=y
    • CONFIG_UART_CONSOLE=n
  • Using different projects
    • One given to us from the distributor, and the "empty_app_core" sample.
  • Using a separate dev kit

One additional thing to note, I have to erase flash memory every time I try to flash. There's an error that says "Flashing failed due to protection on the device.". I'm not convinced that this is my issue, as using the Programmer tool in nRF connect shows that the memory is no longer protected after having erased flash. The error also goes away when I try to debug after erasing. It comes back however if I reboot the kit.

Since I'm using VSC, I don't know how to use --restore in the command line for west. I also haven't found out how to use something similar in my config files.

Info on the kit I'm using (LN60E40F):

https://www.fanstel.com/ln60e40f

Thank you

Related