NRF Connect Programmer v3.0.8 for nrf5340 DK not working on Linux

Hi,

I have updated to the latest nRF Connect for Desktop 4.0.1 on Linux Mint 20.1 (64 bit x86) with Programmer version 3.0.8 and my nRF5340 Dk as well as my nRF5340 Audio Dk boards fail to recover when the "Erase all" button is pressed. Both cores remain as "Device is protected" after pressing that button. This only happens on Linux and not Windows 10. I can confirm that this happens on two completely separate Linux machines too. I had a working version of nRF Connect on another Linux machine but it stopped working when I updated to the latest version so it is definitely a software issue. Unfortunately I cannot figure out how to "downgrade" the programmer app.

Is there a way to run a specific version of the Programmer app? It seems to always use the latest version regardless of the nRF Connect version being used. It's hard to tell when it even installs it to.

I have attached verbose working (Windows) and non-working (Linux) logs of the process. I also sometimes get the following error log message on Linux:

16:16:21.357	Loading readback protection status for Network core
16:16:22.072	Failed to load readback protection status: async task failure for id: 1682435781358816 msg: [jlink] JLINKARM_DLL_TIME_OUT_ERROR (Origin: "Error when running operation: protection-get")
16:16:22.154	Readback protection status: NRFDL_PROTECTION_STATUS_NONE

I installed the same version of the Jlink driver (version 682c) that was known to work on the Linux version but this had no effect so I reverted back to version 780c.

What is the relationship between the Programmer app and the nrf command line tools? Will I have more luck downgrading command line tools until I get a working version by trial and error? I have found that nrfjprog just says it's done the right thing even when it hasn't.

Here are all the versions of what I am running:

Using nrf-device-lib-js version: 0.6.5
Using nrf-device-lib version: 0.14.7
Using nrfjprog DLL version: 10.19.1
Using JLink version: JLink_V7.80c

Linux log (not working)

14:54:04.945	Using nrf-device-lib-js version: 0.6.5
14:54:04.945	Using nrf-device-lib version: 0.14.7
14:54:04.945	Using nrfjprog DLL version: 10.19.1
14:54:04.945	Using JLink version: JLink_V7.80c
14:54:06.097	Getting serialport options from persistent store 001050008612.pc-nrfconnect-programmer
14:54:11.864	Using @nordicsemiconductor/nrf-device-lib-js to communicate with target via JLink
14:54:11.865	JLink OB firmware version J-Link OB-nRF5340-NordicSemi compiled Dec 3 2021 15:46:49
14:54:11.865	Device family NRF53_FAMILY
14:54:11.865	Device version NRF5340_xxAA_ENGD
14:54:11.865	Board version PCA10095
14:54:11.865	Loading readback protection status for Application core
14:54:11.865	Loading readback protection status for Network core
14:54:11.881	[nrfdl][info](14:54:11.865) Loaded plugin /tmp/.mount_nrfconqOeoqj/resources/app.asar.unpacked/node_modules/@nordicsemiconductor/nrf-device-lib-js/Release/00-nrfdl-jlink-plugin.nrfdl, starting to resolve symbols
14:54:11.881	[nrfdl][info](14:54:11.865) Loaded plugin /tmp/.mount_nrfconqOeoqj/resources/app.asar.unpacked/node_modules/@nordicsemiconductor/nrf-device-lib-js/Release/00-nrfdl-jlink-plugin.nrfdl, starting to resolve symbols
14:54:13.451	[nrfdl][info](14:54:12.654) close plugin dll at path: /tmp/.mount_nrfconqOeoqj/resources/app.asar.unpacked/node_modules/@nordicsemiconductor/nrf-device-lib-js/Release/00-nrfdl-jlink-plugin.nrfdl
14:54:13.451	Readback protection status: NRFDL_PROTECTION_STATUS_NONE
14:54:13.451	[nrfdl][info](14:54:12.655) Loaded plugin /tmp/.mount_nrfconqOeoqj/resources/app.asar.unpacked/node_modules/@nordicsemiconductor/nrf-device-lib-js/Release/00-nrfdl-jlink-plugin.nrfdl, starting to resolve symbols
14:54:13.474	Readback protection status: NRFDL_PROTECTION_STATUS_NONE
14:54:13.474	[nrfdl][info](14:54:12.746) close plugin dll at path: /tmp/.mount_nrfconqOeoqj/resources/app.asar.unpacked/node_modules/@nordicsemiconductor/nrf-device-lib-js/Release/00-nrfdl-jlink-plugin.nrfdl
14:54:13.474	[nrfdl][info](14:54:12.747) Loaded plugin /tmp/.mount_nrfconqOeoqj/resources/app.asar.unpacked/node_modules/@nordicsemiconductor/nrf-device-lib-js/Release/00-nrfdl-jlink-plugin.nrfdl, starting to resolve symbols
14:54:13.491	[nrfdl][info](14:54:13.443) close plugin dll at path: /tmp/.mount_nrfconqOeoqj/resources/app.asar.unpacked/node_modules/@nordicsemiconductor/nrf-device-lib-js/Release/00-nrfdl-jlink-plugin.nrfdl
14:54:13.543	Parse memory regions for Application core
14:54:13.543	Parse memory regions for Network core
14:54:13.544	Update files regions according to Application core
14:54:13.544	Parse memory regions for file
14:54:13.544	Update files regions according to Network core
14:54:13.544	Parse memory regions for file
14:54:13.547	Device is loaded and ready for further operation
14:54:13.547	[nrfdl][info](14:54:13.539) close plugin dll at path: /tmp/.mount_nrfconqOeoqj/resources/app.asar.unpacked/node_modules/@nordicsemiconductor/nrf-device-lib-js/Release/00-nrfdl-jlink-plugin.nrfdl
14:54:15.742	Recovering NRFDL_DEVICE_CORE_APPLICATION core
14:54:15.751	[nrfdl][info](14:54:15.743) Loaded plugin /tmp/.mount_nrfconqOeoqj/resources/app.asar.unpacked/node_modules/@nordicsemiconductor/nrf-device-lib-js/Release/00-nrfdl-jlink-plugin.nrfdl, starting to resolve symbols
14:54:17.816	Recovering NRFDL_DEVICE_CORE_APPLICATION core completed
14:54:17.817	Recovering NRFDL_DEVICE_CORE_NETWORK core
14:54:17.817	[nrfdl][info](14:54:17.815) close plugin dll at path: /tmp/.mount_nrfconqOeoqj/resources/app.asar.unpacked/node_modules/@nordicsemiconductor/nrf-device-lib-js/Release/00-nrfdl-jlink-plugin.nrfdl
14:54:17.818	[nrfdl][info](14:54:17.818) Loaded plugin /tmp/.mount_nrfconqOeoqj/resources/app.asar.unpacked/node_modules/@nordicsemiconductor/nrf-device-lib-js/Release/00-nrfdl-jlink-plugin.nrfdl, starting to resolve symbols
14:54:19.801	[nrfdl][warning](14:54:19.796) [jlink] [NRFJPROG][nRF53][] SPU peripheral slave with apb index 4225 is not present.
14:54:19.813	[nrfdl][warning](14:54:19.808) [jlink] [NRFJPROG][nRF53][] SPU peripheral slave with apb index 4225 is not present.
14:54:19.821	[nrfdl][warning](14:54:19.811) [jlink] [NRFJPROG][nRF53][] SPU peripheral slave with apb index 4225 is not present.
14:54:19.825	[nrfdl][warning](14:54:19.814) [jlink] [NRFJPROG][nRF53][] SPU peripheral slave with apb index 4225 is not present.
14:54:19.829	[nrfdl][warning](14:54:19.817) [jlink] [NRFJPROG][nRF53][] SPU peripheral slave with apb index 4101 is not present.
14:54:19.839	[nrfdl][warning](14:54:19.829) [jlink] [NRFJPROG][nRF53][] SPU peripheral slave with apb index 4224 is not present.
14:54:19.841	[nrfdl][warning](14:54:19.839) [jlink] [NRFJPROG][nRF53][] SPU peripheral slave with apb index 4224 is not present.
14:54:19.844	[nrfdl][warning](14:54:19.840) [jlink] [NRFJPROG][nRF53][] SPU peripheral slave with apb index 4224 is not present.
14:54:19.846	[nrfdl][warning](14:54:19.841) [jlink] [NRFJPROG][nRF53][] SPU peripheral slave with apb index 4224 is not present.
14:54:19.847	[nrfdl][warning](14:54:19.842) [jlink] [NRFJPROG][nRF53][] SPU peripheral slave with apb index 4224 is not present.
14:54:19.849	[nrfdl][warning](14:54:19.843) [jlink] [NRFJPROG][nRF53][] SPU peripheral slave with apb index 4224 is not present.
14:54:19.850	[nrfdl][warning](14:54:19.843) [jlink] [NRFJPROG][nRF53][] SPU peripheral slave with apb index 4224 is not present.
14:54:19.855	[nrfdl][warning](14:54:19.853) [jlink] [NRFJPROG][nRF53][] SPU peripheral slave with apb index 4224 is not present.
14:54:19.856	[nrfdl][warning](14:54:19.854) [jlink] [NRFJPROG][nRF53][] SPU peripheral slave with apb index 4224 is not present.
14:54:19.875	[nrfdl][warning](14:54:19.874) [jlink] [NRFJPROG][nRF53][] SPU peripheral slave with apb index 4224 is not present.
14:54:19.886	[nrfdl][warning](14:54:19.884) [jlink] [NRFJPROG][nRF53][] SPU peripheral slave with apb index 4224 is not present.
14:54:19.942	Recovering NRFDL_DEVICE_CORE_NETWORK core completed
14:54:19.952	Device recovery completed
14:54:19.957	Using @nordicsemiconductor/nrf-device-lib-js to communicate with target via JLink
14:54:19.958	JLink OB firmware version J-Link OB-nRF5340-NordicSemi compiled Dec 3 2021 15:46:49
14:54:19.958	Device family NRF53_FAMILY
14:54:19.958	Device version NRF5340_xxAA_ENGD
14:54:19.958	Board version PCA10095
14:54:19.958	Loading readback protection status for Application core
14:54:19.958	Loading readback protection status for Network core
14:54:19.959	[nrfdl][info](14:54:19.941) close plugin dll at path: /tmp/.mount_nrfconqOeoqj/resources/app.asar.unpacked/node_modules/@nordicsemiconductor/nrf-device-lib-js/Release/00-nrfdl-jlink-plugin.nrfdl
14:54:19.964	[nrfdl][info](14:54:19.959) Loaded plugin /tmp/.mount_nrfconqOeoqj/resources/app.asar.unpacked/node_modules/@nordicsemiconductor/nrf-device-lib-js/Release/00-nrfdl-jlink-plugin.nrfdl, starting to resolve symbols
14:54:19.965	[nrfdl][info](14:54:19.959) Loaded plugin /tmp/.mount_nrfconqOeoqj/resources/app.asar.unpacked/node_modules/@nordicsemiconductor/nrf-device-lib-js/Release/00-nrfdl-jlink-plugin.nrfdl, starting to resolve symbols
14:54:20.950	[nrfdl][info](14:54:20.809) close plugin dll at path: /tmp/.mount_nrfconqOeoqj/resources/app.asar.unpacked/node_modules/@nordicsemiconductor/nrf-device-lib-js/Release/00-nrfdl-jlink-plugin.nrfdl
14:54:20.950	Readback protection status: NRFDL_PROTECTION_STATUS_NONE
14:54:20.950	[nrfdl][info](14:54:20.810) Loaded plugin /tmp/.mount_nrfconqOeoqj/resources/app.asar.unpacked/node_modules/@nordicsemiconductor/nrf-device-lib-js/Release/00-nrfdl-jlink-plugin.nrfdl, starting to resolve symbols
14:54:20.955	Readback protection status: NRFDL_PROTECTION_STATUS_ALL
14:54:20.955	[nrfdl][info](14:54:20.891) close plugin dll at path: /tmp/.mount_nrfconqOeoqj/resources/app.asar.unpacked/node_modules/@nordicsemiconductor/nrf-device-lib-js/Release/00-nrfdl-jlink-plugin.nrfdl
14:54:21.684	Parse memory regions for Application core
14:54:21.684	Parse memory regions for Network core
14:54:21.687	Update files regions according to Application core
14:54:21.687	Parse memory regions for file
14:54:21.687	Update files regions according to Network core
14:54:21.687	Parse memory regions for file
14:54:21.695	Device is loaded and ready for further operation
14:54:21.695	[nrfdl][info](14:54:21.676) close plugin dll at path: /tmp/.mount_nrfconqOeoqj/resources/app.asar.unpacked/node_modules/@nordicsemiconductor/nrf-device-lib-js/Release/00-nrfdl-jlink-plugin.nrfdl

Windows log (working):

14:48:37.369	Using nrf-device-lib-js version: 0.6.5
14:48:37.369	Using nrf-device-lib version: 0.14.7
14:48:37.369	Using nrfjprog DLL version: 10.19.1
14:48:37.369	Using JLink version: JLink_V7.80c
14:48:37.830	[nrfdl][info](14:48:37.831) plugin added new device: 10 sn:
14:48:37.832	Getting serialport options from persistent store 001050008612.pc-nrfconnect-programmer
14:48:37.833	Getting serialport options from persistent store .pc-nrfconnect-programmer
14:48:42.028	Using @nordicsemiconductor/nrf-device-lib-js to communicate with target via JLink
14:48:42.028	JLink OB firmware version J-Link OB-nRF5340-NordicSemi compiled Dec 3 2021 15:46:49
14:48:42.028	Device family NRF53_FAMILY
14:48:42.028	Device version NRF5340_xxAA_ENGD
14:48:42.028	Board version PCA10095
14:48:42.028	Loading readback protection status for Application core
14:48:42.028	Loading readback protection status for Network core
14:48:42.038	[nrfdl][info](14:48:42.029) Loaded plugin C:\Users\david\AppData\Local\Programs\nrfconnect\resources\app.asar.unpacked\node_modules\@nordicsemiconductor\nrf-device-lib-js\Release\00-nrfdl-jlink-plugin.nrfdl, starting to resolve symbols
14:48:42.038	[nrfdl][info](14:48:42.029) Loaded plugin C:\Users\david\AppData\Local\Programs\nrfconnect\resources\app.asar.unpacked\node_modules\@nordicsemiconductor\nrf-device-lib-js\Release\00-nrfdl-jlink-plugin.nrfdl, starting to resolve symbols
14:48:43.173	Readback protection status: NRFDL_PROTECTION_STATUS_NONE
14:48:43.173	[nrfdl][info](14:48:42.562) close plugin dll at path: C:\Users\david\AppData\Local\Programs\nrfconnect\resources\app.asar.unpacked\node_modules\@nordicsemiconductor\nrf-device-lib-js\Release\00-nrfdl-jlink-plugin.nrfdl
14:48:43.173	[nrfdl][info](14:48:42.563) Loaded plugin C:\Users\david\AppData\Local\Programs\nrfconnect\resources\app.asar.unpacked\node_modules\@nordicsemiconductor\nrf-device-lib-js\Release\00-nrfdl-jlink-plugin.nrfdl, starting to resolve symbols
14:48:43.188	Readback protection status: NRFDL_PROTECTION_STATUS_NONE
14:48:43.188	[nrfdl][info](14:48:42.825) close plugin dll at path: C:\Users\david\AppData\Local\Programs\nrfconnect\resources\app.asar.unpacked\node_modules\@nordicsemiconductor\nrf-device-lib-js\Release\00-nrfdl-jlink-plugin.nrfdl
14:48:43.188	[nrfdl][info](14:48:42.825) Loaded plugin C:\Users\david\AppData\Local\Programs\nrfconnect\resources\app.asar.unpacked\node_modules\@nordicsemiconductor\nrf-device-lib-js\Release\00-nrfdl-jlink-plugin.nrfdl, starting to resolve symbols
14:48:43.203	[nrfdl][info](14:48:43.150) close plugin dll at path: C:\Users\david\AppData\Local\Programs\nrfconnect\resources\app.asar.unpacked\node_modules\@nordicsemiconductor\nrf-device-lib-js\Release\00-nrfdl-jlink-plugin.nrfdl
14:48:43.326	Parse memory regions for Application core
14:48:43.326	Parse memory regions for Network core
14:48:43.327	Update files regions according to Application core
14:48:43.327	Parse memory regions for file
14:48:43.327	Update files regions according to Network core
14:48:43.327	Parse memory regions for file
14:48:43.337	Device is loaded and ready for further operation
14:48:43.337	[nrfdl][info](14:48:43.323) close plugin dll at path: C:\Users\david\AppData\Local\Programs\nrfconnect\resources\app.asar.unpacked\node_modules\@nordicsemiconductor\nrf-device-lib-js\Release\00-nrfdl-jlink-plugin.nrfdl
14:48:48.819	Recovering NRFDL_DEVICE_CORE_APPLICATION core
14:48:48.824	[nrfdl][info](14:48:48.820) Loaded plugin C:\Users\david\AppData\Local\Programs\nrfconnect\resources\app.asar.unpacked\node_modules\@nordicsemiconductor\nrf-device-lib-js\Release\00-nrfdl-jlink-plugin.nrfdl, starting to resolve symbols
14:48:50.613	Recovering NRFDL_DEVICE_CORE_APPLICATION core completed
14:48:50.613	Recovering NRFDL_DEVICE_CORE_NETWORK core
14:48:50.613	[nrfdl][info](14:48:50.613) close plugin dll at path: C:\Users\david\AppData\Local\Programs\nrfconnect\resources\app.asar.unpacked\node_modules\@nordicsemiconductor\nrf-device-lib-js\Release\00-nrfdl-jlink-plugin.nrfdl
14:48:50.613	[nrfdl][info](14:48:50.614) Loaded plugin C:\Users\david\AppData\Local\Programs\nrfconnect\resources\app.asar.unpacked\node_modules\@nordicsemiconductor\nrf-device-lib-js\Release\00-nrfdl-jlink-plugin.nrfdl, starting to resolve symbols
14:48:52.267	[nrfdl][warning](14:48:52.264) [jlink] [NRFJPROG][nRF53][] SPU peripheral slave with apb index 4225 is not present.
14:48:52.272	[nrfdl][warning](14:48:52.265) [jlink] [NRFJPROG][nRF53][] SPU peripheral slave with apb index 4225 is not present.
14:48:52.275	[nrfdl][warning](14:48:52.265) [jlink] [NRFJPROG][nRF53][] SPU peripheral slave with apb index 4225 is not present.
14:48:52.279	[nrfdl][warning](14:48:52.266) [jlink] [NRFJPROG][nRF53][] SPU peripheral slave with apb index 4225 is not present.
14:48:52.283	[nrfdl][warning](14:48:52.280) [jlink] [NRFJPROG][nRF53][] SPU peripheral slave with apb index 4101 is not present.
14:48:52.300	[nrfdl][warning](14:48:52.296) [jlink] [NRFJPROG][nRF53][] SPU peripheral slave with apb index 4224 is not present.
14:48:52.312	[nrfdl][warning](14:48:52.311) [jlink] [NRFJPROG][nRF53][] SPU peripheral slave with apb index 4224 is not present.
14:48:52.313	[nrfdl][warning](14:48:52.311) [jlink] [NRFJPROG][nRF53][] SPU peripheral slave with apb index 4224 is not present.
14:48:52.315	[nrfdl][warning](14:48:52.312) [jlink] [NRFJPROG][nRF53][] SPU peripheral slave with apb index 4224 is not present.
14:48:52.327	[nrfdl][warning](14:48:52.327) [jlink] [NRFJPROG][nRF53][] SPU peripheral slave with apb index 4224 is not present.
14:48:52.329	[nrfdl][warning](14:48:52.327) [jlink] [NRFJPROG][nRF53][] SPU peripheral slave with apb index 4224 is not present.
14:48:52.331	[nrfdl][warning](14:48:52.327) [jlink] [NRFJPROG][nRF53][] SPU peripheral slave with apb index 4224 is not present.
14:48:52.343	[nrfdl][warning](14:48:52.343) [jlink] [NRFJPROG][nRF53][] SPU peripheral slave with apb index 4224 is not present.
14:48:52.346	[nrfdl][warning](14:48:52.343) [jlink] [NRFJPROG][nRF53][] SPU peripheral slave with apb index 4224 is not present.
14:48:52.377	[nrfdl][warning](14:48:52.375) [jlink] [NRFJPROG][nRF53][] SPU peripheral slave with apb index 4224 is not present.
14:48:52.381	[nrfdl][warning](14:48:52.376) [jlink] [NRFJPROG][nRF53][] SPU peripheral slave with apb index 4224 is not present.
14:48:52.551	[nrfdl][info](14:48:52.551) close plugin dll at path: C:\Users\david\AppData\Local\Programs\nrfconnect\resources\app.asar.unpacked\node_modules\@nordicsemiconductor\nrf-device-lib-js\Release\00-nrfdl-jlink-plugin.nrfdl
14:48:52.551	Recovering NRFDL_DEVICE_CORE_NETWORK core completed
14:48:52.555	Device recovery completed
14:48:52.559	Using @nordicsemiconductor/nrf-device-lib-js to communicate with target via JLink
14:48:52.559	JLink OB firmware version J-Link OB-nRF5340-NordicSemi compiled Dec 3 2021 15:46:49
14:48:52.559	Device family NRF53_FAMILY
14:48:52.560	Device version NRF5340_xxAA_ENGD
14:48:52.560	Board version PCA10095
14:48:52.560	Loading readback protection status for Application core
14:48:52.560	Loading readback protection status for Network core
14:48:52.564	[nrfdl][info](14:48:52.561) Loaded plugin C:\Users\david\AppData\Local\Programs\nrfconnect\resources\app.asar.unpacked\node_modules\@nordicsemiconductor\nrf-device-lib-js\Release\00-nrfdl-jlink-plugin.nrfdl, starting to resolve symbols
14:48:52.564	[nrfdl][info](14:48:52.561) Loaded plugin C:\Users\david\AppData\Local\Programs\nrfconnect\resources\app.asar.unpacked\node_modules\@nordicsemiconductor\nrf-device-lib-js\Release\00-nrfdl-jlink-plugin.nrfdl, starting to resolve symbols
14:48:54.035	[nrfdl][info](14:48:53.203) close plugin dll at path: C:\Users\david\AppData\Local\Programs\nrfconnect\resources\app.asar.unpacked\node_modules\@nordicsemiconductor\nrf-device-lib-js\Release\00-nrfdl-jlink-plugin.nrfdl
14:48:54.035	Readback protection status: NRFDL_PROTECTION_STATUS_NONE
14:48:54.035	[nrfdl][info](14:48:53.204) Loaded plugin C:\Users\david\AppData\Local\Programs\nrfconnect\resources\app.asar.unpacked\node_modules\@nordicsemiconductor\nrf-device-lib-js\Release\00-nrfdl-jlink-plugin.nrfdl, starting to resolve symbols
14:48:54.039	[nrfdl][info](14:48:53.349) close plugin dll at path: C:\Users\david\AppData\Local\Programs\nrfconnect\resources\app.asar.unpacked\node_modules\@nordicsemiconductor\nrf-device-lib-js\Release\00-nrfdl-jlink-plugin.nrfdl
14:48:54.039	Readback protection status: NRFDL_PROTECTION_STATUS_NONE
14:48:54.039	[nrfdl][info](14:48:53.351) Loaded plugin C:\Users\david\AppData\Local\Programs\nrfconnect\resources\app.asar.unpacked\node_modules\@nordicsemiconductor\nrf-device-lib-js\Release\00-nrfdl-jlink-plugin.nrfdl, starting to resolve symbols
14:48:54.094	[nrfdl][info](14:48:53.992) close plugin dll at path: C:\Users\david\AppData\Local\Programs\nrfconnect\resources\app.asar.unpacked\node_modules\@nordicsemiconductor\nrf-device-lib-js\Release\00-nrfdl-jlink-plugin.nrfdl
14:48:54.229	[nrfdl][info](14:48:54.229) close plugin dll at path: C:\Users\david\AppData\Local\Programs\nrfconnect\resources\app.asar.unpacked\node_modules\@nordicsemiconductor\nrf-device-lib-js\Release\00-nrfdl-jlink-plugin.nrfdl
14:48:54.235	Parse memory regions for Application core
14:48:54.235	Parse memory regions for Network core
14:48:54.237	Update files regions according to Application core
14:48:54.237	Parse memory regions for file
14:48:54.237	Update files regions according to Network core
14:48:54.237	Parse memory regions for file
14:48:54.244	Device is loaded and ready for further operation

Please save me from having to use Windows.

Thanks,

David

  • Hi,

    Did you try to program a hex file? I ask because I see the same error in the log on my end when opening v3.0.8 on Ubuntu 22.04 LTS, but both erase and write works as expected.

  • Hi,

    This happens regardless of whether or not I attempt to program a hex file or not. And I have found this issue to be intermittent too. Sometimes it works, sometimes not.

    To reproduce open nRF Connect Programmer 3.0.8 on Linux and click "Erase all". Most of the time I get "Device is protected". If I then eject the device and reconnect sometimes I get "Device is protected" and sometimes it works with "Device is connected". This seems to me like some sort of timeout that is incorrectly categorized as ap protect.

    On another note I have found that "nrfjprog --recover" works on Linux and is equivalent to "nrfjprog --recover --coprocessor CP_APPLICATION". I see that it writes some code to the 0x0 app core flash area. Does this have something to do with it being a boot loader and unlocking the peripherals? Can I do without such a thing and run the app core in secure mode in my application itself. Bootloaders don't play nicely with the debugger I'm using.

  • Hi,

    Dave H said:
    This happens regardless of whether or not I attempt to program a hex file or not.

    I see. But does programming work after you see this? I got this in the log as well once when I tested, but still programming/erase worked as expected.

    Dave H said:
    And I have found this issue to be intermittent too. Sometimes it works, sometimes not.

    Yes, that is interesting and I see the same (have only been able to reproduce once so far).

    Dave H said:
    On another note I have found that "nrfjprog --recover" works on Linux and is equivalent to "nrfjprog --recover --coprocessor CP_APPLICATION".

    Yes, those are equivalent. (And To recover the network core specify CP_NETWORK instead).

    Dave H said:
    I see that it writes some code to the 0x0 app core flash area. Does this have something to do with it being a boot loader and unlocking the peripherals?

    It is not a bootloader, but when you use nrfjprog recover it will program a small snippet to page 0 that writes to APPROTECT.DISABLE to make it possible to debug or program the device subsequently. It also writes to UICR.APPROTECT, as both are needed to keep the debug interface open.

    Dave H said:
    Can I do without such a thing and run the app core in secure mode in my application itself.

    This is overwritten when you subsequently program the device (typically with sectorerase) so after you program it with your own code there are no remains of this code snippet (other than in the UICR). The reason this is done is because APPROTECT is enabled by default and only disabled by an ERASEALL operation via the CTRL-AP or if disabled by firmware.

  • I see. But does programming work after you see this? I got this in the log as well once when I tested, but still programming/erase worked as expected.

    I confirm that programming/erase is working as expected in Linux. Even when it says "Device is protected"

    It is not a bootloader, but when you use nrfjprog recover it will program a small snippet to page 0 that writes to APPROTECT.DISABLE to make it possible to debug or program the device subsequently. It also writes to UICR.APPROTECT, as both are needed to keep the debug interface open.

    Thanks, that is very useful. I will continue investigating along that line. I wish there was some article I could read that tells you what to do if you are not interested in any form of secure mode on this chip. The documentation is spread out and it seems like you need to know quite a lot about how security is implemented just to turn it off. I'm not saying that security is unimportant, just that it is not required in many instances.

  • Hi,

    You are right that the information is a bit fragmented at the moment, but we are actively working to improve the the security related documentation. The Access port protection feature is documented in the CTRL-AP chapter in the product specification. The special thing about this feature is that it is enabled by default, but we try to hide these complexities with our tools. That is for instance why a "nrfjprog --recover" operation or similar writes to flash to open the debug port. Similarly, the default behavior when you build an application in the nRF Connect SDK is to include the code that open up the debug port by default (see Enabling access port protection mechanism for more details).

    Regarding security related documentation in general, we have a high level starting point here: Security. There is also a separate chapter on security in the nRF Connect SDK.

    Generally we try to avoid forcing you to use security features, but there are some features that are on by default or enforced by HW because that is required in order to provide the necessary level of security for those who needs it.

Related