Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

samples: fs: littlefs: add sample on stm32h747i-disco board #64400

Conversation

mkaricheri
Copy link
Contributor

This adds the required conf and dts overlays required for the application on stm32h747i-disco board

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

Here is the console log on STM32H747i-disco board with this commit

*** Booting Zephyr OS build zephyr-v3.5.0-500-gc00ed3858b2a ***
Sample program to r/w files on littlefs
I: LittleFS version 2.5, disk version 2.0

uartI: FS at SDMMC: is 31116288 0x200-byte blocks with 512 cycle
I: sizes: rd 512 ; pr 512 ; ca 512 ; la 2048
:~$ /SDMMC:: bsize = 512 ; frsize = 512 ; blocks = 31116288 ; bfree = 31116284

Listing dir /SDMMC: ...
[FILE] boot_count (size = 1)
[FILE] pattern.bin (size = 547)
/SDMMC:/boot_count read count:58 (bytes: 1)
/SDMMC:/boot_count write new boot count 59: [wr:1]
------ FILE: /SDMMC:/pattern.bin ------
3b aa aa aa aa aa aa aa 3c aa aa aa aa aa aa aa
3d aa aa aa aa aa aa aa 3e aa aa aa aa aa aa aa
3f aa aa aa aa aa aa aa 40 aa aa aa aa aa aa aa
41 aa aa aa aa aa aa aa 42 aa aa aa aa aa aa aa
43 aa aa aa aa aa aa aa 44 aa aa aa aa aa aa aa
45 aa aa aa aa aa aa aa 46 aa aa aa aa aa aa aa
47 aa aa aa aa aa aa aa 48 aa aa aa aa aa aa aa
49 aa aa aa aa aa aa aa 4a aa aa aa aa aa aa aa
4b aa aa aa aa aa aa aa 4c aa aa aa aa aa aa aa
4d aa aa aa aa aa aa aa 4e aa aa aa aa aa aa aa
4f aa aa aa aa aa aa aa 50 aa aa aa aa aa aa aa
51 aa aa aa aa aa aa aa 52 aa aa aa aa aa aa aa
53 aa aa aa aa aa aa aa 54 aa aa aa aa aa aa aa
55 aa aa aa aa aa aa aa 56 aa aa aa aa aa aa aa
57 aa aa aa aa aa aa aa 58 aa aa aa aa aa aa aa
59 aa aa aa aa aa aa aa 5a aa aa aa aa aa aa aa
5b aa aa aa aa aa aa aa 5c aa aa aa aa aa aa aa
5d aa aa aa aa aa aa aa 5e aa aa aa aa aa aa aa
5f aa aa aa aa aa aa aa 60 aa aa aa aa aa aa aa
61 aa aa aa aa aa aa aa 62 aa aa aa aa aa aa aa
63 aa aa aa aa aa aa aa 64 aa aa aa aa aa aa aa
65 aa aa aa aa aa aa aa 66 aa aa aa aa aa aa aa
67 aa aa aa aa aa aa aa 68 aa aa aa aa aa aa aa
69 aa aa aa aa aa aa aa 6a aa aa aa aa aa aa aa
6b aa aa aa aa aa aa aa 6c aa aa aa aa aa aa aa
6d aa aa aa aa aa aa aa 6e aa aa aa aa aa aa aa
6f aa aa aa aa aa aa aa 70 aa aa aa aa aa aa aa
71 aa aa aa aa aa aa aa 72 aa aa aa aa aa aa aa
73 aa aa aa aa aa aa aa 74 aa aa aa aa aa aa aa
75 aa aa aa aa aa aa aa 76 aa aa aa aa aa aa aa
77 aa aa aa aa aa aa aa 78 aa aa aa aa aa aa aa
79 aa aa aa aa aa aa aa 7a aa aa aa aa aa aa aa

7b aa aa aa aa aa aa aa 7c aa aa aa aa aa aa aa
7d aa aa aa aa aa aa aa 7e aa aa aa aa aa aa aa
7f aa e4
I: /SDMMC: unmounted
/SDMMC: unmount: 0

@github-actions
Copy link

Hello @mkaricheri, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

Copy link
Member

@erwango erwango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pushing this change. This lokks globally ok, but some changes are required.
While you're at it, would you mind adding a test entry in sample.yaml to ensure this will be actually built regularly in CI ?

@mkaricheri mkaricheri force-pushed the latest/stm32h747i-disco-sdmmc-support branch 2 times, most recently from cdbf744 to ee16273 Compare October 26, 2023 18:37
@mkaricheri
Copy link
Contributor Author

sample.yaml

I did add an entry, but not sure. Please check the update

@mkaricheri mkaricheri force-pushed the latest/stm32h747i-disco-sdmmc-support branch from ee16273 to 57dd116 Compare October 26, 2023 19:00
Copy link
Member

@erwango erwango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making the changes.
Some additional comments (I'd like we can get to the minimum working configuration)

Comment on lines 2 to 3
CONFIG_SHELL=y
CONFIG_FILE_SYSTEM_SHELL=y
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you actually need those shell related config ?
(How is that specific to this board ?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed in my latest update

@@ -19,6 +19,7 @@ tests:
- mimxrt1160_evk_cm7
- lpcxpresso55s69_cpu0
- mr_canhubk3
- stm32h747i_disco_m7
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work. Since you need specific args to the build command, you need to specify them and hence create a new test variant:

  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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I don't know how to do this. Thanks for the snippet. I will add it,

samples/subsys/fs/littlefs/boards/stm32h747i_disco_m7.conf Outdated Show resolved Hide resolved
samples/subsys/fs/littlefs/boards/stm32h747i_disco_m7.conf Outdated Show resolved Hide resolved
@mkaricheri mkaricheri force-pushed the latest/stm32h747i-disco-sdmmc-support branch 2 times, most recently from 5efdcc8 to b4cc1e0 Compare October 27, 2023 18:57
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]>
@mkaricheri mkaricheri force-pushed the latest/stm32h747i-disco-sdmmc-support branch from b4cc1e0 to 2691d9a Compare October 27, 2023 21:14
@mkaricheri
Copy link
Contributor Author

@erwango I have reworked the commit with all of your comments addressed per my understanding. Could you review when you have a chance and approve or let me know what else is needed?

Thanks
Murali

Copy link
Member

@erwango erwango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes.
Approved

@mkaricheri
Copy link
Contributor Author

Hi @de-nordic would you please review and approve if this looks good? Thanks

Copy link
Collaborator

@de-nordic de-nordic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LittleFS sample configuration OK.

@carlescufi carlescufi merged commit b235372 into zephyrproject-rtos:main Nov 3, 2023
14 checks passed
Copy link

github-actions bot commented Nov 3, 2023

Hi @mkaricheri!
Congratulations on getting your very first Zephyr pull request merged 🎉🥳. This is a fantastic achievement, and we're thrilled to have you as part of our community!

To celebrate this milestone and showcase your contribution, we'd love to award you the Zephyr Technical Contributor badge. If you're interested, please claim your badge by filling out this form: Claim Your Zephyr Badge.

Thank you for your valuable input, and we look forward to seeing more of your contributions in the future! 🪁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants