Skip to main content

paint_main_stack

Function paint_main_stack 

Source
pub fn paint_main_stack()
Expand description

Paint the main stack below the stack pointer.

The top of the paint is the stack pointer, not a constant, because how deep the boot path already is differs per chip and per entry macro. Nor is it a local’s address: inlined into its caller, a local sits wherever that frame puts it — on the ESP32-S31, 2 KiB above sp in the embassy main task — and painting up to it overwrote the live frame below. inline(never) keeps this frame the deepest live one. Call it before any interrupt is routed (the boards’ init does, ahead of esp_hal::init): the sweep writes below the stack pointer, where an interrupt frame would otherwise land.