-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Introduce auto-listing of FlashArea Partitions #16874
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
Conversation
00b7051
to
80e44de
Compare
This is a great addition and really helps with identifying partitions. Tested on the nrf5340DK (8MB qpsi external flash) External flash added as 'my_flash'
In micropython the partition is now visible by label.
and can be mounted with
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty cool. Will test this later on a frdm_mcxn947
ports/zephyr/zephyr_storage.c
Outdated
#define FLASH_AREA_DEFINE(part) COND_CODE_1(DT_NODE_HAS_STATUS_OKAY(DT_MTD_FROM_FIXED_PARTITION(part)), \ | ||
(FLASH_AREA_DEFINE_DEFINE(part)), ()) | ||
|
||
#define FOREACH_PARTITION(n) DT_FOREACH_CHILD(DT_DRV_INST(n), FLASH_AREA_DEFINE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can do without DT_DRV_COMPAT pretty easily. Just change this to
#define FOREACH_PARTITION(n) DT_FOREACH_CHILD(DT_INST(n, fixed_partitions), FLASH_AREA_DEFINE)
and remove DT_DRV_COMPAT. I think this makes things actually easier to understand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks better yea, will look into it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That does not work, but i figured another slightly different solution
80e44de
to
64840be
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks very useful!
What do you think about adding something brief about it in the "Flash Area" section of docs/zephyr/quickref.rst?
64840be
to
09f12c2
Compare
Yes, I think this is a good idea. |
Is this ok? |
6a063c0
to
c59bcdc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, thanks, that addition to the quickref is good.
This enables listing all flash area partitions automagically instead of just sotrage_partitions. It uses the label, and the ID when not present. Signed-off-by: Vdragon <mail@massdriver.space>
Signed-off-by: Vdragon <mail@massdriver.space>
c59bcdc
to
ced7ebb
Compare
Summary
This enables listing all flash area partitions automagically instead of just sotrage_partitions. It uses the label, and the ID when not present.
Testing
Tested on nrf52840