-
Notifications
You must be signed in to change notification settings - Fork 264
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
Example "wifi_bench" triggered an Exception on ESP32S2FH4 (No Embedded PSRAM) #2001
Comments
Download |
Thanks for opening this issue!
There is a memory area we are not allowed to touch: the RAM used by ROM functions For most chips IRAM and DRAM is the same physical memory mapped to different addresses - so the memory is shared by code and data The exception is most probably caused by the stack growing into a region occupied by data/code |
Example "wifi_bench" triggered an Exception on ESP32S2FH4 (No Embedded PSRAM)
I've made a simpler test program for locating the problem: It's runnable with 16KB memory usage of arrays (PS: the speed is always less than 100KB/s, I'd like to see the typical test result of
wifi_bench
, which is missing in the document), but 32KB of buffers causes the exception ('LoadProhibited', EXCVADDR = 0).I'd like to port the code provided in
https://github.com/esp-rs/esp-hal/pull/1646
to ESP32-S2 to capture raw data (not from camera). But this memory-related issue may force me to come back to ESP-IDF and write in C. Where's the memory safety promised by Rust?In ESP-IDF,
esp_get_minimum_free_heap_size()
returns about 250KB inhello_world
, and it's about 130KB in another example with wifi enabled, still enough for my use case. In this project, it seems like the author ofesp-hal/ld/esp32s2/memory.x
thought that the size of DRAM is only 188KB, why? Is it related to IRAM usage?My test crate is created by
cargo-generate
, the template ishttps://github.com/esp-rs/esp-template
. I always use the release profile to build any program based onesp-hal
.config.toml
:Cargo.toml
:main.rs
:espflash
report:UART0
debug output:bench-host.rs
:bench-host
output:Merely changing the size of
BUF_DATA
from 8,192 to 24,576 causes the exception:The text was updated successfully, but these errors were encountered: