Skip to content

Conversation

soburi
Copy link
Member

@soburi soburi commented Feb 1, 2023

Enable embedding binary info to flash.
As a default, information collects from the build configuration.

It can override by the Kconfig configurations, such as

CONFIG_RP2_BINARY_INFO_PROGRAM_NAME_OVERRIDE=y
CONFIG_RP2_BINARY_INFO_PROGRAM_NAME="my program name"

Signed-off-by: TOKITA Hiroshi [email protected]


This PR support basic feature of pico's binary info.
It works with picotool (https://github.com/raspberrypi/picotool) to show configuration information.
(by picotool show -a)
Other feature supporting is not yet.

@soburi soburi requested review from nashif and yonsch as code owners February 1, 2023 03:59
@soburi soburi force-pushed the pico_binary_info branch 3 times, most recently from 463304d to 93e30d2 Compare February 1, 2023 04:55
@soburi soburi changed the title soc: arm: rpi_pico: Add basic support for binary info feature soc: arm: rpi_pico: Add basic support for binary info feature Feb 1, 2023
@soburi soburi force-pushed the pico_binary_info branch 2 times, most recently from cdbad46 to 71495bb Compare February 1, 2023 09:26
@soburi soburi added the platform: Raspberry Pi Pico Raspberry Pi Pico (RPi Pico) label Feb 1, 2023
Copy link
Contributor

@mbolivar-nordic mbolivar-nordic left a comment

Choose a reason for hiding this comment

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

Thank you for your work!

I am not sure about the CMake variable changes here. I'd like @tejlmand to confirm it is OK.

@yonsch
Copy link
Contributor

yonsch commented Feb 2, 2023

Before I comment on the changes themselves - I think this feature would be beneficial for all Zephyr users, not only for the pico. Being able to embed strings in a binary where they're accessable outside of the image is very useful. The main use case I can think of is a bootloader and an app being able to read each other's versions. Since this would require some more work I'm not sure it should block this PR for the meantime, but that is something to keep in mind.
I should also note that pico's binary_info can be used to store pin configurations, but I can't think of a use case for that.

@soburi soburi force-pushed the pico_binary_info branch 2 times, most recently from d0736a3 to 480ff02 Compare February 2, 2023 09:31
@soburi
Copy link
Member Author

soburi commented Feb 4, 2023

@yonsch

Before I comment on the changes themselves - I think this feature would be beneficial for all Zephyr users, not only for the pico. Being able to embed strings in a binary where they're accessable outside of the image is very useful. The main use case I can think of is a bootloader and an app being able to read each other's versions. Since this would require some more work I'm not sure it should block this PR for the meantime, but that is something to keep in mind. I should also note that pico's binary_info can be used to store pin configurations, but I can't think of a use case for that.

The 'self-reference'-ish feature is interresting suggestion.
But I also think there are some difficult point.
In the Pico's scope, the information mainly read it by BOOTSEL mode.
This is probably the same for other MCUs, and I think this function is strongly related to the "recovery mode" specification.
If there are other MCUs with similar functions, it may be possible to define an abstract interface.
If I can draw a big picture, I think it would wonderful if it could define as uf2 meta information. (Create a .uf2meta section with a linker and have the same information there. It can handle with common specification by recovery program and firmware itself!)

@yonsch
Copy link
Contributor

yonsch commented Feb 5, 2023

@soburi I've created a quick demonstration of what I was thinking of: #54464

@MaureenHelm
Copy link
Member

dev-review: depends on #54464

@github-actions
Copy link

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions
Copy link

github-actions bot commented Aug 2, 2023

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Aug 2, 2023
@cfriedt
Copy link
Member

cfriedt commented Aug 3, 2023

@soburi - I assume that once #54464 is merged, work on this will continue

@soburi
Copy link
Member Author

soburi commented Aug 3, 2023

@cfriedt

I assume that once #54464 is merged, work on this will continue

That's right. Perhaps I will have to rethink the design accordingly.

@github-actions github-actions bot removed the Stale label Aug 4, 2023
@yonsch
Copy link
Contributor

yonsch commented Aug 4, 2023

@soburi Why does this depend on #54464?
Bindesc was supposed to be a standard Zephyr replacement for binary info.
Binary info would still be useful for someone who needs to specifically use the pico format, e.g. if a bootloader expects binary info descriptors.
I think we can treat them as if they are mutually exclusive, as they serve the same purpose, and proceed with this PR regardless of bindesc.
Unless, you somehow see them coexisting somehow, which would require more planning.

@soburi soburi changed the title soc: arm: rpi_pico: Add basic support for binary info feature soc: arm: rpi_pico: Add support for binary info feature Dec 28, 2024
Copy link

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Feb 27, 2025
@soburi soburi removed the Stale label Mar 3, 2025
Copy link

github-actions bot commented May 3, 2025

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label May 3, 2025
@github-actions github-actions bot closed this May 17, 2025
@soburi soburi reopened this May 29, 2025
Copy link

@github-actions github-actions bot removed the Stale label May 30, 2025
Copy link

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Jul 31, 2025
Copy link
Member

Choose a reason for hiding this comment

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

Could this potentially be handled by a linker script like rom_start?

@github-actions github-actions bot removed the Stale label Aug 1, 2025
Copy link

github-actions bot commented Oct 1, 2025

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Oct 1, 2025
@soburi soburi force-pushed the pico_binary_info branch 2 times, most recently from 768b887 to c20f3c8 Compare October 1, 2025 22:11
@github-actions github-actions bot removed the Stale label Oct 2, 2025
@soburi soburi force-pushed the pico_binary_info branch 3 times, most recently from d13ceb9 to 0a1d7b5 Compare October 5, 2025 11:30
soburi added 2 commits October 5, 2025 22:48
The binary info feature references `boot_stage2` and `pico_binary_info`.
Add these to include dirs.

Signed-off-by: TOKITA Hiroshi <[email protected]>
Use the definition of PICO_NO_BINARY_INFO if it already exists,
set it as 1 if not so.

Signed-off-by: TOKITA Hiroshi <[email protected]>
@soburi soburi force-pushed the pico_binary_info branch 2 times, most recently from 6d85212 to 37fad8f Compare October 5, 2025 15:08
Enable embedding binary info to flash.
As a default, information collects from the build configuration.

It can override by the Kconfig configurations, such as

```
CONFIG_RP2_BINARY_INFO_PROGRAM_NAME_OVERRIDE=y
CONFIG_RP2_BINARY_INFO_PROGRAM_NAME="my program name"
```

Signed-off-by: TOKITA Hiroshi <[email protected]>
Copy link

sonarqubecloud bot commented Oct 6, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: Raspberry Pi Pico Raspberry Pi Pico (RPi Pico)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants