SPI NOR peripheral restart

Hi 

I have an external NOR flash chip which is powered off on startup. The idea is to power up the flash when needed to reserve power. On startup, I get the error message:

<err> spi_nor: SFDP magic ffffffff invalid
<err> spi_nor: SFDP read failed: -22

Enabling the power pin only starts during application code, meaning SPI-NOR fails before that.

Is there a way to restart the SPI-NOR instance or driver to re-attempt initializing the device?

I have had limited success by reorganizing boot priorities to have GPIO start before SPI, but what about the case where I have to reinitialize during runtime?

I have also tried remounting the fstab entry, but it doesn't seem to do anything to the SPI situation.

I appreciate any guidance regarding this

Parents Reply
  • Hi  

    The spi_nor_init function is not public API, but I removed the static qualifier and got it linked. It does reinitialize the SPI indeed, however when mounting littlefs with the DT-defined mountpoint, it says it cannot find the EXFLASH0 device. I also couldn't get the device with device_get_binding, because the device was uninitialized during boot.

    I assume the same occurs within the fstab-defined mountpoint, and hence it doesn't mount:

    <err> littlefs: can't get flash device: EXFLASH0

Children
Related