Lost SPI transactions when using VSPI and HSPI
Posted: Mon Oct 29, 2018 2:34 pm
EDIT: Traced again & discovered that the ExtFlash driver would wait indefinitely for a SPI transaction to complete. This is therefore an issue with lost SPI transactions rather than exceptions as alluded in this original post.
I added a SPI flash memory driver to my project https://github.com/lllucius/esp32_extfl ... a10be629a2
I create the driver at the end of my board initialization & after I have created a task pinned to core 1. The task is intended to service another SPI peripheral but only runs once at startup. In this scenario the program logs the Es32SpiNorFlash::Initialise() message but not the ExtFlash::init() message. The program appears to hang and does not raise an error report.
In this case the ExtFlash instance has address 0x3ffc52c8
If I however create the driver early in board initialization then the driver functions correctly. In this case the ExtFlash instance has address 0x3ffb6530
I doubled the task's stack and delayed creating the flash until the task had finished so there is no chance of the task blowing its stack.
Even so the program hangs.
1) How would I capture the error and/or confirm what has happened?
I under stand that using 'new' may cause RT issues. The system is not running yet however.
I added a SPI flash memory driver to my project https://github.com/lllucius/esp32_extfl ... a10be629a2
I create the driver at the end of my board initialization & after I have created a task pinned to core 1. The task is intended to service another SPI peripheral but only runs once at startup. In this scenario the program logs the Es32SpiNorFlash::Initialise() message but not the ExtFlash::init() message. The program appears to hang and does not raise an error report.
Code: Select all
Esp32SpiNorFlash::Esp32SpiNorFlash(std::string theName)
: name(theName)
{
flashMemory = new ExtFlash();
}
int Esp32SpiNorFlash::Initialise(const ext_flash_config_t *cfg)
{
int retStatus = 0;
ESP_LOGI(LOG_TAG, "%s - %x", __func__, (uint32_t)flashMemory);
retStatus = flashMemory->init(cfg);
.....
}
esp_err_t ExtFlash::init(const ext_flash_config_t *config)
{
ESP_LOGI(TAG, "%s", __func__);
If I however create the driver early in board initialization then the driver functions correctly. In this case the ExtFlash instance has address 0x3ffb6530
I doubled the task's stack and delayed creating the flash until the task had finished so there is no chance of the task blowing its stack.
Even so the program hangs.
1) How would I capture the error and/or confirm what has happened?
I under stand that using 'new' may cause RT issues. The system is not running yet however.