Skip to content

Portenta H7: Setting up LittleFS to work on QSPI #77

Open
@mjs513

Description

@mjs513

@KurtE - @facchinm - @pillo79

Been experimenting with using LittleFS in conjunction with QSPI and not having much luck. Reason for using LittleFS and not FS is that LittleFS addresses wear leveling.

Using the sample LittleFS: https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/subsys/fs/littlefs but keep getting an error message

\Giga_zephyr\h7_littlefs\h7_littlefs.ino:17:
C:\Users\Merli\AppData\Local\Arduino15\packages\arduino\hardware\zephyr\0.2.0\variants\arduino_portenta_h7/llext-edk/include/zephyr/include/zephyr/fs/littlefs.h:14:10: fatal error: lfs.h: No such file or directory
   14 | #include <lfs.h>
      |          ^~~~~~~
compilation terminated.
exit status 1

Now in the config file for the H7 I have:


CONFIG_FLASH=y
CONFIG_FLASH_MAP=y

CONFIG_FILE_SYSTEM=y
CONFIG_FILE_SYSTEM_LITTLEFS=y
CONFIG_FS_LITTLEFS_FC_HEAP_SIZE=2048

CONFIG_FLASH=y
CONFIG_FLASH_MAP=y

CONFIG_FILE_SYSTEM=y
CONFIG_FILE_SYSTEM_LITTLEFS=y
CONFIG_FS_LITTLEFS_FC_HEAP_SIZE=2048
CONFIG_FS_LITTLEFS_FMP_DEV=y

Note am using CONFIG_FS_LITTLEFS_FMP_DEV=y since we are using flash:

config FS_LITTLEFS_FMP_DEV
	bool "Support for littlefs on flash devices"
	depends on FLASH_MAP
	depends on FLASH_PAGE_LAYOUT || !FLASH_HAS_EXPLICIT_ERASE
	default y
	help
	  Enable this option to provide support for littlefs on flash devices
	  (using the flash_map API).

config FS_LITTLEFS_BLK_DEV
	bool "Support for littlefs on block devices"
	help
	  Enable this option to provide support for littlefs on the block
	  devices (like for example SD card).

No changes made to overlay yet - just trying to get past not finding lfs.h. In the H7 includes file added:

-iwithprefixbefore/llext-edk/include/modules/fs/littlefs
-iwithprefixbefore/llext-edk/include/zephyr/subsys/fs/
-iwithprefixbefore/llext-edk/include/zephyr/modules/fs/littlefs

I did find that lfs.h is located in modules directory which is at the same level as zephyr sdk and arduino cores. Same directory as arduinoAPI.

Any suggestions to get this working or will littleFS not be supported.

EDIT: digging deeper it looks may have to modify the build flags in h7 variant? the includes.txt file is insufficient?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions