OVMS3-idf/components/spi_flash/test
Ivan Grokhotkov f9f2937694 spi_flash: raise priority of the task performing spi_flash operation
The fix is for the situation when cache disabling mechanism causes
a deadlock with user tasks. Situation is as follows:

1. spi_flash operation is started from low-priority task on CPU0
2. It uses IPC to wake up high-priority IPC1 task on CPU1, preventing
   all other tasks on CPU1 from running. This is needed to safely
   disable the cache.
3. While the task which started spi_flash operation is waiting for IPC1
   task to acknowledge that CPU1 is not using cache anymore, it is
   preempted by a higher priority application task ("app0").
4. Task app0 busy-waits for some operation on CPU1 to complete. But
   since application tasks are blocked out by IPC1 task, this never
   happens. Since app0 is busy-waiting, the task doing spi flash
   operation never runs.

The more or less logical soltion to the problem would be to also do
cache disabling on CPU0 and the SPI flash operation itself from IPC0
task. However IPC0 task stack would need to be increased to allow doing
SPI flash operation (and IPC1 stack as well). This would waste some
memory. An alternative approach adopted in this fix is to call FreeRTOS
functions to temporary increase the priority of SPI flash operation task
to the same level as the IPC task.

Fixes https://github.com/espressif/arduino-esp32/issues/740
Fixes https://github.com/espressif/esp-idf/issues/1157
2018-07-01 20:44:42 +08:00
..
component.mk add unit tests to esp-idf 2016-11-22 14:45:50 +08:00
test_cache_disabled.c add test case for invalid cache access interrupt 2017-04-13 15:27:39 +08:00
test_flash_encryption.c unit tests: Use a unit test app partition table, configure spi_flash to use data partition 2017-02-22 10:26:04 +11:00
test_large_flash_writes.c spi_flash: Fix SPI flash write alignment/size bugs 2017-06-09 17:33:27 +10:00
test_mmap.c fix CI failed when flash chip size if 2MBytes 2018-03-29 17:48:59 +08:00
test_out_of_bounds_write.c spi_flash: Abort on writes to dangerous regions (bootloader, partition table, app) 2017-11-03 15:52:27 -07:00
test_partitions.c spi_flash: Fixed bug in SPI flash ROM driver to work with embedded flash chip 2017-04-11 10:51:19 +08:00
test_read_write.c spi_flash: fix spi_flash_read into buffer in external RAM, add test 2017-10-19 21:35:21 +08:00
test_spi_flash.c spi_flash: raise priority of the task performing spi_flash operation 2018-07-01 20:44:42 +08:00