Skip to content

Commit 2e30f51

Browse files
lemreyanangl
authored andcommittedNov 17, 2023
kconfig: fw_info: let entry be a menuconfig, rework FW_INFO_API
Let fw_info entry FW_INFO be a menuconfig, so that its related entries can expand nicely into a menu. The dependency on FW_INFO || FW_INFO_API on the Kconfig entries for this library prevented them from expanding into the menu. Rework FW_INFO_API so that it depends on FW_INFO. Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
1 parent 026a52e commit 2e30f51

File tree

4 files changed

+14
-18
lines changed

4 files changed

+14
-18
lines changed
 

‎subsys/fw_info/CMakeLists.txt

+5-11
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,15 @@
33
#
44
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
#
6-
if (CONFIG_FW_INFO)
7-
zephyr_library()
6+
7+
zephyr_library()
8+
9+
if (CONFIG_FW_INFO AND NOT CONFIG_FW_INFO_API)
810
zephyr_library_sources(fw_info.c)
911
zephyr_linker_sources(RODATA ext_apis.ld)
12+
zephyr_linker_sources(ROM_START SORT_KEY ${CONFIG_FW_INFO_OFFSET} fw_info.ld)
1013
endif ()
1114

12-
if (CONFIG_FW_INFO_API)
13-
zephyr_library()
14-
endif()
15-
16-
zephyr_linker_sources_ifdef(CONFIG_FW_INFO
17-
ROM_START
18-
SORT_KEY ${CONFIG_FW_INFO_OFFSET}
19-
fw_info.ld)
20-
2115
# The following creates variables with the magic numbers used for firmware
2216
# metadata as comma-separated lists of numbers.
2317

‎subsys/fw_info/Kconfig

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
#
66

7-
config FW_INFO
7+
menuconfig FW_INFO
88
bool
99
prompt "Firmware Metadata"
1010
imply NRFX_NVMC
1111

12-
if(!FW_INFO)
12+
if (FW_INFO)
13+
1314
config FW_INFO_API
14-
bool
15-
prompt "Firmware Metadata find API"
16-
endif
15+
bool "Only provide APIs to locate metadata"
16+
help
17+
Only provide APIs to locate metadata.
1718

18-
if (FW_INFO || FW_INFO_API)
1919
config FW_INFO_OFFSET
2020
hex "The location of firmware info inside this firmware"
2121
default 0x200

‎subsys/pcd/Kconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ if PCD_APP || PCD_NET
3434

3535
config PCD_READ_NETCORE_APP_VERSION
3636
bool "Include PCD command to read network core application version"
37-
select FW_INFO_API if !FW_INFO
37+
depends on FW_INFO || FW_INFO_API
3838

3939
config PCD_USE_CONSTANTS
4040
bool "Use KConfig constants rather than pm_config.h"

‎tests/subsys/pcd/prj.conf

+2
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ CONFIG_PCD_APP=y
1111
CONFIG_BOARD_ENABLE_CPUNET=y
1212
CONFIG_ZTEST_STACK_SIZE=2048
1313
CONFIG_PARTITION_MANAGER_ENABLED=y
14+
CONFIG_FW_INFO=y
15+
CONFIG_FW_INFO_API=y
1416
CONFIG_PCD_READ_NETCORE_APP_VERSION=y

0 commit comments

Comments
 (0)
Please sign in to comment.