Skip to content

Conversation

travis3630
Copy link
Contributor

Add nrf7120 to tf-m Kconfig to support ns build
Add tfm-boards for nrf7120_cpuapp to point to trusted-firmware-m build Update soc/nordic/nrf71 for tf-m build

@NordicBuilder NordicBuilder added the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Sep 10, 2025
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Sep 10, 2025

CI Information

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

Inputs:

Sources:

trusted-firmware-m: PR head: 902f58b94409fa12a57e6b821592ea53d8dfef96
sdk-nrf: PR head: 7950319eb5f4b487438ac155b73447cdb8e80a86

more details

trusted-firmware-m:

PR head: 902f58b94409fa12a57e6b821592ea53d8dfef96
merge base: b4dfb8e90f7a133a68fd6949bc24586af99a3e0c
Diff

sdk-nrf:

PR head: 7950319eb5f4b487438ac155b73447cdb8e80a86
merge base: 88e0590c10a577f407c945f0e3eecf313d74ab75
target head (main): f18d525114d08fbd21b8a29d7a23e6b3d843d8f3
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 (49)
boards
│  ├── nordic
│  │  ├── nrf54lv10dk
│  │  │  │ nrf54lv10dk_nrf54lv10a_cpuapp_ns_defconfig
│  │  ├── nrf7120pdk
│  │  │  │ nrf7120pdk_nrf7120_cpuapp_ns.dts
dts
│  ├── common
│  │  ├── nordic
│  │  │  ├── nrf7120_enga.dtsi
│  │  │  │ nrf7120_enga_secure_peripherals.dtsi
modules
│  ├── tee
│  │  ├── tf-m
│  │  │  ├── trusted-firmware-m
│  │  │  │  ├── platform
│  │  │  │  │  ├── ext
│  │  │  │  │  │  ├── target
│  │  │  │  │  │  │  ├── nordic_nrf
│  │  │  │  │  │  │  │  ├── common
│  │  │  │  │  │  │  │  │  ├── core
│  │  │  │  │  │  │  │  │  │  ├── CMakeLists.txt
│  │  │  │  │  │  │  │  │  │  ├── cmsis_drivers
│  │  │  │  │  │  │  │  │  │  │  │ Driver_Flash.c
│  │  │  │  │  │  │  │  │  │  ├── nrfx_config.h
│  │  │  │  │  │  │  │  │  │  ├── services
│  │  │  │  │  │  │  │  │  │  │  ├── src
│  │  │  │  │  │  │  │  │  │  │  │  │ tfm_platform_hal_ioctl.c
│  │  │  │  │  │  │  │  │  │  ├── startup_nrf7120.c
│  │  │  │  │  │  │  │  │  │  ├── target_cfg.h
│  │  │  │  │  │  │  │  │  │  │ target_cfg_71.c
│  │  │  │  │  │  │  │  │  ├── nrf7120
│  │  │  │  │  │  │  │  │  │  ├── CMakeLists.txt
│  │  │  │  │  │  │  │  │  │  ├── config.cmake
│  │  │  │  │  │  │  │  │  │  ├── cpuarch.cmake
│  │  │  │  │  │  │  │  │  │  ├── mmio_defs.h
│  │  │  │  │  │  │  │  │  │  ├── nrf71_init.c
│  │  │  │  │  │  │  │  │  │  ├── nrfx_config_nrf71.h
│  │  │  │  │  │  │  │  │  │  ├── ns
│  │  │  │  │  │  │  │  │  │  │  │ CMakeLists.txt
│  │  │  │  │  │  │  │  │  │  ├── partition
│  │  │  │  │  │  │  │  │  │  │  ├── flash_layout.h
│  │  │  │  │  │  │  │  │  │  │  │ region_defs.h
│  │  │  │  │  │  │  │  │  │  ├── tests
│  │  │  │  │  │  │  │  │  │  │  │ psa_arch_tests_config.cmake
│  │  │  │  │  │  │  │  │  │  ├── tfm_interrupts.c
│  │  │  │  │  │  │  │  │  │  ├── tfm_peripherals_config_nrf71.h
│  │  │  │  │  │  │  │  │  │  │ tfm_peripherals_def.h
│  │  │  │  │  │  │  │  ├── nrf7120pdk_nrf7120_cpuapp
│  │  │  │  │  │  │  │  │  ├── CMakeLists.txt
│  │  │  │  │  │  │  │  │  ├── RTE_Device.h
│  │  │  │  │  │  │  │  │  ├── config.cmake
│  │  │  │  │  │  │  │  │  ├── cpuarch.cmake
│  │  │  │  │  │  │  │  │  ├── device_cfg.h
│  │  │  │  │  │  │  │  │  ├── ns
│  │  │  │  │  │  │  │  │  │  │ cpuarch_ns.cmake
│  │  │  │  │  │  │  │  │  ├── services
│  │  │  │  │  │  │  │  │  │  ├── include
│  │  │  │  │  │  │  │  │  │  │  │ tfm_platform_user_memory_ranges.h
│  │  │  │  │  │  │  │  │  │  ├── src
│  │  │  │  │  │  │  │  │  │  │  │ tfm_platform_system.c
│  │  │  │  │  │  │  │  │  ├── tests
│  │  │  │  │  │  │  │  │  │  ├── psa_arch_tests_config.cmake
│  │  │  │  │  │  │  │  │  │  │ tfm_tests_config.cmake
│  │  │  │  │  │  │  │  │  ├── tfm_hal_platform.c
│  │  │  │  │  │  │  │  │  │ tfm_peripherals_config.h
│  ├── trusted-firmware-m
│  │  ├── Kconfig
│  │  ├── Kconfig.tfm.defconfig
│  │  ├── Kconfig.tfm.pm
│  │  ├── tfm_boards
│  │  │  ├── CMakeLists.txt
│  │  │  ├── board
│  │  │  │  ├── RTE_Device.h
│  │  │  │  │ device_cfg.h
│  │  │  ├── nrf7120_cpuapp
│  │  │  │  ├── CMakeLists.txt
│  │  │  │  ├── config.cmake
│  │  │  │  ├── cpuarch.cmake
│  │  │  │  ├── ns
│  │  │  │  │  │ cpuarch_ns.cmake
soc
│  ├── nordic
│  │  ├── nrf71
│  │  │  │ Kconfig
subsys
│  ├── partition_manager
│  │  │ pm.yml.tfm
west.yml

Outputs:

Toolchain

Version: f66cf421f3
Build docker image: docker-dtr.nordicsemi.no/sw-production/ncs-build:f66cf421f3_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
    • ❌ 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_cloud
    • ❌ 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
    • ❌ 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
    • ❌ 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

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

Copy link

You can find the documentation preview for this PR here.

@travis3630 travis3630 force-pushed the NRFX-7040-nrf7120-add-tfm-ns-build branch 2 times, most recently from 5a3c9d9 to c224bbc Compare September 11, 2025 10:10
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Sep 11, 2025

Memory footprint analysis revealed the following potential issues

sample.matter.template.release[nrf5340dk/nrf5340/cpuapp]: ROM size increased by 2340[B] in comparison to the main[c434614] branch. - link (cc: @kkasperczyk-no @ArekBalysNordic @markaj-nordic)
applications.nrf_desktop.zrelease[[email protected]/nrf54h20/cpuapp]: RAM size increased by 24474[B] in comparison to the main[c434614] branch. - link (cc: @nrfconnect/ncs-si-bluebagel)
applications.nrf_desktop.zrelease[[email protected]/nrf54h20/cpuapp]: ROM size increased by 15280[B] in comparison to the main[c434614] branch. - link (cc: @nrfconnect/ncs-si-bluebagel)
applications.hpf.gpio.icmsg[nrf54l15dk/nrf54l15/cpuflpr]: High RAM usage: 9102[B] - link (cc: @nrfconnect/ncs-ll-ursus)
applications.hpf.gpio.icmsg[nrf54l15dk/nrf54l15/cpuflpr]: High ROM usage: 5858[B] - link (cc: @nrfconnect/ncs-ll-ursus)
sample.matter.template.debug[nrf52840dk/nrf52840]: ROM size increased by 2152[B] in comparison to the main[c434614] branch. - link (cc: @kkasperczyk-no @ArekBalysNordic @markaj-nordic)
sample.matter.template.release[nrf7002dk/nrf5340/cpuapp]: RAM size increased by 4836[B] in comparison to the main[c434614] branch. - link (cc: @kkasperczyk-no @ArekBalysNordic @markaj-nordic)
applications.nrf_desktop.zrelease_dongle[[email protected]/nrf54h20/cpuapp]: RAM size increased by 768[B] in comparison to the main[c434614] branch. - link (cc: @nrfconnect/ncs-si-bluebagel)
applications.nrf_desktop.zrelease_dongle[[email protected]/nrf54h20/cpuapp]: ROM size increased by 2664[B] in comparison to the main[c434614] branch. - link (cc: @nrfconnect/ncs-si-bluebagel)
sample.matter.template.release[nrf52840dk/nrf52840]: ROM size increased by 2588[B] in comparison to the main[c434614] branch. - link (cc: @kkasperczyk-no @ArekBalysNordic @markaj-nordic)
applications.nrf_desktop.zdebug.uart[[email protected]/nrf54h20/cpuapp]: RAM size increased by 24478[B] in comparison to the main[c434614] branch. - link (cc: @nrfconnect/ncs-si-bluebagel)
applications.nrf_desktop.zdebug.uart[[email protected]/nrf54h20/cpuapp]: ROM size increased by 19012[B] in comparison to the main[c434614] branch. - link (cc: @nrfconnect/ncs-si-bluebagel)
applications.hpf.gpio.icbmsg[nrf54l15dk/nrf54l15/cpuflpr]: High RAM usage: 12744[B] - link (cc: @nrfconnect/ncs-ll-ursus)
applications.hpf.gpio.icbmsg[nrf54l15dk/nrf54l15/cpuflpr]: High ROM usage: 9492[B] - link (cc: @nrfconnect/ncs-ll-ursus)
sample.matter.template.debug[nrf7002dk/nrf5340/cpuapp]: RAM size increased by 5072[B] in comparison to the main[c434614] branch. - link (cc: @kkasperczyk-no @ArekBalysNordic @markaj-nordic)
applications.nrf_desktop.zdebug_dongle.uart[[email protected]/nrf54h20/cpuapp]: RAM size increased by 768[B] in comparison to the main[c434614] branch. - link (cc: @nrfconnect/ncs-si-bluebagel)
applications.nrf_desktop.zdebug_dongle.uart[[email protected]/nrf54h20/cpuapp]: ROM size increased by 5040[B] in comparison to the main[c434614] branch. - link (cc: @nrfconnect/ncs-si-bluebagel)

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

Copy link
Contributor

@tejlmand tejlmand left a comment

Choose a reason for hiding this comment

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

please check line lengths.

I've pointed out some, but not all.

@travis3630 travis3630 force-pushed the NRFX-7040-nrf7120-add-tfm-ns-build branch from c224bbc to 297178e Compare September 17, 2025 16:42
@travis3630 travis3630 force-pushed the NRFX-7040-nrf7120-add-tfm-ns-build branch from 297178e to ed054e1 Compare September 25, 2025 15:28
endif()

# WZN-6148: port this to zephyr/modules/hal_nordic/nrfx/CMakeLists.txt in future
zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF7120_SKIP_CLOCK_CONFIG NRF_SKIP_CLOCK_CONFIGURATION)
Copy link
Contributor

Choose a reason for hiding this comment

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

we should not pollute compiler invocation line for all Zephyr sources with such configs.

Those should be provided to MDK either for only the sources which needs it or through a form of a single config header, like this: https://github.com/zephyrproject-rtos/zephyr/blob/main/modules/hal_nordic/nrfx/nrfx_kconfig.h

Also providing a Kconfig -> MDK defines this way is not scalable.
The Kconfig already have dependencies, but adding the translation in CMake adds extra level of dependencies (namely the inclusion tree of the CMake file itself), which thus results in constructs like this having to be duplicated.
A single config header, as linked, allows to:

  1. Have all Kconfig -> MDK defines at a single locations
  2. Avoids duplicated CMake constructs when different CMake code is included in different trees.

Copy link
Contributor Author

@travis3630 travis3630 Sep 29, 2025

Choose a reason for hiding this comment

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

This is what I see nrf54lx is doing it the same: https://github.com/nrfconnect/sdk-zephyr/blob/main/modules/hal_nordic/nrfx/CMakeLists.txt#L193 , and I think it is better to align for same workflow?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tejlmand What should I do with this?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it is better to align for same workflow?

it's better to clean up the mess instead of building on top of it.

As your example show, then we now have 2 specific Kconfigs mapping to same MDK symbol, and two CMake codelines doing the same thing but in different places.

Not to mention that the trees including nrf71/CMakeLists.txt and nrfx/CMakeLists.txt may be included based on additional different (Kconfig) conditions.

The most correct thing is having a single Kconfig, which then has proper dependencies like this:

config NRF_SKIP_CLOCK_CONFIG
        bool
        prompt "Skip clock frequency configuration" if TRUSTED_EXECUTION_SECURE
        depends on SOC_SERIES_NRF54LX || SOC_SERIES_NRF71X
        default y if TRUSTED_EXECUTION_NONSECURE

and then in a Kconfig to MDK mapping header have (such as this https://github.com/zephyrproject-rtos/zephyr/blob/main/modules/hal_nordic/nrfx/nrfx_kconfig.h):

#ifdef CONFIG_NRF_SKIP_CLOCK_CONFIG
#define NRF_SKIP_CLOCK_CONFIGURATION
#endif

That will give you:

  • A single Kconfig setting instead of 2
  • Proper dependencies on the Kconfig which:
    • becomes part of the documentation
    • Can be easily seen in menuconfig
    • Kconfig check support, such as dependency loop checking
  • No line duplication in CMake, instead of two lines like:
    zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF7120_SKIP_CLOCK_CONFIG NRF_SKIP_CLOCK_CONFIGURATION)
    zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LX_SKIP_CLOCK_CONFIG NRF_SKIP_CLOCK_CONFIGURATION)
    
    there's a single location where all mapping between Kconfig and MDK can be found.

When looking at compile invocation and see gcc ..... -DNRF_SKIP_CLOCK_CONFIGURATION ... then it's hard to know where this flag originates from and why, because this flag might be present multiple places in the CMake code, and which one was the line causing it to be set ?
But if the flag exist in a Kconfig to MDK mapping header as presented above, then it's much easier to see it's directly related to a Kconfig symbol, and I can check that Kconfig symbol for dependencies / selects.
No extra dependencies are added directly or indirectly, whereas the symbol mapping in CMake automatically adds indirect dependencies

see also: zephyrproject-rtos/zephyr#95874 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@travis3630 travis3630 force-pushed the NRFX-7040-nrf7120-add-tfm-ns-build branch from ed054e1 to 72cbbac Compare September 29, 2025 11:15
@travis3630 travis3630 requested review from a team as code owners September 29, 2025 11:21
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Sep 29, 2025

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

Name Old Revision New Revision Diff
trusted-firmware-m nrfconnect/sdk-trusted-firmware-m@b4dfb8e nrfconnect/sdk-trusted-firmware-m@902f58b (main) nrfconnect/[email protected]

All manifest checks OK

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

@travis3630 travis3630 force-pushed the NRFX-7040-nrf7120-add-tfm-ns-build branch 2 times, most recently from ed8a898 to 68c2387 Compare September 29, 2025 11:53
@travis3630 travis3630 requested a review from tejlmand October 2, 2025 10:03
@travis3630
Copy link
Contributor Author

@nrfconnect/ncs-co-boards @nrfconnect/ncs-code-owners @nrfconnect/ncs-merge @ncs-co-drivers @ncs-aegir
@tejlmand Anyone review my PR?

@travis3630 travis3630 force-pushed the NRFX-7040-nrf7120-add-tfm-ns-build branch from 68c2387 to 984c971 Compare October 6, 2025 13:22
@travis3630 travis3630 force-pushed the NRFX-7040-nrf7120-add-tfm-ns-build branch from 984c971 to c599a9b Compare October 8, 2025 09:45
@tomi-font
Copy link
Contributor

I have triggered a more thorough TF-M CI run: https://jenkins-ncs.nordicsemi.no/job/latest/job/sub/job/test-fw-nrfconnect-tfm/job/master/15696/

@tomi-font
Copy link
Contributor

looks good so I merged nrfconnect/sdk-trusted-firmware-m#210

Copy link
Contributor

@bjarki-andreasen bjarki-andreasen left a comment

Choose a reason for hiding this comment

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

Approved with the expectation that # WZN-6148: port this to zephyr/modules/hal_nordic/nrfx/CMakeLists.txt in future is addressed in a future PR

Add nrf7120 to tf-m Kconfig to support ns build
Add tfm-boards for nrf7120_cpuapp to point to trusted-firmware-m build
Update soc/nordic/nrf71 for tf-m build

Signed-off-by: Travis Lam <[email protected]>
@travis3630 travis3630 force-pushed the NRFX-7040-nrf7120-add-tfm-ns-build branch from c599a9b to acdea85 Compare October 13, 2025 10:58
@travis3630 travis3630 requested a review from kl-cruz as a code owner October 13, 2025 10:58
@NordicBuilder NordicBuilder requested review from a team October 13, 2025 10:58
@travis3630 travis3630 force-pushed the NRFX-7040-nrf7120-add-tfm-ns-build branch from acdea85 to 56e1dfe Compare October 13, 2025 11:13
@NordicBuilder NordicBuilder removed the DNM label Oct 13, 2025
Point sdk-trusted-firmware-m in west.yaml new tfm support
for nrf7120.

Signed-off-by: Travis Lam <[email protected]>
select HAS_SEGGER_RTT if ZEPHYR_SEGGER_MODULE
select SOC_EARLY_INIT_HOOK
select SOC_RESET_HOOK
select NRF_PLATFORM_LUMOS
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tejlmand I have created this new Kconfig in zephyr, so that all Kconfigs between nrf71x and nrf54lx can share the common properties, also i.e. many Kconfig that has depend on (SOC_SERIES_NRF54LX || SOC_SERIES_NRF71X) can change to depend on NRF_PLATFORM_LUMOS

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

Labels

changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. manifest manifest-trusted-firmware-m

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants