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

Add section attributes to combined firmware blobs and metadata #97

Closed
wants to merge 2 commits into from

Commits on Nov 8, 2023

  1. Configuration menu
    Copy the full SHA
    87a7627 View commit details
    Browse the repository at this point in the history

Commits on Nov 9, 2023

  1. Add section attributes to combined firmware blobs and metadata

    This change will not do much for regular builds, but it allows to put the
    firmware blob in a specific flash area.
    
    In cases where multiple firmware versions run on the same device, this allows
    re-use of the firmware blob. On such case is picowota, the Raspberry Pi Pico W
    OTA flash bootloader. Until now, picowota users effectively have the firmware
    on their devices twice.
    
    Another use case is that in a firmware update, the CYW firmware can be left
    untouched.
    
    The pointer to the blob is put in a struct that also contains some metadata,
    which is put in a separate section to allow linker script writers to prepend
    the binary blob with something like a header.
    
    To store the cyw firmware at a particular location in flash, these changes
    can be made to the linker script:
    
    MEMORY {
    ...
    FLASH_FW_CYW(rx):            ORIGIN = 0x10040000, LENGTH = 256k
    ...
    }
    
    and
    
    SECTIONS {
    ...
        .fw_cyw43 : {
            . = ALIGN(4k);
            KEEP(*(.fw_cyw43.meta))
            . = ALIGN(512);
            *(.fw_cyw43.blob)
        } > FLASH_FW_CYW
    ...
    }
    mvds00 committed Nov 9, 2023
    Configuration menu
    Copy the full SHA
    e0e5dbb View commit details
    Browse the repository at this point in the history