Skip to content

zephyr: Read erase block size from dts instead of using fixed value. #17861

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ant9000
Copy link

@ant9000 ant9000 commented Aug 7, 2025

Summary

On my Apollo3 board, which is supported by Zephyr, I can create a filesystem in flash but cannot get Micropython automount to work.

I've tracked the issue down to the fact that not all boards use the 4096 byte erase block size that MP is assuming in vfs_init().

My patch extracts the correct configuration value directly from the devicetree, so it should work out of the box for every Zephyr board (with a flash).

Testing

With my modification filesystem automount works correctly for my board, which needs 8192 as erase block size as specified in the devicetree configuration.

I've checked with a script, and AFAICT all Zephyr boards with a zephyr,flash compatible node have the required property explicitly defined in the devicetree.

Signed-off-by: Antonio Galea <antonio.galea@gmail.com>
@dpgeorge
Copy link
Member

This is a nice improvement, but I found at least two boards that no longer build: beagleconnect_freedom and nrf9151dk.

Is it possible to only use this DT setting if it exists?

Signed-off-by: Antonio Galea <antonio.galea@gmail.com>
@ant9000
Copy link
Author

ant9000 commented Aug 20, 2025

Is it possible to only use this DT setting if it exists?

I've added a check: if erase_block_size property is not defined, the code will use 4096 as default (the original fixed value). Now MP for both beagleconnect_freedom and nrf9151dk boards does compile correctly.

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.

2 participants