Update source code to use the correct bit - fixes #993 (#1180)

This commit is contained in:
andygpz11 2023-01-20 15:10:01 +00:00 committed by GitHub
parent 885bd922cf
commit 2e45d8ec65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,7 +54,7 @@ void runtime_install_stack_guard(void *stack_bottom) {
// mask is 1 bit per 32 bytes of the 256 byte range... clear the bit for the segment we want
uint32_t subregion_select = 0xffu ^ (1u << ((addr >> 5u) & 7u));
mpu_hw->ctrl = 5; // enable mpu with background default map
mpu_hw->rbar = (addr & (uint)~0xff) | 0x8 | 0;
mpu_hw->rbar = (addr & (uint)~0xff) | M0PLUS_MPU_RBAR_VALID_BITS | 0;
mpu_hw->rasr = 1 // enable region
| (0x7 << 1) // size 2^(7 + 1) = 256
| (subregion_select << 8)