It seems the "reset" button on my nrf52840dk doesn't do anything anymore. I believe this started happening after I enabled mcuboot in sysbuild. Is this expected?
It seems the "reset" button on my nrf52840dk doesn't do anything anymore. I believe this started happening after I enabled mcuboot in sysbuild. Is this expected?
Hi,
The reset pin is enabled by default for the nRF52840 DK in the uicr node in the devicetree. Have you modified or deleted this node in your board overlay files?
You can check the build devicetree file in the your build folder: build\<image_name>\zephyr\zephyr.dts. You might want to check both the application and the mcuboot image.
Once programmed, the UICR will be written by the application to enable the nRESET pin. You can check that this has been enabled correctly by reading out this registers using the debugger:
nrfjprog --memrd 0x10001200 nrfjprog --memrd 0x10001204
If nRESET is enabled correctly, the registers should read 0x00000012.
Best regards,
Jørgen
Actually, I just noticed that I can't flash anymore the DK whose reset button has stopped working.
* Executing task: nRF Connect: Flash: firmware/build_dk (active) Flashing build_dk to 1050227950 west flash -d /Users/redacted/code/alpha21/keyvo/firmware/build_dk --dev-id 1050227950 -- west flash: rebuilding [0/10] Performing build step for 'mcuboot' ninja: no work to do. [1/10] Performing build step for 'firmware' ninja: no work to do. [4/10] cd /Users/redacted/code/alpha21/keyvo/firmware/build_dk/_sysbuild && /opt/nordic/ncs/toolchains/b8efef2ad5/Cellar/cmake/3.21.0/bin/cmake -E true [6/10] No install step for 'firmware' [7/10] Completed 'firmware' [8/10] cd /Users/redacted/code/alpha21/keyvo/firmware/build_dk/_sysbuild && /opt/nordic/ncs/toolchains/b8efef2ad5/Cellar/cmake/3.21.0/bin/cmake -E true -- west flash: using runner nrfjprog -- runners.nrfjprog: reset after flashing requested -- runners.nrfjprog: Flashing file: /Users/redacted/code/alpha21/keyvo/firmware/build_dk/merged.hex [error] [ Client] - Encountered error -102: Command read_device_info executed for 131 milliseconds with result -102 [error] [ Worker] - An unknown error. [error] [ Client] - Encountered error -102: Command read_memory_descriptors executed for 29 milliseconds with result -102 Failed to read device memories. [error] [ Worker] - An unknown error. ERROR: JLinkARM DLL reported an error. Try again. If error condition ERROR: persists, run the same command again with argument --log, contact Nordic ERROR: Semiconductor and provide the generated log.log file to them. NOTE: For additional output, try running again with logging enabled (--log). NOTE: Any generated log error messages will be displayed. FATAL ERROR: command exited with status 33: nrfjprog --program /Users/redacted/code/alpha21/keyvo/firmware/build_dk/merged.hex --sectoranduicrerase --verify -f NRF52 --snr 1050227950 * The terminal process terminated with exit code: 33. * Terminal will be reused by tasks, press any key to close it.
I tried the nrfjprog commands you suggested and it works on one of my DKs but doesn't work on the DK whose reset button stopped working:
$ nrfjprog --ids 1050227950 # dk with reset button issue: $ nrfjprog --memrd 0x10001200 [error] [ Client] - Encountered error -102: Command connect_to_emu_with_snr executed for 599 milliseconds with result -102 ERROR: Unable to connect to a debugger. [error] [ Worker] - An unknown error. ERROR: JLinkARM DLL reported an error. Try again. If error condition ERROR: persists, run the same command again with argument --log, contact Nordic ERROR: Semiconductor and provide the generated log.log file to them. NOTE: For additional output, try running again with logging enabled (--log). NOTE: Any generated log error messages will be displayed. $ nrfjprog --ids master ✗ 1050210565 # dk with no reset button issue: $ nrfjprog --memrd 0x10001200 master ✗ 0x10001200: 00000012 |....|
I have not modified uicr in overlay files and have another DK that I flashed with same image which doesn't have the issue.
Any idea what might have caused this and how to fix it? Did I somehow brick the board? The MCU is still working fine and the board looks fine too. Interface MCU led is green. My application is running. I can even connect to SMB server using nordic Device Manager app. I tried clicking the "factory reset" button but it didn't seem to do anything.
Did you modify the DK in any way? E.g., change switch positions, cut/solder solder-bridges, etc? Please provide a picture of the DK if possible.
Are you able to recover the DK? (nrfjprog --recover)
If you have a 10-pin SWD cable available, could you try to connect that from the "Debug out" port on the working DK to the "Debug in" port of the DK where the reset pin does not work and run the above recover command? (select the serial number of the working DK when prompted).
Did you modify the DK in any way? E.g., change switch positions, cut/solder solder-bridges, etc? Please provide a picture of the DK if possible.
Are you able to recover the DK? (nrfjprog --recover)
If you have a 10-pin SWD cable available, could you try to connect that from the "Debug out" port on the working DK to the "Debug in" port of the DK where the reset pin does not work and run the above recover command? (select the serial number of the working DK when prompted).
I don't have a SWD cable but I have a SEGGER J-Link and tried to use it for flashing by connecting it to the debug in but got a similar error:
[error] [ JLink] - Communication timed out: Requested 4 bytes, received -1 bytes ! [error] [ Client] - Encountered error -12: Command read_device_info executed for 31 milliseconds with result -12 [error] [ Client] - Encountered error -2: Command read_memory_descriptors executed for 6 milliseconds with result -2 Failed to read device memories. [error] [ Worker] - Low voltage 0 detected in target device. [error] [ Worker] - Cannot call read_access_port_register when connect_to_emu_without_snr or connect_to_emu_with_snr has not been called. ERROR: Requested operation is currently unavailable. ERROR: Check logs for more details. NOTE: For additional output, try running again with logging enabled (--log). NOTE: Any generated log error messages will be displayed. FATAL ERROR: command exited with status 66: nrfjprog --program /Users/redacted/code/alpha21/keyvo/firmware/build_dk/merged.hex --chiperase --verify -f NRF52 --snr 802000342
I didn't not modify the DK in any way and I believe all the switches are in the correct position.
$ nrfjprog --recover master ✗ [error] [ Client] - Encountered error -102: Command connect_to_emu_with_snr executed for 601 milliseconds with result -102 ERROR: Unable to connect to a debugger. [error] [ Worker] - An unknown error. ERROR: JLinkARM DLL reported an error. Try again. If error condition ERROR: persists, run the same command again with argument --log, contact Nordic ERROR: Semiconductor and provide the generated log.log file to them. NOTE: For additional output, try running again with logging enabled (--log). NOTE: Any generated log error messages will be displayed.
After trying again with the j-link debugger (I found out I also had to keep the DK's usb plugged in for power), I was able to run `nrfjprog --recover` and flash it.
After running `nrfjprog --recover` using segger:
$ nrfjprog --recover master ✗ Recovering device. This operation might take 30s. Erasing user code and UICR flash areas. Writing image to disable ap protect. $ nrfjprog --memrd 0x10001200 master ✗ 0x10001200: FFFFFFFF |....|
Unfortunately, even after recovering, if I try to build with the onboard debugger afterwards, it still fails:
Flashing build_dk to 1050227950 west flash -d .../firmware/build_dk --dev-id 1050227950 --erase -- west flash: rebuilding [0/10] Performing build step for 'mcuboot' ninja: no work to do. [1/10] Performing build step for 'firmware' ninja: no work to do. [4/10] cd .../firmware/build_dk/_sysbuild && /opt/nordic/ncs/toolchains/b8efef2ad5/Cellar/cmake/3.21.0/bin/cmake -E true [6/10] No install step for 'firmware' [7/10] Completed 'firmware' [8/10] cd .../firmware/build_dk/_sysbuild && /opt/nordic/ncs/toolchains/b8efef2ad5/Cellar/cmake/3.21.0/bin/cmake -E true -- west flash: using runner nrfjprog -- runners.nrfjprog: mass erase requested -- runners.nrfjprog: reset after flashing requested -- runners.nrfjprog: Flashing file: .../firmware/build_dk/merged.hex [error] [ Client] - Encountered error -102: Command read_device_info executed for 126 milliseconds with result -102 [error] [ Worker] - An unknown error. [error] [ Client] - Encountered error -102: Command read_memory_descriptors executed for 25 milliseconds with result -102 Failed to read device memories. [error] [ Worker] - An unknown error. ERROR: JLinkARM DLL reported an error. Try again. If error condition ERROR: persists, run the same command again with argument --log, contact Nordic ERROR: Semiconductor and provide the generated log.log file to them. NOTE: For additional output, try running again with logging enabled (--log). NOTE: Any generated log error messages will be displayed. FATAL ERROR: command exited with status 33: nrfjprog --program .../firmware/build_dk/merged.hex --chiperase --verify -f NRF52 --snr 1050227950 * The terminal process terminated with exit code: 33. * Terminal will be reused by tasks, press any key to close it.
But flashing using segger works. So it seems there is an issue with the onboard debugger?
After flashing my firmware with segger:
-- west flash: using runner nrfjprog -- runners.nrfjprog: mass erase requested -- runners.nrfjprog: reset after flashing requested -- runners.nrfjprog: Flashing file: /Users/redacted/code/alpha21/keyvo/firmware/build_dk/merged.hex [ #################### ] 0.216s | Erase file - Done erasing [ #################### ] 1.919s | Program file - Done programming [ #################### ] 1.996s | Verify file - Done verifying Enabling pin reset. Applying pin reset. -- runners.nrfjprog: Board with serial number 802000342 flashed successfully.
It seems, the nRESET register is correct:
$ nrfjprog --memrd 0x10001200; nrfjprog --memrd 0x10001204 master ✗ 0x10001200: 00000012 |....| 0x10001204: 00000012 |....|
When I connect to the onboard debugger, I still see VCOM0 and VCOM1 and application logs when I connect to VCOM0. Clicking the "Reset" button is not rebooting the MCU though.
Is the "Reset" button not working issue related to the issue with flashing using the onboard debugger? I am guessing there is a link between both issue but not sure what it is.
Sounds like there could be a problem with the firmware running on the debugger chip. By default, the reset button is not connected directly to the nRF54L15 chip (SB1 is open):
The button connects to the DBGR_RESET input on the debugger chip, which will trigger a reset of the nRF54L15 chip on the DK.
Can you try to install a newer version of J-Link, start J-Link Configuration, select the debugger and click "Update firmware of selected probes and programmers"?
Best regards,
Jørgen