-
Notifications
You must be signed in to change notification settings - Fork 1.4k
scripts: board gen: Default to nrfutil and align with upstream #25572
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
Default to nrfutil on all boards and also add some changes made upstream in the meantime. Signed-off-by: Carles Cufi <[email protected]>
|
@nordicjm could you review this one please? |
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.
Pull Request Overview
This pull request updates board generation templates to default to nrfutil and incorporates upstream changes. The main objective is to prioritize nrfutil as the default board runner across all nRF SoC families.
Key changes:
- Reordered board runner includes to prioritize nrfutil over nrfjprog
- Added TFM configuration blocks for nrf54l boards
- Added nrfutil-specific external memory configuration arguments for nrf52 and nrf53 boards
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| scripts/west_commands/create_board/templates/nrf91/board.cmake.jinja2 | Adds nrfutil include before nrfjprog to prioritize nrfutil as default runner |
| scripts/west_commands/create_board/templates/nrf54l/board.cmake.jinja2 | Adds TFM configuration blocks and includes nrfutil as the primary runner |
| scripts/west_commands/create_board/templates/nrf53/board.cmake.jinja2 | Adds nrfutil external memory config and reorders includes to prioritize nrfutil |
| scripts/west_commands/create_board/templates/nrf52/board.cmake.jinja2 | Adds nrfutil external memory config for QSPI and reorders includes to prioritize nrfutil |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| endif() | ||
|
|
||
| if(CONFIG_TFM_FLASH_MERGED_BINARY) | ||
| set_property(TARGET runners_yaml_props_target PROPERTY hex_file "${CMAKE_BINARY_DIR}/tfm_merged.hex") |
Copilot
AI
Nov 13, 2025
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.
The hex_file path should use tfm_merged.hex instead of "${CMAKE_BINARY_DIR}/tfm_merged.hex" to be consistent with existing boards. All other boards in the repository (nrf54lv10dk, nrf7120pdk, tpm530mevk) use just tfm_merged.hex without the CMAKE_BINARY_DIR prefix.
| set_property(TARGET runners_yaml_props_target PROPERTY hex_file "${CMAKE_BINARY_DIR}/tfm_merged.hex") | |
| set_property(TARGET runners_yaml_props_target PROPERTY hex_file "tfm_merged.hex") |
| endif() | ||
|
|
||
| if(CONFIG_BOARD_{{ board | upper }}_NRF5340_CPUAPP OR CONFIG_BOARD_{{ board | upper }}_NRF5340_CPUAPP_NS) | ||
| board_runner_args(nrfutil "--ext-mem-config-file=${BOARD_DIR}/support/nrf5340dk_qspi_nrfutil_config.json") |
Copilot
AI
Nov 13, 2025
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.
The config file path contains a hardcoded board name "nrf5340dk" which will be incorrect for boards generated from this template. This should either use a template variable like {{ board }} or be removed if there's no generic way to handle this configuration.
| board_runner_args(nrfutil "--ext-mem-config-file=${BOARD_DIR}/support/nrf5340dk_qspi_nrfutil_config.json") | |
| board_runner_args(nrfutil "--ext-mem-config-file=${BOARD_DIR}/support/{{ board }}_qspi_nrfutil_config.json") |
| @@ -1,10 +1,13 @@ | |||
| board_runner_args(jlink "--device={{ soc | replace("nrf", "nRF") }}_xx{{ variant[2:] | upper }}" "--speed=4000") | |||
| if(CONFIG_SOC_NRF52840_QIAA) | |||
| board_runner_args(nrfutil "--ext-mem-config-file=${BOARD_DIR}/support/nrf52840dk_qspi_nrfutil_config.json") | |||
Copilot
AI
Nov 13, 2025
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.
The config file path contains a hardcoded board name "nrf52840dk" which will be incorrect for boards generated from this template. This should either use a template variable like {{ board }} or be removed if there's no generic way to handle this configuration.
| board_runner_args(nrfutil "--ext-mem-config-file=${BOARD_DIR}/support/nrf52840dk_qspi_nrfutil_config.json") | |
| board_runner_args(nrfutil "--ext-mem-config-file=${BOARD_DIR}/support/{{ board }}_qspi_nrfutil_config.json") |
CI InformationTo view the history of this post, click the 'edited' button above Inputs:Sources:sdk-nrf: PR head: 6d0ab2deac3ef97bce4086d9a2e1c09402f41e9b more detailssdk-nrf:
Github labels
List of changed files detected by CI (5)Outputs:ToolchainVersion: Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped;
|
| @@ -1,10 +1,13 @@ | |||
| board_runner_args(jlink "--device={{ soc | replace("nrf", "nRF") }}_xx{{ variant[2:] | upper }}" "--speed=4000") | |||
| if(CONFIG_SOC_NRF52840_QIAA) | |||
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.
this should only be present if the soc is nrf52840, not as in "if(CONFIG..." in the output file but just the one line if soc == nrf52840. Also this depends on if they have QSPI set up or even wired in...
| endif() | ||
|
|
||
| if(CONFIG_BOARD_{{ board | upper }}_NRF5340_CPUAPP OR CONFIG_BOARD_{{ board | upper }}_NRF5340_CPUAPP_NS) | ||
| board_runner_args(nrfutil "--ext-mem-config-file=${BOARD_DIR}/support/nrf5340dk_qspi_nrfutil_config.json") |
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.
this too, a board might not have QSPI flash at all, or if it does it might have a very different configuration, on different pins, different mode, etc. plus I don't see this file even here?
The current version has a vulnerability: GHSA-f83h-ghpp-7wcc update to 20251107. Signed-off-by: Carles Cufi <[email protected]>
Default to nrfutil on all boards and also add some changes made upstream in the meantime.