esp-hal icon indicating copy to clipboard operation
esp-hal copied to clipboard

Allowing easy configuration of IRAM placement of device drivers like ESP-IDF

Open ProfFan opened this issue 2 years ago • 4 comments
trafficstars

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.

ProfFan avatar Nov 15 '23 20:11 ProfFan

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.

bugadani avatar Nov 15 '23 21:11 bugadani

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

ProfFan avatar Jan 19 '24 01:01 ProfFan

@MabezDev what is blocking this issue?

jessebraham avatar Mar 13 '24 12:03 jessebraham

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

bjoernQ avatar Mar 13 '24 12:03 bjoernQ