Page 1 of 1

SPI flash driver

Posted: Mon Oct 22, 2018 1:35 pm
by PeterR
I have been given the requirement to add data logging onto a SPI flash.
I cannot easily use the master FLASH as I also need to use the PSRAM.

The ESP32 spi flash library is only intended for use with the master (the program) FLASH.
I thought that a little cut n paste would resolve but the driver disappears under the hood when making use of ROM routines.

Does anyone one know of a decent SPI flash driver available on a permissive license (not GPL)?
I only need simple block access ATM.

Re: SPI flash driver

Posted: Mon Oct 22, 2018 8:45 pm
by WiFive

Re: SPI flash driver

Posted: Tue Oct 23, 2018 10:40 am
by PeterR
Awesome; you even guessed my chip/size! I'll get testing!

Re: SPI flash driver

Posted: Fri Nov 02, 2018 1:38 pm
by PeterR
Please note that ExtFlash does not initialise 'is_qpi' & this can give you performance issues or errors depending on what you want!

Re: SPI flash driver

Posted: Sat Nov 03, 2018 7:04 pm
by fly135
I cannot easily use the master FLASH as I also need to use the PSRAM.
It seems that WiFive understands your question, but I'm confused. I'm assuming that "master FLASH" is the flash used to hold the application and other things. Why can you not use that flash for data storage? And what does PSRAM have to do with the problem you are having?

John A

Re: SPI flash driver

Posted: Mon Nov 05, 2018 10:42 am
by PeterR
Hi,
The issue was the lack of a 'is_qpi' initialiser in the downloaded driver.
Gonna try -Weffc++ and start coding properly.

To answer your questions - my understanding is that I must be running from IRAM in order to write main/master FLASH -
' This means that both CPUs must be running code from IRAM and only reading data from DRAM while flash write operations occur.'
From the above I understand that when writing main FLASH; (a) I must be running in IRAM and (b) cannot write to PSRAM
My program is quite large (>> larger than IRAM) and needs to ensure low latency for a number of activities including writing to PSRAM. I expect that FLASH erase/writes will take 10mS or more and so these restrictions seem to make main FLASH use impractical for me.
Perhaps 'cannot' is not strictly true but using main FLASH for logging seems to be a pain.