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

boards: stm: nucleo_h723zg: added flash partition to work with mcuboot #76536

Conversation

thomasbouston
Copy link

Closes #75425
Add a partition for flash memory as follows:

  • boot_partition: 128k
  • slot0_partition: 384k
  • slot1_partition: 384k
  • storage_partition: 128k

Added code partitioning for ST Nucleo H723ZG board.
Defined flash partitions including "mcuboot," "image-0,", "image-1"
and "storage".

Signed-off-by: Thomas Bouston <[email protected]>
Copy link
Collaborator

@nordicjm nordicjm left a comment

Choose a reason for hiding this comment

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

Partitions will work but are not optimal, assuming sector size is 128KiB and you are using swap using move, slot0 needs 1 sector to move sectors up by and needs 1 sector to hold swap status and flags, thus slot0 is reduced to 384 - 128 - 128 = 128KiB, so as can be seen having 384KiB in the second slot also means 256KiB of that slot can never be used.

@erwango
Copy link
Member

erwango commented Aug 2, 2024

Partitions will work but are not optimal, assuming sector size is 128KiB and you are using swap using move, slot0 needs 1 sector to move sectors up by and needs 1 sector to hold swap status and flags, thus slot0 is reduced to 384 - 128 - 128 = 128KiB, so as can be seen having 384KiB in the second slot also means 256KiB of that slot can never be used.

@nordicjm Thanks for the input. Is there a documentation somewhere which explains MCUBoot requirements around partitions vs sectors sizes to help tailoring flash partitions ?

@nordicjm
Copy link
Collaborator

nordicjm commented Aug 2, 2024

Partitions will work but are not optimal, assuming sector size is 128KiB and you are using swap using move, slot0 needs 1 sector to move sectors up by and needs 1 sector to hold swap status and flags, thus slot0 is reduced to 384 - 128 - 128 = 128KiB, so as can be seen having 384KiB in the second slot also means 256KiB of that slot can never be used.

@nordicjm Thanks for the input. Is there a documentation somewhere which explains MCUBoot requirements around partitions vs sectors sizes to help tailoring flash partitions ?

In the upstream documentation yes: https://docs.mcuboot.com/design.html

@d3zd3z
Copy link
Collaborator

d3zd3z commented Aug 29, 2024

I consider that you need two sectors reserved to be a bug. There is no particular reason that the status and the extra area can't be in the extra area, but as you've discovered, it apparently doesn't work.

@d3zd3z
Copy link
Collaborator

d3zd3z commented Aug 29, 2024

I've created mcu-tools/mcuboot#2052 to track this.

@erwango
Copy link
Member

erwango commented Aug 29, 2024

@thomasbouston Following discussion with @nordicjm and @d3zd3z, it's finally better, as more optimized, to re-instantiate the scratch partition. My bad for the initially wrong feedback.
Do you plan to continue this PR ?

@nordicjm
Copy link
Collaborator

nordicjm commented Sep 2, 2024

Swap using scratch makes no sense here at all, you would need to use a sector for scratch, and you would need a sector for the image flags, so you're not gaining anything.

@thomasbouston
Copy link
Author

@thomasbouston Following discussion with @nordicjm and @d3zd3z, it's finally better, as more optimized, to re-instantiate the scratch partition. My bad for the initially wrong feedback. Do you plan to continue this PR ?

Hi, I'm sorry but I don't have time to handle it anymore. If you could take care of it, that would be ideal.

@erwango
Copy link
Member

erwango commented Sep 18, 2024

Hi, I'm sorry but I don't have time to handle it anymore. If you could take care of it, that would be ideal.

Not sure we'll have time neither. Let's close it, it can be reopened at anytime.

@erwango erwango closed this Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: STM32 ST Micro STM32
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nucleo H723ZG : add a flash memory partition to use MCUboot
5 participants