Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nrfx: mdk: Add approtect workaround for 91x1 #231

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions nrfx/mdk/system_nrf91_approtect.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ static inline void nrf91_handle_approtect(void)
return;
}
#if defined (NRF91_ERRATA_36_PRESENT) && NRF91_ERRATA_36_PRESENT
#if defined (ENABLE_CONSTANT_LATENCY_WORKAROUND)
/* Note: NRF_APPROTECT does not retain its values in SYSTEM ON IDLE mode.
* This will prevent the debugging due to NRF_APPROTECT_S->APPROTECT.DISABLE not being
* written the SwUnprotected value. Enable constant latency mode to prevent WFI and WFE
* instructions from entering SYSTEM ON IDLE mode.
*/
NRF_POWER_S->TASKS_CONSTLAT = 1;
#endif

#if defined (ENABLE_APPROTECT)
/* Prevent processor from unlocking APPROTECT soft branch after this point. */
NRF_APPROTECT_S->APPROTECT.FORCEPROTECT = (APPROTECT_APPROTECT_FORCEPROTECT_FORCEPROTECT_Force << APPROTECT_APPROTECT_FORCEPROTECT_FORCEPROTECT_Pos);
Expand Down