mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-25 16:23:10 +00:00
rp: fix multicore stack guard setup
the region field of the register is four bits wide followed by the valid bit that causes the rnr update we rely on for the rasr write. 0x08 is just a bit short to reach the valid bit, and since rp2040 has only 8 regions it (at best) doesn't do anything at all.
This commit is contained in:
parent
3382ca1a54
commit
4d6b3c57b1
@ -74,7 +74,7 @@ fn install_stack_guard(stack_bottom: *mut usize) {
|
|||||||
let subregion_select = 0xff ^ (1 << ((addr >> 5) & 7));
|
let subregion_select = 0xff ^ (1 << ((addr >> 5) & 7));
|
||||||
unsafe {
|
unsafe {
|
||||||
core.MPU.ctrl.write(5); // enable mpu with background default map
|
core.MPU.ctrl.write(5); // enable mpu with background default map
|
||||||
core.MPU.rbar.write((addr & !0xff) | 0x8);
|
core.MPU.rbar.write((addr & !0xff) | (1 << 4)); // set address and update RNR
|
||||||
core.MPU.rasr.write(
|
core.MPU.rasr.write(
|
||||||
1 // enable region
|
1 // enable region
|
||||||
| (0x7 << 1) // size 2^(7 + 1) = 256
|
| (0x7 << 1) // size 2^(7 + 1) = 256
|
||||||
|
Loading…
Reference in New Issue
Block a user