-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
platform(esp32c3): embiggen heap #206
Comments
That's for now. The region is also used for statics, and I have no idea if code size factors into it. Since heap + stack is "whatever you didn't use for other stuff", that size is likely to decrease as time goes on. Something we COULD do is figure out how to modify/extend the esp32c3 linker scripts, in particular to:
Until we have something like cargo-call-stack, the minimum stack size is going to be a best estimate, but that is better than the current "lol cross your fingers" approach. |
Where are statics placed in this region? Does more statics bring the heap start towards the stack start, or the stack start towards the heap start? |
All links from chat yesterday:
The full layout is here (if we are using https://github.com/esp-rs/esp-hal/blob/main/esp32c3-hal/ld/mb-riscv-link.x#L41-L204 But tl;dr:
|
we currently have the heap hardcoded to 32KB. this is quite small, especially for async, because each async task is essentially moving a bit of stack into the heap.
@jamesmunns looked at the
esp32c3-hal
crate's linker script and determined that the memory region used for the stack and heap is 300KB.we could probably get away with at least a 64KB heap before we have a significant danger of getting clobbered by a rogue stack frame. even 100KB is probably fine...
The text was updated successfully, but these errors were encountered: