Skip to content

Conversation

@will-v-pi
Copy link
Contributor

Currently the descriptions for rom_load_partition_table, rom_pick_ab_partition, rom_get_uf2_target_partition and rom_chain_image document the minimum workarea size as 3064, with 3K recommended. This is too small, as the actual size required is 3264, so 3.25K should be recommended instead.

The minimum size was obtained with the following for loop in a binary:

for (int i=0xc00; i <= 0x1000; i++) {
    uint8_t* workarea = malloc(i);
    int ret = rom_load_partition_table(workarea, i, true);
    free(workarea);
    if (ret != -13) {
        printf("PT Load Ret %d, size %d\n", ret, i);
        break;
    }
}

@kilograham kilograham merged commit 74db3c2 into raspberrypi:develop Nov 20, 2024
4 checks passed
@lurch
Copy link
Contributor

lurch commented Nov 20, 2024

Currently the descriptions for rom_load_partition_table, rom_pick_ab_partition, rom_get_uf2_target_partition and rom_chain_image document the minimum workarea size

I forgot to ask earlier - do each of these four functions definitely have the same minimum workarea size?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants