Losing Connection With JLINK - APPROTECT?

Hello -

I was nearing completion of a BLE Mesh project with the NRF52840 when there became a shortage of NRF52840 QFN. I decided to migrate back to the NRF52832 and reworked my custom boards. Here is what I am experiencing with the NRF52832, Zepher / VS Code and a Segger educational JLINK:

The board responds to nrfjprog --family nRF52  --recover from the comand line. I then program a sample based on the BME280 sensor sample. I program it in VS Code and it seems to program normally however after it is completed the NRF52832 no longer responds to nrfprog including --recover and --eraseall.

Looking through log.log I see this:

[2025-Jan-08 23:28:12] [debug] [SeggerBackend] - read_access_port_register
[2025-Jan-08 23:28:12] [debug] [SeggerBackend] - ---just_read_access_port_register
[2025-Jan-08 23:28:12] [debug] [SeggerBackend] - ---just_select_access_port_register
[2025-Jan-08 23:28:12] [trace] [ JLink] - JLINK_CORESIGHT_ReadAPDPReg(AP reg 0x03)
[2025-Jan-08 23:28:12] [trace] [ JLink] - Value=0x00000000
[2025-Jan-08 23:28:12] [trace] [ JLink] - - 0.216ms returns 0
[2025-Jan-08 23:28:12] [trace] [ JLink] - JLINK_HasError()
[2025-Jan-08 23:28:12] [ info] [ nRF52] - Protection status read as APPROTECT -> ALL
[2025-Jan-08 23:28:12] [trace] [ JLink] - - 0.040ms
[2025-Jan-08 23:28:12] [error] [ Worker] - Access protection is enabled, can't read device version.
[2025-Jan-08 23:28:12] [trace] [ Worker] - Command read_device_info executed for 3 milliseconds with result -90

So now, reading this about access port protection I get lost. CTRL-AP? MDK? 

_____________________________________

Access port protection controlled by hardware and software

This information refers to build codes Bxx and later.

By default, access port protection is enabled.

Access port protection is disabled by issuing an ERASEALL command via CTRL-AP. Read CTRL-AP.APPROTECTSTATUS to ensure that access port protection is disabled, and repeat the ERASEALL command if needed. This command will erase the flash, UICR, and RAM. CTRL-AP is described in more detail in CTRL-AP - Control access port. Access port protection will remain disabled until one of the following occurs:

Pin reset
Power or brownout reset
Watchdog reset if not in Debug Interface Mode, see Debug Interface mode
Wake from System OFF if not in Emulated System OFF

To keep access port protection disabled, the following actions must be performed:

Program UICR.APPROTECT to HwDisabled. This disables the hardware part of the access port protection scheme after the first reset of any type. The hardware part of the access port protection will stay disabled as long as UICR.APPROTECT is not overwritten.
Firmware must write APPROTECT.DISABLE to SwDisable. This disables the software part of the access port protection scheme.

Note: Register APPROTECT.DISABLE is reset after pin reset, power or brownout reset, watchdog reset, or wake from System OFF as mentioned above.
The following figure is an example on how a device with access port protection enabled can be erased, programmed, and configured to allow debugging. Operations sent from debugger as well as registers written by firmware will affect the access port state.

___________________________________________________________

I got as far as reading about the MDK and now I must ask for help.

I have NRF52832 QFAAE1 2347SD

Using ncs v2.8.0 via VS Code, how do I resume my development cycle of coding, programming, reading my LOG_WRN  messages in RTT, changing my code and repeating?

Regards,

David Carlin

[email protected]

Parents Reply Children
No Data
Related