Skip to content
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

Added warning if missing pm_static.yml when using single bootloader #10686

Conversation

hellesvik-nordic
Copy link
Contributor

From Partition Manager docs:

if you have a deployed product that consists of multiple images, where only a subset of the included images can be upgraded through a firmware update mechanism, the upgradable images must be statically configured.

This PR gives a build warning, so users who miss this documentation will also know about this limitation.

Fixes NCSIDB-942

@CLAassistant
Copy link

CLAassistant commented Mar 24, 2023

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Mar 24, 2023
@NordicBuilder
Copy link
Contributor

Thank you for your contribution!
It seems you are not a member of the nrfconnect GitHub organization. External contributions are handled as follows:
Large contributions, affecting multiple subsystems for example, may be rejected if they are complex, may introduce regressions due to lack of test coverage, or if they are not consistent with the architecture of nRF Connect SDK.
PRs will be run in our continuous integration (CI) test system.
If CI passes, PRs will be tagged for review and merged on successful completion of review. You may be asked to make some modifications to your contribution during review.
If CI fails, PRs may be rejected or may be tagged for review and rework.
PRs that become outdated due to other changes in the repository may be rejected or rework requested.
External contributions will be prioritized for review based on the relevance to current development efforts in nRF Connect SDK. Bug fix PRs will be prioritized.
You may raise issues or ask for help from our Technical Support team by visiting https://devzone.nordicsemi.com/.

Note: This comment is automatically posted and updated by the Contribs GitHub Action.

@NordicBuilder NordicBuilder added the external External contribution label Mar 24, 2023
@hellesvik-nordic hellesvik-nordic force-pushed the partition_manager_single_bootloader_warning branch from d9e345d to 3be14b7 Compare March 24, 2023 11:07
@tejlmand tejlmand removed the external External contribution label Mar 24, 2023
@hellesvik-nordic hellesvik-nordic force-pushed the partition_manager_single_bootloader_warning branch from 3be14b7 to c573dcb Compare March 24, 2023 11:42
@hellesvik-nordic hellesvik-nordic force-pushed the partition_manager_single_bootloader_warning branch 2 times, most recently from ec257a6 to 16177a0 Compare March 24, 2023 14:42
@hellesvik-nordic hellesvik-nordic force-pushed the partition_manager_single_bootloader_warning branch from 16177a0 to ea57327 Compare April 3, 2023 10:43
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Apr 3, 2023

Test specification

CI/Jenkins/NRF

  • Integration Platforms

CI/Jenkins/integration

Test Module File based changes Manually selected West overwrite
desktop52_verification X
test-ci-nrfconnect-boot-fw-update X
test-fw-nrfconnect-apps X
test-fw-nrfconnect-ble X
test-fw-nrfconnect-ble_mesh X
test-fw-nrfconnect-ble_samples X
test-fw-nrfconnect-chip X
test-fw-nrfconnect-fem X
test-fw-nrfconnect-nfc X
test-fw-nrfconnect-nrf-iot_cloud X
test-fw-nrfconnect-nrf-iot_lwm2m X
test-fw-nrfconnect-nrf-iot_mosh X
test-fw-nrfconnect-nrf-iot_positioning X
test-fw-nrfconnect-nrf-iot_samples X
test-fw-nrfconnect-nrf-iot_serial_lte_modem X
test-fw-nrfconnect-nrf-iot_thingy91 X
test-fw-nrfconnect-nrf-iot_zephyr_lwm2m X
test-fw-nrfconnect-nrf_crypto X
test-fw-nrfconnect-proprietary_esb X
test-fw-nrfconnect-rpc X
test-fw-nrfconnect-rs X
test-fw-nrfconnect-tfm X
test-fw-nrfconnect-thread X
test-fw-nrfconnect-zigbee X
test-sdk-audio X
test-sdk-find-my X
test-sdk-homekit X
test-sdk-wifi X

All integration tests: null

Detailed information of selected test modules

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

@hellesvik-nordic hellesvik-nordic force-pushed the partition_manager_single_bootloader_warning branch from ea57327 to 9e56268 Compare April 3, 2023 12:05
@github-actions
Copy link

github-actions bot commented Jun 3, 2023

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Jun 3, 2023
@hellesvik-nordic
Copy link
Contributor Author

It is just review missing on this PR right?
Let me know if there is anything more I should do

@github-actions github-actions bot removed the Stale label Jun 6, 2023
Comment on lines 87 to 89
--- WARNING: Using a single bootloader without pm_static.yml. ---
--- Static partitioning requires using a single bootloader when ---
--- releasing firmware. Only use dynamic during development. ---
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't get it. Isn't it just as problematic having two bootloaders without a static configuration? You need to statically define the size of the first non-upgradeable bootloader in both cases, to avoid run-time issues when programming the updateable bootloader and/or application.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah right.
Yes I agree, the non-upgradable parts should be static, also for two bootloaders.
Should I expand this warning to all build with bootloaders then?
(And rephrase it)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes I would suggest that we do that. The docs covers the other configurations (for example if you have a statically placed file system), and its not trivial to check that in build time through kconfig.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed the check and text now.
What do you think?
(also misclicked resolve)

@hellesvik-nordic hellesvik-nordic force-pushed the partition_manager_single_bootloader_warning branch from 9e56268 to c09b577 Compare June 8, 2023 14:01
Copy link
Contributor

@hakonfam hakonfam left a comment

Choose a reason for hiding this comment

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

Look good. I would, however, consider changing the comment we have now. It provides details relevant for the user, but its hidden in a source file which I guess people won't feel a need to inspect due to the verbosity of the warning message. Its just a nit so feel free to keep it, merge its content to the warning message or simply remove it (especially if you feel that the information it gives is present in the docs pointed to by the warning message).

@hellesvik-nordic hellesvik-nordic force-pushed the partition_manager_single_bootloader_warning branch 3 times, most recently from c6d742d to 9138b8e Compare June 9, 2023 08:20
@hellesvik-nordic
Copy link
Contributor Author

I agree that the comment is redundant now that I refer to the docs in the warning.
Removed the comment.
Also rebased PR to main

@hellesvik-nordic hellesvik-nordic force-pushed the partition_manager_single_bootloader_warning branch from 9138b8e to 6a6ab90 Compare July 4, 2023 06:39
@hellesvik-nordic hellesvik-nordic force-pushed the partition_manager_single_bootloader_warning branch 4 times, most recently from 97afa58 to 2a7f335 Compare July 20, 2023 11:51
Comment on lines 77 to 90
# From Documentation: By default, the Partition Manager dynamically
# places the partitions in memory. However, if you have a deployed
# product that consists of multiple images, where only a subset of
# the included images can be upgraded through a firmware update
# mechanism, the upgradable images must be statically configured.
if (NOT static_configuration AND
(CONFIG_BOOTLOADER_MCUBOOT OR CONFIG_SECURE_BOOT))
message(WARNING "
---------------------------------------------------------------------
--- WARNING: Using a bootloader without pm_static.yml. ---
--- Static partitioning is required for non-upgradable partitions.---
--- See Partition Manager docs on Static Configuration for more ---
--- info. ---
---------------------------------------------------------------------
\n"
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Comment and message are opposed, and message is actually wrong

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point
However, changing it to just
Static partitioning is required for non-upgradable partitions. is neither correct, as it can be done with dual bootloaders.
How about making it more generic?
Static partitioning is required for certain bootloader configurations. Check Partition Manager docs on Static Configuration to see if this applies to you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or possibly Static partitioning is required when using a non-upgradable bootloader. ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I like the last sentence

Copy link
Contributor

Choose a reason for hiding this comment

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

Static partitioning is required when using a non-upgradable bootloader.

Is confusing, it would be better to just link to or quote the documentation as it is on https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/scripts/partition_manager/partition_manager.html#static-configuration

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cant find a way to include the link without exceeding line-length.
So I try to copy the text from docs in.
Then the warning will look like this in a build:
image
What do you think about this?

Copy link
Contributor

Choose a reason for hiding this comment

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

That looks great!

@hellesvik-nordic
Copy link
Contributor Author

Should we add a link to docs instead of just reffering them by name?

@hellesvik-nordic hellesvik-nordic force-pushed the partition_manager_single_bootloader_warning branch from 2a7f335 to a5eab2a Compare July 25, 2023 12:01
Add a warning message if static configuration is missing when building
with a single bootloader.

Ref.: NCSIDB-942

Signed-off-by: Sigurd Hellesvik <[email protected]>
@hellesvik-nordic hellesvik-nordic force-pushed the partition_manager_single_bootloader_warning branch from a5eab2a to ba3f950 Compare July 25, 2023 14:41
@nordicjm nordicjm requested a review from annakielar July 26, 2023 09:26
@nordicjm nordicjm merged commit 4059b61 into nrfconnect:main Jul 26, 2023
38 checks passed
@hellesvik-nordic hellesvik-nordic deleted the partition_manager_single_bootloader_warning branch October 7, 2024 07:05
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants