-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: drivers: disk: add test for the FFAT disk
Add FAT16 and FAT32 tests for the FFAT disk using ELM FAT file system support. Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
- Loading branch information
1 parent
a93c867
commit 38d33bc
Showing
5 changed files
with
622 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright (c) 2023 Nordic Semiconductor ASA | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
cmake_minimum_required(VERSION 3.20.0) | ||
|
||
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) | ||
project(test_ffat) | ||
|
||
target_sources(app PRIVATE | ||
src/main.c | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
* Copyright (c) 2023 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/ { | ||
ffatdisk0 { | ||
compatible = "zephyr,ffat-disk"; | ||
disk-name = "RAM"; | ||
sector-size = <512>; | ||
sector-count = <32680>; | ||
sector-per-cluster = <1>; | ||
}; | ||
|
||
ffatdisk1 { | ||
compatible = "zephyr,ffat-disk"; | ||
disk-name = "NAND"; | ||
sector-size = <512>; | ||
sector-count = <262144>; | ||
sector-per-cluster = <4>; | ||
}; | ||
|
||
ffatdisk2 { | ||
compatible = "zephyr,ffat-disk"; | ||
disk-name = "CF"; | ||
sector-size = <1024>; | ||
sector-count = <524288>; | ||
sector-per-cluster = <8>; | ||
}; | ||
|
||
ffatdisk3 { | ||
compatible = "zephyr,ffat-disk"; | ||
disk-name = "SD"; | ||
sector-size = <4096>; | ||
sector-count = <1048576>; | ||
sector-per-cluster = <32>; | ||
}; | ||
|
||
ffatdisk4 { | ||
compatible = "zephyr,ffat32-disk", "zephyr,ffat-disk"; | ||
disk-name = "SD2"; | ||
sector-size = <512>; | ||
sector-count = <131072>; | ||
sector-per-cluster = <1>; | ||
}; | ||
|
||
ffatdisk5 { | ||
compatible = "zephyr,ffat32-disk", "zephyr,ffat-disk"; | ||
disk-name = "USB"; | ||
sector-size = <512>; | ||
sector-count = <524288>; | ||
sector-per-cluster = <4>; | ||
}; | ||
|
||
ffatdisk6 { | ||
compatible = "zephyr,ffat32-disk", "zephyr,ffat-disk"; | ||
disk-name = "USB2"; | ||
sector-size = <1024>; | ||
sector-count = <1048576>; | ||
sector-per-cluster = <8>; | ||
}; | ||
|
||
ffatdisk7 { | ||
compatible = "zephyr,ffat32-disk", "zephyr,ffat-disk"; | ||
disk-name = "USB3"; | ||
sector-size = <4096>; | ||
sector-count = <16777216>; | ||
sector-per-cluster = <64>; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Copyright (c) 2023 Nordic Semiconductor ASA | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
CONFIG_LOG=y | ||
CONFIG_ZTEST=y | ||
|
||
CONFIG_DISK_ACCESS=y | ||
CONFIG_FILE_SYSTEM=y | ||
CONFIG_FAT_FILESYSTEM_ELM=y | ||
CONFIG_FS_FATFS_MOUNT_MKFS=n | ||
CONFIG_FS_FATFS_MIN_SS=512 | ||
CONFIG_FS_FATFS_MAX_SS=4096 |
Oops, something went wrong.