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 authored and carlescufi committed Nov 3, 2023
1 parent 396e1ce commit b235372
Show file tree
Hide file tree
Showing 6 changed files with 62 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
3 changes: 3 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,3 @@
CONFIG_SDMMC_STM32_HWFC=y
CONFIG_FS_LITTLEFS_FC_HEAP_SIZE=2048
CONFIG_MAIN_STACK_SIZE=2048
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 <www.sandc.com>
*
* 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
6 changes: 6 additions & 0 deletions samples/subsys/fs/littlefs/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,9 @@ tests:
extra_args:
- OVERLAY_CONFIG=boards/nrf52840dk_nrf52840_qspi.conf
- DTC_OVERLAY_FILE=boards/nrf52840dk_nrf52840_qspi.overlay
sample.filesystem.littlefs.stm32h747i_disco_m7_sdmmc:
build_only: true
platform_allow: stm32h747i_disco_m7
extra_args:
- OVERLAY_CONFIG=boards/stm32h747i_disco_m7.conf
- CONF_FILE=prj_blk.conf

0 comments on commit b235372

Please sign in to comment.