esp-hal
esp-hal copied to clipboard
Allowing easy configuration of IRAM placement of device drivers like ESP-IDF
From my experiments in #939 it seems that with the ESP32 I-cache miss is a microsecond-level (several thousand cycles) penalty. In ESP-IDF they have a Kconfig based mechanism that allows putting devices drivers in the IRAM. We should have the same ability in order to enable timing-sensitive applications.
The first idea is to mark the interesting functions with #[cfg_attr(feature = "optimize-XXX-in-iram", ram)]. This enables choosing which peripherals are to be placed in iram, at the cost of a few feature flags.
Another idea is to have a configuration file just like in esp-wifi: https://github.com/esp-rs/esp-wifi/blob/main/esp-wifi/docs/tuning.md
@MabezDev what is blocking this issue?
Isn't this already merged for SPI in #1096 ? But probably this issue is about drivers in general which depends on / is blocked by #1111 since we don't want a feature per driver