Cannot flash onto a nRF52832 QFAB custom board via a nRF52-DK

I have a custom board with a nRF52832 QFAB at its center, and I want to program it via a nRF52-DK. I have created a custom board directory and have initialized a few led pins on it using the description in the tutorial. I am also using the nRF Connect Extension for VS Code. I added a CONFIG_SECURE_BOOT=y, and am using the extension to build and flash onto the board. When I try to flash it, I get the following error. This happens whether or not I erase and flash or just simply flash.

-- west flash: using runner nrfjprog
-- runners.nrfjprog: reset after flashing requested
-- runners.nrfjprog: Flashing file: c:\ncs\blinky_evoke\build_4\zephyr\merged.hex
[ #################### ]   1.723s | Erase file - Done erasing                                                          
[error] [ Client] - Encountered error -102: Command program_file executed for 628 milliseconds with result -102        
[error] [  nRF52] - The write access failed, but no cause could be determined.
[error] [  nRF52] - It may be due to an unaligned access, accessing a nonexistent memory, or a communication issue.
[error] [  nRF52] - Failed while performing 'Write' operation on target address 0x00000000. 
-102: An unknown error.
[error] [  nRF52] - Failed while reading device information.
[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 'c:\ncs\blinky_evoke\build_4\zephyr\merged.hex' --sectoranduicrerase --verify -f NRF52 --snr 1050398990

I get a similar error when I connect the board using the nRF connect for desktop programmer app.

13:08:25.932	Initialising nrfutil module: device
13:08:33.170	Using nrfutil-device core version: 7.13.0
13:08:34.329	Using nrfutil-device version: 2.1.1
13:08:34.329	Using nrf-device-lib version: 0.17.5
13:08:34.330	Using nrfjprog DLL version: 10.24.0
13:08:34.331	Using JLink version: JLink_V7.96e
13:08:34.331	Installed JLink version does not match the expected version (JLink_V7.94e)
13:08:34.917	Getting serialport options from persistent store 001050398990.pc-nrfconnect-programmer
13:08:39.583	Error: Failed with exit code 1. Failed to device info one or more devices: * 1050398990: [jlink] JLINKARM_DLL_ERROR, code: Nrfjlink. Message: Operation device-info failed, [jlink] JLINKARM_DLL_ERROR.
13:08:39.587	Using nrfutil device to communicate with target via JLink
13:08:43.617	Reading readback protection status for Application core
13:08:43.619	Failed "reading readback protection status for application core". Error: code: 9, description: Nrfjlink, message: Batch task protection-get failed, [jlink] JLINKARM_DLL_ERROR
13:08:43.901	Error: Failed with exit code 1. One or more batch tasks failed: - [jlink] JLINKARM_DLL_ERROR, code: Nrfjlink. Message: Batch task protection-get failed, [jlink] JLINKARM_DLL_ERROR.
13:08:43.902	Error: Failed with exit code 1. One or more batch tasks failed: - [jlink] JLINKARM_DLL_ERROR, code: Nrfjlink. Message: Batch task protection-get failed, [jlink] JLINKARM_DLL_ERROR.

The log.log  contains this 

[2024-Jul-03 12:43:27] [debug] --------------------------------------------------------------------------------
[2024-Jul-03 12:43:27] [debug] C:\Program Files\Nordic Semiconductor\nrf-command-line-tools\bin\nrfjprog.exe --family NRF52 --program merged.hex --chiperase --log 
[2024-Jul-03 12:43:27] [debug] nrfjprog version 10.24.2 external
[2024-Jul-03 12:43:27] [debug] --------------------------------------------------------------------------------
[2024-Jul-03 12:43:27] [ info] Load library at C:\Program Files\Nordic Semiconductor\nrf-command-line-tools\bin\nrfjprog.dll.
[2024-Jul-03 12:43:27] [ info] Library loaded, loading member functions.
[2024-Jul-03 12:43:27] [ info] Member functions succesfully loaded.
[2024-Jul-03 12:43:27] [debug] [ Client] - open
[2024-Jul-03 12:43:27] [debug] [ Client] - start
[2024-Jul-03 12:43:27] [ info] [ Client] - stdout: Jlinkarm nRF Worker ready. Handling sequence 3e50e784-bf23-424d-bc2f-d8baf62cd201.

[2024-Jul-03 12:43:27] [debug] [SeggerBackend] - Logger sink registered in Segger backend logger
[2024-Jul-03 12:43:27] [debug] [  JLink] - Logger sink registered in JLink logger
[2024-Jul-03 12:43:27] [debug] [  nRF52] - open
[2024-Jul-03 12:43:27] [debug] [  nRF52] - just_check_family
[2024-Jul-03 12:43:27] [debug] [SeggerBackend] - open_dll
[2024-Jul-03 12:43:27] [debug] [SeggerBackend] - No J-Link DLL path was provided. Attempting to auto detect.
[2024-Jul-03 12:43:27] [ info] [SeggerBackend] - Load library at C:\Program Files\SEGGER\JLink_V796e\JLink_x64.dll.
[2024-Jul-03 12:43:27] [trace] [ Client] - Command open executed for 95 milliseconds with result 0
[2024-Jul-03 12:43:27] [debug] [ Client] - config
[2024-Jul-03 12:43:27] [ info] [SeggerBackend] - Library loaded, loading member functions.
[2024-Jul-03 12:43:27] [trace] [ Client] - Command config executed for 14 milliseconds with result 0
[2024-Jul-03 12:43:27] [ info] [SeggerBackend] - Member functions succesfully loaded.
[2024-Jul-03 12:43:27] [debug] [ Client] - enum_emu_snr
[2024-Jul-03 12:43:27] [debug] [SeggerBackend] - Set batch mode
[2024-Jul-03 12:43:27] [debug] [SeggerBackend] - dll_version
[2024-Jul-03 12:43:27] [ info] [SeggerBackend] - Segger dll version 7.96.e loaded.
[2024-Jul-03 12:43:27] [trace] [ Worker] - Command open executed for 12 milliseconds with result 0
[2024-Jul-03 12:43:27] [debug] [  nRF52] - config
[2024-Jul-03 12:43:27] [debug] [SeggerBackend] - enum_emu_snr
[2024-Jul-03 12:43:27] [trace] [ Worker] - Command config executed for 10 milliseconds with result 0
[2024-Jul-03 12:43:28] [debug] [  nRF52] - enum_emu_con_info
[2024-Jul-03 12:43:28] [trace] [ Client] - Command enum_emu_con_info executed for 15 milliseconds with result 0
[2024-Jul-03 12:43:28] [debug] [SeggerBackend] - is_connected_to_emu
[2024-Jul-03 12:43:28] [debug] [SeggerBackend] - enum_emu_con_info
[2024-Jul-03 12:43:28] [debug] [SeggerBackend] - is_connected_to_emu
[2024-Jul-03 12:43:28] [trace] [ Worker] - Command enum_emu_con_info executed for 5 milliseconds with result 0
[2024-Jul-03 12:43:28] [debug] [  nRF52] - close
[2024-Jul-03 12:43:28] [debug] [SeggerBackend] - is_connected_to_emu
[2024-Jul-03 12:43:28] [debug] [SeggerBackend] - close
[2024-Jul-03 12:43:28] [debug] [SeggerBackend] - disconnect_from_emu
[2024-Jul-03 12:43:28] [debug] [SeggerBackend] - is_connected_to_emu
[2024-Jul-03 12:43:28] [debug] [SeggerBackend] - Segger Backend closed.
[2024-Jul-03 12:43:28] [debug] [  nRF52] - nRF family DLL closed
[2024-Jul-03 12:43:28] [trace] [ Worker] - Command close executed for 18 milliseconds with result 0
[2024-Jul-03 12:43:28] [trace] [ Client] - Command close executed for 27 milliseconds with result 0
[2024-Jul-03 12:43:28] [debug] [ Client] - terminate
[2024-Jul-03 12:43:28] [trace] [ Client] - Command terminate executed for 0 milliseconds with result 0
[2024-Jul-03 12:43:28] [trace] [ Worker] - Command terminate executed for 0 milliseconds with result 0
[2024-Jul-03 12:43:28] [trace] [ Worker] - Executed 5 commands for 45 milliseconds
[2024-Jul-03 12:43:28] [debug] [ Client] - Worker process exited with code: 0
[2024-Jul-03 12:43:28] [debug] [ Client] - Worker process exited with code: 0
[2024-Jul-03 12:43:28] [debug] [ Client] - Child process terminated with result 0
[2024-Jul-03 12:43:28] [trace] [ Client] - Executed 5 commands for 151 milliseconds
[2024-Jul-03 12:43:28] [debug] [ Client] - terminate

Related