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

nRF5340 external-xip DFU sample #13509

Merged
merged 3 commits into from
Feb 20, 2024

Conversation

nvlsianpu
Copy link
Contributor

@nvlsianpu nvlsianpu commented Dec 22, 2023

This PR is for introducing support for external-xip sample and basic support for nRF5340.
This brings work which was hosted in https://github.com/NordicPlayground/ncs-nrf5340-xip-app/tree/main/smp_svr to the NCS.

  • the sample is support using childimage. It will be migrated to sysbuild after the NCS 2.6.0 by my team.
  • there are many issues on multi-image DFU support. These issues are planed to be solved one by one in iteratively manner. Most of issues I know are threaten independently from this sample - they are on parallel track in roadmap.
  • sum-up is that: this sample is experimental sample.

external-xip documentation PR

@github-actions github-actions bot added changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. doc-required PR must not be merged without tech writer approval. labels Dec 22, 2023
@NordicBuilder
Copy link
Contributor

You can find the documentation preview for this PR at this link. It will be updated about 10 minutes after the documentation build succeeds.

Note: This comment is automatically posted by the Documentation Publishing GitHub Action.

@NordicBuilder
Copy link
Contributor

NordicBuilder commented Jan 2, 2024

Test specification

CI/Jenkins/NRF

  • Integration Platforms

CI/Jenkins/integration

Test Module File based changes Manually selected West overwrite
test-fw-nrfconnect-boot X
test-fw-nrfconnect-chip X
test-fw-nrfconnect-fw-update X
test-fw-nrfconnect-zigbee X
test-sdk-find-my X
test-sdk-sidewalk X

Detailed information of selected test modules

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


project(smp_svr)

target_sources(app PRIVATE src/main.c)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[RFC]: Zephyr original source code might be included into that build instead of their copies.
Should that way be used?

target_sources(app PRIVATE $ENV{ZEPHYR_BASE}/samples/subsys/mgmt/mcumgr/smp_svr/src/main.c)
target_sources_ifdef(CONFIG_MCUMGR_TRANSPORT_BT app PRIVATE $ENV{ZEPHYR_BASE}/samples/subsys/mgmt/mcumgr/smp_svr/src/bluetooth.c)

# This places the application bluetooth.c file and some MCUmgr libraries into QSPI XIP
zephyr_code_relocate(FILES $ENV{ZEPHYR_BASE}/samples/subsys/mgmt/mcumgr/smp_svr/src/bluetooth.c LOCATION EXTFLASH_TEXT NOCOPY)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@de-nordic @nordicjm Your opinion?

@nvlsianpu nvlsianpu changed the title Nrf5340 anpu ext xip nRF5340 external-xip DFU sample Jan 11, 2024
@nvlsianpu nvlsianpu marked this pull request as ready for review January 12, 2024 13:45
@nvlsianpu nvlsianpu requested review from a team, de-nordic and nordicjm as code owners January 12, 2024 13:45

project(smp_svr)

target_sources(app PRIVATE src/main.c)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@de-nordic @nordicjm Your opinion?

samples/nrf5340/smp_svr/README.rst Outdated Show resolved Hide resolved
@nordicjm
Copy link
Contributor

I've said my opinions on this before

@nordicjm nordicjm removed their request for review January 15, 2024 07:39
@nvlsianpu nvlsianpu force-pushed the nrf5340-anpu-ext-xip branch 4 times, most recently from 013f97c to 4f7b736 Compare January 16, 2024 18:10
@shanthanordic shanthanordic requested review from gchwier and removed request for a team January 17, 2024 08:01
@nvlsianpu nvlsianpu added this to the 2.6.0 milestone Jan 17, 2024
@nvlsianpu
Copy link
Contributor Author

I've said my opinions on this before

I know your opinion. For others:

  • the sample is support using childimage. It will be migrated to sysbuild after the NCS 2.6.0 by my team.
  • there are many issues on multi-image DFU support. These issues are planed to be solved one by one in iteratively manner. Most of issues I know are threaten independently from this sample - they are on parallel track in roadmap.
  • sum-up is that: this sample is experimental.

Copy link
Contributor

@gchwier gchwier left a comment

Choose a reason for hiding this comment

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

This sample is based on smp_svr, but IMO it should have different name, something with xip in it, because it is specific to XIP.
You can consider also moving it to tests folder. You can find specific tests for mcuboot here:
https://github.com/nrfconnect/sdk-nrf/tree/main/tests/modules/mcuboot,
or for bootloader:
https://github.com/nrfconnect/sdk-nrf/tree/main/tests/subsys/bootloader/boot_chains

description: Simple Management Protocol sample
name: smp svr
common:
harness: bluetooth
Copy link
Contributor

Choose a reason for hiding this comment

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

consider changing it to at least harness: console, to just verify if sample is booted,
you can use something like that:

  harness: console
  harness_config:
    type: one_line
    regex:
      - "Hello World! (.*)"

Copy link
Contributor

Choose a reason for hiding this comment

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

or I can later (in separate PR) extend it with a pytest scenario to test full upgrade with mcumgr (like in https://github.com/zephyrproject-rtos/zephyr/tree/main/tests/boot/with_mcumgr)

- thingy53_nrf5340_cpuapp
integration_platforms:
- nrf5340dk_nrf5340_cpuapp
- thingy53_nrf5340_cpuapp
Copy link
Contributor

Choose a reason for hiding this comment

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

is this sample works on thingy? with the same pm_static.yml?

Copy link
Contributor

Choose a reason for hiding this comment

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

is that file used anywhere? I don't see extra_args: DTC_OVERLAY_FILE="app.overlay" in sample.yaml

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

@de-nordic
Copy link
Contributor

I do not know whether this is relevant here, but I have created some time ago PR for support of nrf5340, non-xip, to sdk-nrf but it has been denied because it was not upstreamed nrfconnect/sdk-zephyr#909

Copy link
Contributor Author

@nvlsianpu nvlsianpu left a comment

Choose a reason for hiding this comment

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

@kittydepa Applied.

samples/nrf5340/extxip_smp_svr/README.rst Show resolved Hide resolved
samples/nrf5340/extxip_smp_svr/README.rst Outdated Show resolved Hide resolved
samples/nrf5340/extxip_smp_svr/README.rst Outdated Show resolved Hide resolved
samples/nrf5340/extxip_smp_svr/README.rst Outdated Show resolved Hide resolved
samples/nrf5340/extxip_smp_svr/README.rst Outdated Show resolved Hide resolved
samples/nrf5340/extxip_smp_svr/README.rst Outdated Show resolved Hide resolved
samples/nrf5340/extxip_smp_svr/README.rst Outdated Show resolved Hide resolved
samples/nrf5340/extxip_smp_svr/README.rst Outdated Show resolved Hide resolved
@github-actions github-actions bot removed the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Feb 19, 2024
help
Allows for an image to be split into 2 parts where there is code executing from internal
flash and code from QSPI via XIP. Requires specific project setup for projects to use
this feature:: project's cmake which supports code dispatching, linker script for describe QSPI
Copy link
Contributor

Choose a reason for hiding this comment

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

@nvlsianpu Are the double colons here intentional (::)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that a typo

samples/nrf5340/extxip_smp_svr/README.rst Show resolved Hide resolved
samples/nrf5340/extxip_smp_svr/README.rst Outdated Show resolved Hide resolved
samples/nrf5340/extxip_smp_svr/README.rst Outdated Show resolved Hide resolved
samples/nrf5340/extxip_smp_svr/README.rst Outdated Show resolved Hide resolved
samples/nrf5340/extxip_smp_svr/README.rst Outdated Show resolved Hide resolved
samples/nrf5340/extxip_smp_svr/README.rst Outdated Show resolved Hide resolved
samples/nrf5340/extxip_smp_svr/README.rst Outdated Show resolved Hide resolved
@nvlsianpu
Copy link
Contributor Author

Falling CI stage passed after re-run.

Adds support for third image in the QSPI XIP space.
This image is desired to be the part of cpuapp application executable
relocated to the QSPI memory.

Signed-off-by: Jamie McCrae <[email protected]>
Signed-off-by: Torsten Rasmussen <[email protected]>
Signed-off-by: Andrzej Puzdrowski <[email protected]>
Added sample whit configuration which allows to run part
of the code form external QSPI flash, which shows the QSPI XIP
feature. The sample C code is the same as zephr-rtos smp_svr
sample (It Use zephy-rtos embedded source C code instead of
copying it)

Signed-off-by: Anna Wojdylo <[email protected]>
Signed-off-by: Kitty Depa <[email protected]>
Signed-off-by: Andrzej Puzdrowski <[email protected]>
Added release note on external XIP DFU sample for nrf5340.

Signed-off-by: Andrzej Puzdrowski <[email protected]>
@nordicjm nordicjm merged commit 1d13a15 into nrfconnect:main Feb 20, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-required PR must not be merged without tech writer approval.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants