hideakitai / ESP32DMASPI

SPI library for ESP32 which use DMA buffer to send/receive transactions
MIT License
166 stars 36 forks source link

`results` and `transactions` should be locked because internal callbacks are called in interrupt context (SPI slave) #39

Closed hideakitai closed 5 months ago

hideakitai commented 6 months ago

These callbacks are called in an interrupt context.

https://github.com/hideakitai/ESP32DMASPI/blob/c71071b0a5bc318a035161bb47d7a6a732c47410/ESP32DMASPISlave.h#L247-L255

This callback is called within interrupt context should be in IRAM for best performance, see "Transferring Speed" section in the SPI Master documentation for full details. If not, the callback may crash during flash operation when the driver is initialized with ESP_INTR_FLAG_IRAM.

https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/spi_slave.html#_CPPv4N28spi_slave_interface_config_t13post_setup_cbE

hideakitai commented 5 months ago

Fixed by #41 and #42