]> granicus.if.org Git - esp-idf/commit
spi: fix the crash when callbacks are not in the IRAM
authorMichael (XIAO Xufeng) <xiaoxufeng@espressif.com>
Tue, 23 Oct 2018 08:57:32 +0000 (16:57 +0800)
committermichael <xiaoxufeng@espressif.com>
Tue, 4 Dec 2018 13:35:20 +0000 (21:35 +0800)
commit44bd6f72bc6a0305f7a47faabc99d361a6b0db66
tree0142fe1bfe035588de4c41db4c6512a078f5b2db
parent7658b8ab62fc454db18db829af89618d8bc00afe
spi: fix the crash when callbacks are not in the IRAM

Introduced in 9c23b8e5 and 4f87a62f. To get higher speed, menuconfig
options are added to put ISR and other functions into the IRAM.  The
interrupt flag ESP_INTR_FLAG_IRAM is also mistakenly set when the ISR is
put into the IRAM. However callbacks, which are wrote by the user, are
called in the master and slave ISR. The user may not be aware of that
these callbacks are not disabled during flash operations. Any cache miss
during flash operation will cause panic.

Essentially IRAM functions and intrrupt flag ESP_INTR_FLAG_IRAM are
different, the latter means not disabling the ISR during flash
operations.  New bus_config flag intr_flags is offered to help set the
interrupt attribute, including priority level, SHARED, IRAM (not
disabled during flash operations).  It introduced a small BREAK to
IDFv3.1 (but the same as IDFv3.0) that the user has to manually set IRAM
flag now (therefore he's aware of the IRAM thing) to void the ISR being
disabled during flash operations.
components/driver/Kconfig
components/driver/include/driver/spi_common.h
components/driver/include/driver/spi_master.h
components/driver/include/driver/spi_slave.h
components/driver/spi_master.c
components/driver/spi_slave.c
docs/en/api-reference/peripherals/spi_master.rst