Skip to content

soc: arm: rpi_pico: Add support for binary info feature #54290

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

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 tokita.hiroshi@gmail.com


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
Collaborator

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
Collaborator

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
Collaborator

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.

@zephyrbot
Copy link
Collaborator

zephyrbot commented Sep 25, 2024

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff

All manifest checks OK

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@zephyrbot zephyrbot added manifest DNM This PR should not be merged (Do Not Merge) labels Sep 25, 2024
Copy link

github-actions bot commented Dec 6, 2024

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 Dec 6, 2024
@zephyrbot zephyrbot removed manifest manifest-hal_rpi_pico DNM This PR should not be merged (Do Not Merge) labels Dec 19, 2024
@github-actions github-actions bot removed the Stale label Dec 20, 2024
@soburi soburi force-pushed the pico_binary_info branch 3 times, most recently from 4d11b36 to 3478ed8 Compare December 25, 2024 04:10
soburi and others added 4 commits December 25, 2024 21:00
Adds `DT_CHILD_BY_IDX` to get the child elements of a node by index.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
The binary info feature references `boot_stage2` and `pico_binary_info`.
Add these to include dirs.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Use the definition of PICO_NO_BINARY_INFO if it already exists,
set it as 1 if not so.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
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 <tokita.hiroshi@fujitsu.com>
@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
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.

6 participants