Skip to content

Commit

Permalink
samples: fs: littlefs: add sample on stm32h747i-disco board
Browse files Browse the repository at this point in the history
This adds the required conf and dts overlays required for the
application on stm32h747i-disco board.

Also moved CONFIG_SDMMC_STM32_HWFC option from prj_blk.conf to
nucleo_h743zi_blk.conf as that is STM specific option.

Build the application as

west build -p always -b stm32h747i_disco_m7 \
samples/subsys/fs/littlefs/ -- \
-DOVERLAY_CONFIG=boards/stm32h747i_disco_m7.conf -DCONF_FILE=prj_blk.conf

Signed-off-by: Murali Karicheri <[email protected]>
  • Loading branch information
mkaricheri committed Oct 26, 2023
1 parent e364f29 commit 57dd116
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 1 deletion.
14 changes: 14 additions & 0 deletions boards/arm/stm32h747i_disco/stm32h747i_disco_m7.dts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@
status = "okay";
};

&pll2 {
div-m = <5>;
mul-n = <96>;
div-p = <2>;
div-q = <4>;
div-r = <10>;
clocks = <&clk_hse>; /* Assuming 25MHz HSE */
status = "okay";
};

&rcc {
clocks = <&pll>;
clock-frequency = <DT_FREQ_M(400)>;
Expand Down Expand Up @@ -202,8 +212,12 @@ zephyr_udc0: &usbotg_hs {

&sdmmc1 {
status = "okay";
clocks = <&rcc STM32_CLOCK_BUS_AHB3 0x00010000>,
<&rcc STM32_SRC_PLL2_R SDMMC_SEL(1)>;
pinctrl-0 = <&sdmmc1_d0_pc8 &sdmmc1_d1_pc9
&sdmmc1_d2_pc10 &sdmmc1_d3_pc11
&sdmmc1_d4_pb8 &sdmmc1_d5_pb9
&sdmmc1_d6_pc6 &sdmmc1_d7_pc7
&sdmmc1_ck_pc12 &sdmmc1_cmd_pd2>;
pinctrl-names = "default";
cd-gpios = <&gpioi 8 GPIO_ACTIVE_LOW>;
Expand Down
1 change: 1 addition & 0 deletions samples/subsys/fs/littlefs/boards/nucleo_h743zi_blk.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ CONFIG_MAIN_STACK_SIZE=2048
CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=8192

CONFIG_FS_LITTLEFS_FC_HEAP_SIZE=8192
CONFIG_SDMMC_STM32_HWFC=y
10 changes: 10 additions & 0 deletions samples/subsys/fs/littlefs/boards/stm32h747i_disco_m7.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=8192
CONFIG_SHELL=y
CONFIG_FILE_SYSTEM_SHELL=y
CONFIG_SDMMC_STM32_HWFC=y
CONFIG_SHELL_STACK_SIZE=4096
CONFIG_HEAP_MEM_POOL_SIZE=4096
CONFIG_FS_LITTLEFS_FC_HEAP_SIZE=8192
CONFIG_MAIN_STACK_SIZE=4096
CONFIG_COMMON_LIBC_MALLOC=y
CONFIG_CACHE_MANAGEMENT=y
38 changes: 38 additions & 0 deletions samples/subsys/fs/littlefs/boards/stm32h747i_disco_m7.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright (c) 2023 S&C Electric Company
*
* SPDX-License-Identifier: Apache-2.0
*/

/delete-node/ &storage_partition;

/ {
fstab {
compatible = "zephyr,fstab";
lfs1: lfs1 {
compatible = "zephyr,fstab,littlefs";
read-size = <512>;
prog-size = <512>;
cache-size = <512>;
lookahead-size = <4096>;
block-cycles = <512>;
partition = <&storage_partition>;
mount-point = "/lfsemmc";
};
};
};

&sdmmc1 {
sdmmc {
compatible = "zephyr,sdmmc-disk";
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
storage_partition: partition@0 {
label = "storage";
reg = <0x0 DT_SIZE_M(2048)>;
};
};
};
};
1 change: 0 additions & 1 deletion samples/subsys/fs/littlefs/prj_blk.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ CONFIG_FS_LITTLEFS_BLK_DEV=y
CONFIG_APP_LITTLEFS_STORAGE_BLK_SDMMC=y

CONFIG_NOCACHE_MEMORY=y
CONFIG_SDMMC_STM32_HWFC=y
1 change: 1 addition & 0 deletions samples/subsys/fs/littlefs/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ tests:
- mimxrt1160_evk_cm7
- lpcxpresso55s69_cpu0
- mr_canhubk3
- stm32h747i_disco_m7
integration_platforms:
- nrf52840dk_nrf52840
sample.filesystem.littlefs.nrf52840dk_spi:
Expand Down

0 comments on commit 57dd116

Please sign in to comment.