nrf-rs / nrf-hal

A Rust HAL for the nRF family of devices
Apache License 2.0
499 stars 139 forks source link

nrf52840: missing approtect config #420

Open FlorianUekermann opened 1 year ago

FlorianUekermann commented 1 year ago

It looks like approtect config related bits are incomplete for nrf52840 with build codes Fxx and after.

nrf52840_hal::pac::uicr::approtect::PALL_A needs an extra variant HW_DISABLED = 0x5A and there is a new APPROTECT.DISABLE register, which needs to be set to SW_DISABLE = 0x5A after every reset to disable approtect until next reset.

The mechanism to enable the debugging port is:

Reference: https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf52840%2Fdif.html&anchor=debugandtrace