Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[STM32H7] Provisioning fs reformat#957

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@andreagilardoni
Copy link
Contributor

Changing flash partitioning scheme in order to make room for a KV store

@andreagilardoniandreagilardoni changed the titleProvisioning fs reformat[STM32H7] Provisioning fs reformatSep 23, 2024
Copy link
Contributor

@pennampennam left a comment

Choose a reason for hiding this comment

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

There is no need to erase the whole flash before repartitioning; you only need to erase the MBR.

root.init();
root.erase(0x0, root.get_erase_size());

Furthermore if you keep the KVstorage in partition 3 for both schemes you should be able switch between them without erase the MBR at all

mbed::MBRBlockDevice::partition(&root, 1, 0x0B, 0, 1024 * 1024);if(default_scheme) {  mbed::MBRBlockDevice::partition(&root, 4, 0x0B, 14 * 1024 * 1024, 14 * 1024 * 1024);  mbed::MBRBlockDevice::partition(&root, 3, 0x0B, 13 * 1024 * 1024, 14 * 1024 * 1024);  mbed::MBRBlockDevice::partition(&root, 2, 0x0B, 1024 * 1024, 13 * 1024 * 1024);  // use space from 15.5MB to 16 MB for another fw, memory mapped} else {  mbed::MBRBlockDevice::partition(&root, 2, 0x0B, 1024 * 1024, 6 * 1024 * 1024);  mbed::MBRBlockDevice::partition(&root, 3, 0x0B, 6 * 1024 * 1024, 7 * 1024 * 1024);  mbed::MBRBlockDevice::partition(&root, 4, 0x0B, 7 * 1024 * 1024, 14 * 1024 * 1024);  // use space from 15.5MB to 16 MB for another fw, memory mapped}

andreagilardoni reacted with thumbs up emoji
@andreagilardoni
Copy link
ContributorAuthor

Furthermore if you keep the KVstorage in partition 3 for both schemes you should be able switch between them without erase the MBR at all

I tried switching from this scheme to the older one and something bad happened and the only way to make it work properly was to erase the partitions. I am double checking this.

@andreagilardoni
Copy link
ContributorAuthor

I confirm that without the MBR erase I cannot use the old partitioning scheme.
@pennam do you think it is better to split this PR into 2? the first one with just the MBR erase command and the other with the new partitioning scheme, so that one can rollback with this fix present.

@andreagilardoniandreagilardoniforce-pushed theprovisioning-fs-reformat branch 2 times, most recently from1d22ce2 to6a309b7CompareMarch 11, 2025 16:46
@andreagilardoni
Copy link
ContributorAuthor

andreagilardoni commentedMar 11, 2025
edited
Loading

@pennam

There is no need to erase the whole flash before repartitioning; you only need to erase the MBR.

What do you think about the way I wrote the MBR table clean?

Furthermore if you keep the KVstorage in partition 3 for both schemes you should be able switch between them without erase the MBR at all

Now partition 3 is being used for user data, this would mean that we need either to switch user data partition to 4, or distinguish between the two cases when using kvstore. I prefer to keep it to partition number 4.

@megacct
Copy link
Contributor

@andreagilardoni@pennam Hi, a couple of us have tried, unsuccessfully, to scrub the MBR in order to change the partition layout. Detail herehttps://forum.arduino.cc/t/how-to-partition-giga-flash-similar-to-original-factory-defaults/1349759. I'm sure we were doing something wrong but it may be worth double-double-checking that the erase in this commit is doing what's expected.

andreagilardoni reacted with heart emoji

@andreagilardoni
Copy link
ContributorAuthor

I would like to point out that when repartitioning, for the user or ota block devices some files can be corrupted if they lie in the area that will be used for partition 4.

@pennam
Copy link
Contributor

superseded by#1058

@pennampennam closed thisMay 6, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@pennampennampennam requested changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@andreagilardoni@megacct@pennam

[8]ページ先頭

©2009-2025 Movatter.jp