Skip to content

Commit 768b887

Browse files
committed
soc: arm: rpi_pico: Add basic support for binary info feature
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]>
1 parent 21eebd7 commit 768b887

File tree

6 files changed

+521
-0
lines changed

6 files changed

+521
-0
lines changed

soc/raspberrypi/rpi_pico/common/CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,16 @@ zephyr_include_directories(.)
66
zephyr_sources(
77
soc.c
88
)
9+
10+
zephyr_library_sources_ifdef(CONFIG_RPI_PICO_BINARY_INFO
11+
binary_info.c
12+
binary_info_header.S
13+
)
14+
15+
zephyr_linker_sources_ifdef(CONFIG_RPI_PICO_BINARY_INFO
16+
ROM_START SORT_KEY 0x0binary_info_header binary_info_header.ld
17+
)
18+
19+
zephyr_linker_sources_ifdef(CONFIG_RPI_PICO_BINARY_INFO
20+
RODATA binary_info.ld
21+
)
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Copyright (c) 2024 TOKITA Hiroshi
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config RPI_PICO_BINARY_INFO
5+
bool "Generate RaspberryPi Pico binary info"
6+
default y
7+
help
8+
Binary info is able to embed machine readable information with the binary in FLASH.
9+
It can read with picotool(https://github.com/raspberrypi/picotool).
10+
11+
if RPI_PICO_BINARY_INFO
12+
13+
config RPI_PICO_BINARY_INFO_PROGRAM_NAME_ENABLE
14+
bool "Override program name in binary info"
15+
16+
config RPI_PICO_BINARY_INFO_PROGRAM_NAME
17+
string "Override string for program name in binary info"
18+
depends on RPI_PICO_BINARY_INFO_PROGRAM_NAME_ENABLE
19+
20+
config RPI_PICO_BINARY_INFO_PROGRAM_URL_ENABLE
21+
bool "Override program url in binary info"
22+
23+
config RPI_PICO_BINARY_INFO_PROGRAM_URL
24+
string "String for program description in binary info"
25+
depends on RPI_PICO_BINARY_INFO_PROGRAM_URL_ENABLE
26+
27+
config RPI_PICO_BINARY_INFO_PROGRAM_DESCRIPTION_ENABLE
28+
bool "Override program descrpition in binary info"
29+
30+
config RPI_PICO_BINARY_INFO_PROGRAM_DESCRIPTION
31+
string "String for program description in binary info"
32+
depends on RPI_PICO_BINARY_INFO_PROGRAM_DESCRIPTION_ENABLE
33+
34+
config RPI_PICO_BINARY_INFO_PROGRAM_BUILD_DATE_ENABLE
35+
bool "Override build date in binary info"
36+
37+
config RPI_PICO_BINARY_INFO_PROGRAM_BUILD_DATE
38+
string "Override string for build date in binary info"
39+
depends on RPI_PICO_BINARY_INFO_PROGRAM_BUILD_DATE_ENABLE
40+
41+
config RPI_PICO_BINARY_INFO_PROGRAM_VERSION_STRING_ENABLE
42+
bool "Override program version in binary info"
43+
default y
44+
45+
config RPI_PICO_BINARY_INFO_SDK_VERSION_STRING_ENABLE
46+
bool "Override sdk version in binary info"
47+
default y
48+
49+
config RPI_PICO_BINARY_INFO_PICO_BOARD_ENABLE
50+
bool "Override board in binary info"
51+
default y
52+
53+
config RPI_PICO_BINARY_INFO_ATTRIBUTE_BUILD_TYPE_ENABLE
54+
bool "Override board in binary info"
55+
default y
56+
57+
config RPI_PICO_BINARY_INFO_BOOT_STAGE2_NAME_ENABLE
58+
bool "Override board in binary info"
59+
default y
60+
61+
config RPI_PICO_BINARY_INFO_PINS_WITH_FUNC_ENABLE
62+
bool "Override board in binary info"
63+
default y
64+
65+
endif

0 commit comments

Comments
 (0)