mirror of
https://github.com/apache/nuttx.git
synced 2025-12-11 04:47:47 +08:00
arch/armv8-m/arm_secure_irq.c: fix writing to the NVIC_AIRCR register
Register key (VECTKEY) must be written, otherwise the write is ignored. Reference: https://developer.arm.com/documentation/100235/0004/the-cortex-m33-peripherals/system-control-block/application-interrupt-and-reset-control-register
This commit is contained in:
committed by
Petro Karashchenko
parent
d905a4e8a0
commit
b787e9ec3b
@@ -100,8 +100,8 @@ void up_secure_irq_all(bool secure)
|
||||
{
|
||||
int i;
|
||||
|
||||
modreg32(secure ? 0 : NVIC_AIRCR_BFHFNMINS,
|
||||
NVIC_AIRCR_BFHFNMINS, NVIC_AIRCR);
|
||||
modreg32((secure ? 0 : NVIC_AIRCR_BFHFNMINS) | NVIC_AIRCR_VECTKEY,
|
||||
(NVIC_AIRCR_VECTKEY_MASK | NVIC_AIRCR_BFHFNMINS), NVIC_AIRCR);
|
||||
|
||||
modreg32(secure ? NVIC_DEMCR_SDME : 0,
|
||||
NVIC_DEMCR_SDME, NVIC_DEMCR);
|
||||
|
||||
Reference in New Issue
Block a user