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

MAX_PART_SIZE (16MB) should not apply to data partitions. #34

Closed
AVee opened this issue May 3, 2024 · 0 comments · Fixed by #35
Closed

MAX_PART_SIZE (16MB) should not apply to data partitions. #34

AVee opened this issue May 3, 2024 · 0 comments · Fixed by #35

Comments

@AVee
Copy link
Contributor

AVee commented May 3, 2024

In the validate function in lib.rs there's a check that says partition sizes cannot be larger then 16MB:

esp-idf-part/src/lib.rs

Lines 320 to 324 in 3774056

// Partitions cannot exceed 16MB; see:
// https://github.com/espressif/esp-idf/blob/c212305/components/bootloader_support/src/esp_image_format.c#L158-L161
if partition.size() > MAX_PART_SIZE {
return Err(Error::PartitionTooLarge(partition.name()));
}

This check should not apply to data partitions which can be used even when they exceed 16MB. I think this check should be
if partition.ty() == Type::App && partition.size() > MAX_PART_SIZE {

The IDF bootloader code referenced there does indeed check this 16MB limit, but if I read that code correctly it only does so for the partition it tries to boot from. If I write a partition table manually using espflash write-bin 0x8000 partitions.bin to a S3 with 32MB flash I can use a 28MB data partition just fine.

@github-project-automation github-project-automation bot moved this to Todo in esp-rs May 3, 2024
AVee added a commit to AVee/esp-idf-part that referenced this issue May 3, 2024
The bootloader will crash when starting from an app partition which exceeds
16MB, but larger sizes are fine for data partitions.

Fixes esp-rs#34
@github-project-automation github-project-automation bot moved this from Todo to Done in esp-rs Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant