This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Use nrfx QSPI with Zephyr filesystem

I'm using Zephyr on a nRF52840 and I'd like to use the QSPI with the Fat Filesystem.   I added the following Config statements to prj.conf:


The nrfx QSPI driver and file system code is then included in the build, but I'm unsure how to associate the QSPI with the filesystem.    I don't see a "CONFIG_DISK_ACCESS_QSPI_SDHC" to replace the "CONFIG_DISK_ACCESS_SPI_SDHC".    Or is there a different way to do this that I'm missing?

Thanks!

Parents
  • I looked into this, and it does not seem like there is added any support for QSPI with FAT Fs. To give you a better overview I'll provide you the call stack:

    • main()-->disk_access_init()  |  zephyr\samples\subsys\fs\fat_fs\src\main.c
      • disk->ops->init(disk) | zephyr\subsys\disk\disk_access.c
        • disk_spi_sdhc_access_init()-->  | if CONFIG_DISK_ACCESS_SPI_SDHC=y it will use functions from zephyr\subsys\disk\disk_access_spi_sdhc.c
          • spi_release() | zephyr\include\drivers\spi.h

    At the blue layer, there are different choices for hardware interface, as you can see in zephyr/subsys/disk, but there is none for QSPI.

    One option would be to create a driver yourself, in zephyr/subsys/disk/disk_access_spi_sdhc.c.

    You could also use the API \zephyr\include\drivers\flash.h and set these in prj.conf:

    You may also get some good answers if you ask in any of these Zephyr resources:

    https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.4.0/zephyr/introduction/index.html#community-support

    Best regards,

    Simon

  • OK...     I'll look into it further.   Thanks for the pointers!

  • Be aware that I don't have the best knowledge about this, and I may have overlooked/misunderstood something. You may get better answers if you ask in any of the mentioned Zephyr resources.

  • OK, thanks.

    I did find this link:   https://medium.com/home-wireless/implement-littlefs-for-qspi-flash-in-zephyr-37e591f86b48

    It appears to show how to use the QSPI with "littlefs" in Zephyr.    I have to admit that I haven't yet mastered the "device-tree" technology of Zephyr, so I'm not sure what is really happening here.  (I'm from the "old school" and am moving to Zephyr from FreeRTOS.   It seems like a lot of "stuff" happens in some hidden space and I find it hard to trace where this code is "generated" and when it executes!).   But I'm going to have to figure it out since, although I'm testing with nRF52480-DK, my application will be on a custom board...

    So perhaps this "littlefs" example can be used to make things work in FatFs.

    Thanks!

Reply
  • OK, thanks.

    I did find this link:   https://medium.com/home-wireless/implement-littlefs-for-qspi-flash-in-zephyr-37e591f86b48

    It appears to show how to use the QSPI with "littlefs" in Zephyr.    I have to admit that I haven't yet mastered the "device-tree" technology of Zephyr, so I'm not sure what is really happening here.  (I'm from the "old school" and am moving to Zephyr from FreeRTOS.   It seems like a lot of "stuff" happens in some hidden space and I find it hard to trace where this code is "generated" and when it executes!).   But I'm going to have to figure it out since, although I'm testing with nRF52480-DK, my application will be on a custom board...

    So perhaps this "littlefs" example can be used to make things work in FatFs.

    Thanks!

Children
No Data