[SOLVED] Avoid blocking code execution (erase flash) for TWAI
Posted: Thu Mar 28, 2024 10:13 am
Hey,
we have some time critical code that requires to perform writes to flash memory in chunks. However, this fails as soon as another component operates on the flash as well (e.g. if esp_partition_erase_range() or esp_partition_write() is performed).
So my question is, if it is somehow possible to check in a non-blocking way if flash is currently ready to be written at.
I could wrap all the esp flash functions with my own logic, but I would like to avoid this if possible.
My Idea was to use the pins connected to internal flash memory on the ESP32 S3 to poll a busy state. But I am not if any of these pins could be used for that - if even possible.
The doc states these pins for the ESP32 S3:
26 — — SPICS1, GPIO26
27 — — SPIHD, GPIO27
28 — — SPIWP, GPIO28
29 — — SPICS0, GPIO29put only
30 — — SPICLK, GPIO30
31 — — SPIQ, GPIO31
32 — — SPID, GPIO32
Thanks
we have some time critical code that requires to perform writes to flash memory in chunks. However, this fails as soon as another component operates on the flash as well (e.g. if esp_partition_erase_range() or esp_partition_write() is performed).
So my question is, if it is somehow possible to check in a non-blocking way if flash is currently ready to be written at.
I could wrap all the esp flash functions with my own logic, but I would like to avoid this if possible.
My Idea was to use the pins connected to internal flash memory on the ESP32 S3 to poll a busy state. But I am not if any of these pins could be used for that - if even possible.
The doc states these pins for the ESP32 S3:
26 — — SPICS1, GPIO26
27 — — SPIHD, GPIO27
28 — — SPIWP, GPIO28
29 — — SPICS0, GPIO29put only
30 — — SPICLK, GPIO30
31 — — SPIQ, GPIO31
32 — — SPID, GPIO32
Thanks