Skip to content

Commit d5e3215

Browse files
de-nordicnashif
authored andcommitted
samples: fs: fat_fs: Add RAM disk sample for nrf52840dk
Add configuration for nrf52840dk that allows to create RAM disk; this configuration does not reserve special region in RAM using DTS but uses automatic buffer allocation, by RAM Disk Drivers, according to RAM disk specification in DTS. Signed-off-by: Dominik Ermel <[email protected]>
1 parent 63692c1 commit d5e3215

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#
2+
# Copyright (c) 2024 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
7+
CONFIG_DISK_DRIVERS=y
8+
CONFIG_DISK_DRIVER_RAM=y
9+
CONFIG_DISK_DRIVER_FLASH=n
10+
# There may be no files on internal SoC flash, so this Kconfig
11+
# options has ben enabled to create some if listing does not
12+
# find in the first place.
13+
CONFIG_FS_SAMPLE_CREATE_SOME_ENTRIES=y
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Copyright (c) 2024 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/ {
8+
msc_disk0 {
9+
status="okay";
10+
compatible = "zephyr,ram-disk";
11+
/* Sample, to make things easier, mounts all FAT
12+
* systems at "SD".
13+
*/
14+
disk-name = "SD";
15+
/* Disk size is 64kB, 128 sectors of 512B, the minimal
16+
* required by FAT FS.
17+
*/
18+
sector-size = <512>;
19+
sector-count = <128>;
20+
};
21+
};

samples/subsys/fs/fs_sample/sample.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ tests:
3131
sample.filesystem.fat_fs.nrf52840dk_nrf52840:
3232
build_only: true
3333
platform_allow: nrf52840dk/nrf52840
34+
sample.filesystem.fat_fs.nrf52840dk_nrf52840_ram_disk:
35+
build_only: true
36+
platform_allow: nrf52840dk/nrf52840
37+
extra_args:
38+
- OVERLAY_CONFIG=boards/nrf52840dk_nrf52840_ram_disk.conf
39+
- DTC_OVERLAY_FILE=boards/nrf52840dk_nrf52840_ram_disk.overlay
3440
sample.filesystem.fat_fs.nrf52840dk_nrf52840.qspi:
3541
build_only: true
3642
platform_allow: nrf52840dk/nrf52840

0 commit comments

Comments
 (0)