[embassy-rp] Enable interrupts in init function#5660
[embassy-rp] Enable interrupts in init function#5660sourcebox wants to merge 1 commit intoembassy-rs:mainfrom
Conversation
|
This is risky, the user might have good reasons to run
|
|
So what would be the alternative to make it independent of the bootloader? Because the risks you describe are probably also present when using a bootloader that enables them by default. |
I don't think it's possible to fix. The current convention is irqs are enabled at boot. Libraries can't enable irqs without risking unsoundness. If you have a broken bootloader that jumps to the app with irqs disabled, it's up to you, the user, to unsafely enable irqs at start of main when you know it can't cause unsoundness.
No, because the firmware will disable irqs if it's necessary for soundness, it doesn't rely on irqs being disabled on boot. |
|
Maybe we can do it in pre_init. That shouldn't cause any unsoundness. Disable+unpend all irqs individually in NVIC, then enable global interrupts. |
|
Ok, I close this PR so we can check a better solution. |
Fix for #4982