LittleFS External Configuration



Hello Support Team,

I hope this message finds you well.

I've been experimenting with the LittleFS sample available at the following link: LittleFS Sample Code. The sample works flawlessly with internal memory. However, after integrating it into my project, I made a few modifications to better suit my needs:

  • Utilized the MCU
  • Implemented external flash
  • Enabled BLE functionality

Despite my efforts, I am encountering issues with incorrect partition information for the LittleFS storage. Here are the details of my current configuration:

I found various article but no solution and also i see wrong partition information 

Fullscreen
1
2
3
4
5
6
7
8
littlefs_storage:
address: 0x00700000
end_address: 0x00800000
placement:
before:
- end
region: external_flash
size: 0x00100000
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// To get started, press Ctrl+Space (or Option+Esc) to bring up the completion menu and view the available nodes.
// You can also use the buttons in the sidebar to perform actions on nodes.
// Actions currently available include:
// * Enabling / disabling the node
// * Adding the bus to a bus
// * Removing the node
// * Connecting ADC channels
// For more help, browse the DeviceTree documentation at https://docs.zephyrproject.org/latest/guides/dts/index.html
// You can also visit the nRF DeviceTree extension documentation at https://nrfconnect.github.io/vscode-nrf-connect/devicetree/nrfdevicetree.html
/ {
zephyr,user {
io-channels = <&adc 0>;
};
};
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

my code 

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#define ARCHIVE_FILE_PATH "/lfs1/archive.dat"
#define PARTITION_NODE DT_NODELABEL(lfs1)
#if DT_NODE_EXISTS(PARTITION_NODE)
FS_FSTAB_DECLARE_ENTRY(PARTITION_NODE);
#else /* PARTITION_NODE */
FS_LITTLEFS_DECLARE_DEFAULT_CONFIG(storage);
static struct fs_mount_t lfs_storage_mnt = {
.type = FS_LITTLEFS,
.fs_data = &storage,
.storage_dev = (void *)FIXED_PARTITION_ID(storage_partition),
.mnt_point = "/lfs",
};
#endif /* PARTITION_NODE */
struct fs_mount_t *mp =
#if DT_NODE_EXISTS(PARTITION_NODE)
&FS_FSTAB_ENTRY(PARTITION_NODE)
#else
&lfs_storage_mnt
#endif
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

output

Issues Encountered:

  1. Enabling Bluetooth in the LittleFS sample app causes the LittleFS to NOT use external flash.*
  2. Problems with binding external flash (external flash + SPI + OTA). **

I have scoured through various articles, the Zephyr documentation, and forums, including Discord, but have yet to find a viable solution.

Could you please provide guidance or suggestions on resolving these issues?

Enabling Bluetooth to the Littlefs sample app will make the littlefs **NOT** use external flash. 

** External Flash get binding is Issue. (external flash + spi + OTA)