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.
These callbacks are called in an interrupt context.
https://github.com/hideakitai/ESP32DMASPI/blob/c71071b0a5bc318a035161bb47d7a6a732c47410/ESP32DMASPISlave.h#L247-L255
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/spi_slave.html#_CPPv4N28spi_slave_interface_config_t13post_setup_cbE