-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
base: main
Are you sure you want to change the base?
Conversation
463304d to
93e30d2
Compare
binary info featurecdbad46 to
71495bb
Compare
71495bb to
25a1cc4
Compare
mbolivar-nordic
left a comment
There was a problem hiding this 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.
|
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. |
d0736a3 to
480ff02
Compare
The 'self-reference'-ish feature is interresting suggestion. |
|
dev-review: depends on #54464 |
|
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. |
|
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. |
|
@soburi Why does this depend on #54464? |
3c9082d to
e759679
Compare
e759679 to
1b204f2
Compare
|
| When this feature is enabled, pinctrl groups are restricted to consisting | ||
| of pins with a single rpi_pico function. | ||
| In other words, SPI's MISO and MOSI can be in the same group, but I2C's | ||
| SDA cannot be included in this group. This is rarely an issue in normal use, | ||
| and can be resolved by dividing them into separate groups. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it now always pack pinctrl data into the binary? Could you please give a binary size comparison, as this seems to increase it for quite a bit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0x00000000100044c8 __binary_info_start = .(SORT_BY_ALIGNMENT(.binary_info.keep.))
.binary_info.keep.__bi_ptr51
0x00000000100044c8 0x4 zephyr/libzephyr.a(binary_info.c.obj)
.binary_info.keep.__bi_ptr43
0x00000000100044cc 0x4 zephyr/libzephyr.a(binary_info.c.obj)
.binary_info.keep.__bi_ptr38
0x00000000100044d0 0x4 zephyr/libzephyr.a(binary_info.c.obj)
.binary_info.keep.__bi_ptr33
0x00000000100044d4 0x4 zephyr/libzephyr.a(binary_info.c.obj)
.binary_info.keep.__bi_ptr29
0x00000000100044d8 0x4 zephyr/libzephyr.a(binary_info.c.obj)
.binary_info.keep.__bi_ptr25
0x00000000100044dc 0x4 zephyr/libzephyr.a(binary_info.c.obj)
.binary_info.keep.__bi_ptr21
0x00000000100044e0 0x4 zephyr/libzephyr.a(binary_info.c.obj)
.binary_info.keep.__bi_ptr17
0x00000000100044e4 0x4 zephyr/libzephyr.a(binary_info.c.obj)
.binary_info.keep.__bi_ptr13
0x00000000100044e8 0x4 zephyr/libzephyr.a(binary_info.c.obj)
.binary_info.keep.__bi_ptr10
0x00000000100044ec 0x4 zephyr/libzephyr.a(binary_info.c.obj)
.binary_info.keep.__bi_ptr190
0x00000000100044f0 0x4 zephyr/libzephyr.a(binary_info_pins.c.obj)
.binary_info.keep.__bi_ptr156
0x00000000100044f4 0x4 zephyr/libzephyr.a(binary_info_pins.c.obj)
.binary_info.keep.__bi_ptr123
0x00000000100044f8 0x4 zephyr/libzephyr.a(binary_info_pins.c.obj)
.binary_info.keep.__bi_ptr122
0x00000000100044fc 0x4 zephyr/libzephyr.a(binary_info_pins.c.obj)
.binary_info.keep.__bi_ptr88
0x0000000010004500 0x4 zephyr/libzephyr.a(binary_info_pins.c.obj)
.binary_info.keep.__bi_ptr54
0x0000000010004504 0x4 zephyr/libzephyr.a(binary_info_pins.c.obj)
.binary_info.keep.__bi_ptr21
0x0000000010004508 0x4 zephyr/libzephyr.a(binary_info_pins.c.obj)
.binary_info.keep.__bi_ptr20
0x000000001000450c 0x4 zephyr/libzephyr.a(binary_info_pins.c.obj)
(SORT_BY_ALIGNMENT(.binary_info.))
0x0000000010004510 __binary_info_end = .
0x0000000010004510 - 0x00000000100044c8 = 72 (bytes)
Although it's not zero, I don't think it's a large number to concern.
Of course, we can disable it as an option, but we would like to keep it enabled by default to be compatible with the rpi_pico ecosystem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks for clarifying. This is clearly okay :)
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]>
1b204f2 to
e913a22
Compare
Binary Info embeds program meta information in flash, which can be viewed with RaspberryPi Pico's `picotool`. Metadata is automatically collected from pinctrl. It can be override by the Kconfig configurations, such as ``` CONFIG_RPI_PICO_BINARY_INFO_OVERRIDE_PROGRAM_NAME="my program name" ``` When this feature is enabled, pinctrl groups are restricted to consisting of pins with a single rpi_pico function. In other words, SPI's MISO and MOSI can be in the same group, but I2C's SDA cannot be included in this group. This is rarely an issue in normal use, and can be resolved by dividing them into separate groups. Signed-off-by: TOKITA Hiroshi <[email protected]>
Fix indentation to pass CI check. Signed-off-by: TOKITA Hiroshi <[email protected]>
e913a22 to
ab122fa
Compare
|



soc: arm: rpi_pico: Add support RaspberryPi Pico binary info feature
Binary Info embeds program meta information in flash,
which can be viewed with RaspberryPi Pico's
picotool.Metadata is automatically collected from pinctrl.
It can be override by the Kconfig configurations, such as
When this feature is enabled, pinctrl groups are restricted to
consisting of pins with a single rpi_pico function.
In other words, SPI's MISO and MOSI can be in the same group,
but I2C's SDA cannot be included in this group.
This is rarely an issue in normal use,
and can be resolved by dividing them into separate groups.