Skip to content

Conversation

jonathannilsen
Copy link
Contributor

Pull in new build system support for generating PERIPHCONF
entries based on devicetree.
This functionality replaces nrf-regtool and "periphconf migration".

Also includes the commits from #24028.

test_secdom_samples_public: NCSDK-NONE_fix_uicr_path
test_ble_samples: PR-242
test_crypto: PR-853
test_proprietary: PR-115

@jonathannilsen jonathannilsen requested review from a team and nordic-auko as code owners September 12, 2025 15:26
@NordicBuilder NordicBuilder added doc-required PR must not be merged without tech writer approval. manifest labels Sep 12, 2025
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Sep 12, 2025

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

Name Old Revision New Revision Diff
zephyr nrfconnect/sdk-zephyr@25ced41 nrfconnect/sdk-zephyr#3276 nrfconnect/sdk-zephyr#3276/files

DNM label due to: 1 project with PR revision

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

@NordicBuilder
Copy link
Contributor

NordicBuilder commented Sep 12, 2025

CI Information

To view the history of this post, clich the 'edited' button above
Build number: 6

Inputs:

Sources:

sdk-nrf: PR head: d1255d2f29052a33404d8bd7cfa99bc77baee19f
zephyr: PR head: 3ba972987d37a18614ad9e43bc6ab026831d5434

more details

sdk-nrf:

PR head: d1255d2f29052a33404d8bd7cfa99bc77baee19f
merge base: fe3d5953976bb1272df2178e15280c64025c3912
target head (main): fe3d5953976bb1272df2178e15280c64025c3912
Diff

zephyr:

PR head: 3ba972987d37a18614ad9e43bc6ab026831d5434
merge base: 25ced410af6caf6fea810b49ef4cf9b3bcb40b2b
target head (main): 96ef102fadde5fc5fb96e0019903c1f085780640
Diff

Github labels

Enabled Name Description
ci-disabled Disable the ci execution
ci-all-test Run all of ci, no test spec filtering will be done
ci-force-downstream Force execution of downstream even if twister fails
ci-run-twister Force run twister
ci-run-zephyr-twister Force run zephyr twister
List of changed files detected by CI (52)
CMakeLists.txt
CODEOWNERS
cmake
│  ├── sysbuild
│  │  │ periphconf_migrate.cmake
doc
│  ├── nrf
│  │  ├── releases_and_maturity
│  │  │  ├── releases
│  │  │  │  │ release-notes-changelog.rst
│  │  ├── samples
│  │  │  │ other.rst
samples
│  ├── ironside_se
│  │  ├── secondary_boot_gen_uicr
│  │  │  ├── CMakeLists.txt
│  │  │  ├── README.rst
│  │  │  ├── prj.conf
│  │  │  ├── sample.yaml
│  │  │  ├── secondary
│  │  │  │  ├── CMakeLists.txt
│  │  │  │  ├── prj.conf
│  │  │  │  ├── secondary_partition.overlay
│  │  │  │  ├── src
│  │  │  │  │  │ main.c
│  │  │  ├── src
│  │  │  │  │ main.c
│  │  │  ├── sysbuild.conf
│  │  │  ├── sysbuild
│  │  │  │  │ uicr.conf
│  ├── pmic
│  │  ├── native
│  │  │  ├── npm13xx_fuel_gauge
│  │  │  │  │ sample.yaml
│  │  │  ├── npm13xx_one_button
│  │  │  │  │ sample.yaml
sysbuild
│  ├── CMakeLists.txt
│  ├── Kconfig.periphconf
│  ├── Kconfig.secondary
│  ├── Kconfig.sysbuild
│  │ secondary.cmake
west.yml
zephyr
│  ├── .github
│  │  ├── workflows
│  │  │  │ manifest-PR.yml
│  ├── boards
│  │  ├── nordic
│  │  │  ├── nrf54h20dk
│  │  │  │  │ nrf54h20dk_nrf54h20-memory_map.dtsi
│  ├── scripts
│  │  ├── ci
│  │  │  │ check_compliance.py
│  │  ├── west_commands
│  │  │  ├── runners
│  │  │  │  │ nrf_common.py
│  ├── soc
│  │  ├── nordic
│  │  │  ├── Kconfig.sysbuild
│  │  │  ├── common
│  │  │  │  ├── CMakeLists.txt
│  │  │  │  ├── uicr
│  │  │  │  │  ├── CMakeLists.txt
│  │  │  │  │  ├── Kconfig
│  │  │  │  │  ├── Kconfig.sysbuild
│  │  │  │  │  ├── gen_periphconf_entries.py
│  │  │  │  │  ├── gen_uicr.py
│  │  │  │  │  ├── gen_uicr
│  │  │  │  │  │  ├── CMakeLists.txt
│  │  │  │  │  │  ├── Kconfig
│  │  │  │  │  │  ├── prj.conf
│  │  │  │  │  │  ├── zephyr
│  │  │  │  │  │  │  │ CMakeLists.txt
│  │  │  │  │  ├── periphconf
│  │  │  │  │  │  ├── __init__.py
│  │  │  │  │  │  │ builder.py
│  │  │  │  │  │ sysbuild.cmake
│  │  │  ├── ironside
│  │  │  │  ├── CMakeLists.txt
│  │  │  │  ├── Kconfig
│  │  │  │  ├── bootmode.c
│  │  │  │  ├── include
│  │  │  │  │  ├── nrf_ironside
│  │  │  │  │  │  ├── bootmode.h
│  │  │  │  │  │  ├── cpuconf.h
│  │  │  │  │  │  ├── dvfs.h
│  │  │  │  │  │  ├── tdd.h
│  │  │  │  │  │  │ update.h
│  │  │  │ sysbuild.cmake
│  ├── tests
│  │  ├── drivers
│  │  │  ├── comparator
│  │  │  │  ├── gpio_loopback
│  │  │  │  │  │ testcase.yaml

Outputs:

Toolchain

Version: 2b2cd9579a
Build docker image: docker-dtr.nordicsemi.no/sw-production/ncs-build:2b2cd9579a_bba2ea5f2e

Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped; ⚠️ Quarantine

  • ◻️ Toolchain - Skipped: existing toolchain is used
  • ✅ Build twister
  • ❌ Integration tests
    • ✅ test-sdk-audio
    • ✅ desktop52_verification - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-apps
    • ❌ test_ble_nrf_config
    • ✅ test-fw-nrfconnect-ble_mesh
    • ❌ test-fw-nrfconnect-ble_samples
    • ✅ test-fw-nrfconnect-chip
    • ✅ test-fw-nrfconnect-nfc
    • ✅ test-fw-nrfconnect-nrf-iot_libmodem-nrf
    • ✅ test-fw-nrfconnect-nrf-iot_serial_lte_modem
    • ✅ test-fw-nrfconnect-nrf-iot_zephyr_lwm2m
    • ✅ test-fw-nrfconnect-nrf-iot_samples
    • ✅ test-fw-nrfconnect-nrf-iot_lwm2m
    • ✅ doc-internal
    • ✅ test-fw-nrfconnect-nrf-iot_thingy91
    • ✅ test-fw-nrfconnect-nrf_crypto
    • ✅ test-fw-nrfconnect-proprietary_esb
    • ✅ test-fw-nrfconnect-rpc
    • ✅ test-fw-nrfconnect-rs
    • ✅ test-fw-nrfconnect-fem - Skipped: Job was skipped as it succeeded in a previous run
    • ❌ test-fw-nrfconnect-tfm
    • ✅ test-fw-nrfconnect-thread-main
    • ✅ test-sdk-find-my
    • ✅ test-fw-nrfconnect-nrf_lrcs_mosh
    • ✅ test-fw-nrfconnect-nrf_lrcs_positioning
    • ✅ test-sdk-wifi
    • ✅ test-low-level
    • ✅ test-sdk-pmic-samples
    • ✅ test-sdk-mcuboot
    • ✅ test-sdk-dfu
    • ✅ test-fw-nrfconnect-ps-main
    • ✅ test-secdom-samples-public
    • ⚠️ test-fw-nrfconnect-nrf-iot_cloud

Note: This message is automatically posted and updated by the CI

Copy link

SebastianBoe and others added 3 commits September 15, 2025 09:48
Apply the shield to the app only.

Don't apply it to other images in the sysbuild, i.e. 54h20's UICR
image.

Signed-off-by: Sebastian Bøe <[email protected]>
Rewrite the periphconf CMake code to have each individual Zephyr image
generate periphconf instead of doing it from the sysbuild image.

This aligns better with how upstream has moved gen_uicr.py out of
SYSBUILD.

Also, add a sample that uses this infrastructure.

Signed-off-by: Sebastian Bøe <[email protected]>
Pull in new build system support for generating PERIPHCONF
entries based on devicetree.
This functionality replaces nrf-regtool and "periphconf migration".

Ref: NCSDK-35206

Signed-off-by: Jonathan Nilsen <[email protected]>
project(secondary_boot_secondary)

# Create empty marker file at configure-time
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/is_secondary_firmware.txt "")
Copy link
Contributor

Choose a reason for hiding this comment

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

???

Copy link
Contributor

Choose a reason for hiding this comment

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

The uicr image needs to know which images are primary images, and which are secondary images.

When this was developed, I couldn't find a clean way to communicate this.

But now the uicr image is parsing all of the .config's of the other images to find out if
CONFIG_KERNEL_BIN_NAME has been modified.

So I could now introduce a Kconfig IS_SECONDARY if you prefer.

The code that checks this .txt file is here

https://github.com/zephyrproject-rtos/zephyr/blob/main/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt#L83

And the code that extracts the Kconfig is here:

https://github.com/zephyrproject-rtos/zephyr/blob/main/soc/nordic/common/uicr/gen_uicr/CMakeLists.txt#L79

Copy link
Contributor

Choose a reason for hiding this comment

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

@tomchy recently did it for images, can see also in cmake/sysbuild/modules/ncs_sysbuild_extensions.cmake how variant images do it

Copy link
Contributor

Choose a reason for hiding this comment

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

AFAICT ncs_sysbuild_extensions introduces a wrapper-function that
adds an image to a list before invoking ExternalZephyrProject_Add.

That list could then be passed to the uicr image at generation
time.

If I understand you correctly, you want me to introduce a
wrapper-function that customers can invoke when they want to add
a secondary image.

I feel it is simpler to document that customers only need to set
the Kconfig IS_SECONDARY_IMAGE to ensure that their image is
registered as a secondary image than to document that they need
to invoke this wrapper function in CMake.

Note that the introduction of a wrapper function would not solve the problem
of the UICR image needing to know what binary name each image has used
(CONFIG_KERNEL_BIN_NAME).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This commit originated from #24028, and I've now dropped it from there to not unnecessarily block other included changes. We will make a new PR with just the secondary mode sample changes.

)
message(STATUS "Generated periphconf_migrated.c: ${PROJECT_BINARY_DIR}/periphconf_migrated.c")

zephyr_sources(${PROJECT_BINARY_DIR}/periphconf_migrated.c)
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be generated properly using add_custom_target and add_custom_command so it can be updated if it is out of date etc. and is not continually rebuilt

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change was part of an intermediate commit which is now obsolete. I've dropped it from #24028.

@NordicBuilder
Copy link
Contributor

NordicBuilder commented Sep 15, 2025

Memory footprint analysis revealed the following potential issues

applications.hpf.gpio.icbmsg[nrf54l15dk/nrf54l15/cpuflpr]: High RAM usage: 12430[B] - link (cc: @nrfconnect/ncs-ll-ursus)
applications.hpf.gpio.icbmsg[nrf54l15dk/nrf54l15/cpuflpr]: High ROM usage: 9178[B] - link (cc: @nrfconnect/ncs-ll-ursus)
applications.hpf.gpio.icmsg[nrf54l15dk/nrf54l15/cpuflpr]: High RAM usage: 9090[B] - link (cc: @nrfconnect/ncs-ll-ursus)
applications.hpf.gpio.icmsg[nrf54l15dk/nrf54l15/cpuflpr]: High ROM usage: 5846[B] - link (cc: @nrfconnect/ncs-ll-ursus)

Note: This message is automatically posted and updated by the CI (latest/sdk-nrf/PR-24524/6)

@jonathannilsen
Copy link
Contributor Author

I've now included the relevant parts from this into #24028

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DNM doc-required PR must not be merged without tech writer approval. manifest manifest-zephyr

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants