mirror of
https://github.com/apache/nuttx.git
synced 2026-05-21 13:13:08 +08:00
b28d60947a
When both CONFIG_ESP32_SPIRAM and CONFIG_ESP32_SPIRAM_USER_HEAP are selected, the device must not select CONFIG_NSH_ARCHINIT. Instead, CONFIG_BOARD_LATE_INITIALIZE must be selected. This is necessary because the SPI flash initialization disables the cache, and only internal memory is then accessible. So, if the SPI flash initialization is performed by the entry task (nsh_main, a regular task), it would use the user heap to allocate memory, which would cause a system crash when the cache is disabled. On the other hand, by selecting CONFIG_BOARD_LATE_INITIALIZE, a kernel thread is dedicated to perform the initialization, and the cache can be safely disabled. Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>