Skip to content

app: add DFU support#101

Merged
trantanen merged 3 commits into
nrfconnect:mainfrom
SyverHaraldsen:SM_FMDFU
Dec 19, 2025
Merged

app: add DFU support#101
trantanen merged 3 commits into
nrfconnect:mainfrom
SyverHaraldsen:SM_FMDFU

Conversation

@SyverHaraldsen

@SyverHaraldsen SyverHaraldsen commented Nov 28, 2025

Copy link
Copy Markdown
Contributor

Add support for MCUBOOT, delta modem and full modem DFU.

Jira: SM-146
Jira: SM-90

@MarkusLassila MarkusLassila left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice work! Some questions to get us started.

Comment thread app/src/main.c Outdated
Comment thread app/src/sm_at_host.c Outdated
Comment thread app/src/main.c
Comment thread app/src/sm_at_dfu.c Outdated
Comment thread app/src/main.c Outdated
Comment thread app/src/sm_at_dfu.c
Comment thread app/src/sm_at_dfu.c
Comment thread app/src/sm_at_dfu.c Outdated
Comment thread app/src/sm_at_host.c Outdated
@SyverHaraldsen SyverHaraldsen force-pushed the SM_FMDFU branch 3 times, most recently from ff4110b to d871155 Compare December 1, 2025 13:13
@SyverHaraldsen

Copy link
Copy Markdown
Contributor Author

re-factored slightly, and added template to implement delta modem and application DFU into the XDFU command.

@SyverHaraldsen SyverHaraldsen force-pushed the SM_FMDFU branch 2 times, most recently from c14ae17 to d5ec7ad Compare December 3, 2025 13:07
@SyverHaraldsen SyverHaraldsen changed the title app: add full modem DFU support app: add DFU support Dec 3, 2025
@SyverHaraldsen

Copy link
Copy Markdown
Contributor Author

Added support for delta modem and application (MCUBoot) DFU.
There is some deliberate duplication between the different DFU handlers and datamode callbacks right now. Before I refactor I would like some feedback on whether a single generic handler to reduce duplicate code is preferred, or if keeping the flows split for maintainability and clearer DFU-type-specific error messages is better.

@MarkusLassila MarkusLassila left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(Some of the comments might be bit old, as I forgot to push the submit review)

Comment thread app/src/main.c Outdated
Comment thread app/src/main.c
Comment thread app/src/sm_at_dfu.c Outdated
Comment thread app/src/sm_at_dfu.c Outdated

@trantanen trantanen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Some small comments

Comment thread app/src/main.c Outdated
Comment thread app/src/sm_at_dfu.h Outdated
Comment thread app/src/sm_at_host.c Outdated
Comment thread app/src/sm_at_dfu.c Outdated
@SyverHaraldsen SyverHaraldsen force-pushed the SM_FMDFU branch 3 times, most recently from 1941259 to 2b3e940 Compare December 10, 2025 13:08

@MarkusLassila MarkusLassila left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Moving to correct direction. 👍

Some of the bootloader_mode code in other files is begging for explanation when this is used. That makes me wonder if that should be flagged behind the full_modem_dfu Kconfig after all.

Comment thread app/src/main.c Outdated
Comment thread app/src/sm_at_host.c
Comment thread app/src/sm_at_dfu.c Outdated
Comment thread app/src/sm_at_dfu.c
Comment thread app/src/sm_at_dfu.c
Comment thread app/src/sm_at_host.c Outdated
Comment thread app/src/sm_at_dfu.c
Comment thread app/src/sm_at_dfu.c
Comment thread doc/app/sm_at_dfu.rst Outdated
Comment thread doc/app/SM_AT_DFU_commands.rst Outdated
Comment thread doc/app/sm_at_dfu.rst Outdated
Comment thread app/Kconfig Outdated
@SyverHaraldsen SyverHaraldsen marked this pull request as ready for review December 15, 2025 09:01
Comment thread app/overlay-full_dfu.conf Outdated
Comment thread doc/app/AT_commands.rst Outdated
Comment thread doc/app/sm_at_dfu.rst Outdated
Comment thread doc/app/at_dfu.rst
Comment thread doc/app/SM_AT_DFU_commands.rst Outdated
Comment thread app/Kconfig Outdated
Comment thread doc/app/SM_AT_DFU_commands.rst Outdated
Comment thread doc/app/SM_AT_DFU_commands.rst Outdated
Comment thread doc/app/SM_AT_DFU_commands.rst Outdated
Comment thread doc/app/SM_AT_DFU_commands.rst Outdated
Comment thread doc/app/SM_AT_DFU_commands.rst Outdated
Comment thread app/src/sm_at_dfu.c Outdated
Comment thread app/src/sm_at_dfu.c
Comment thread app/src/sm_at_dfu.c
Comment thread app/src/sm_at_host.c Outdated
Comment thread app/src/sm_at_host.c Outdated
Comment thread app/Kconfig Outdated
Comment thread doc/app/sm_description.rst Outdated
Comment thread doc/app/SM_AT_DFU_commands.rst Outdated
Comment thread doc/app/at_dfu.rst
Comment thread doc/app/at_dfu.rst
Comment thread doc/app/DFU_AT_commands.rst Outdated
Comment thread doc/app/DFU_AT_commands.rst Outdated
Comment thread doc/app/at_dfu.rst

@MarkusLassila MarkusLassila left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Almost there!

Note that some of my comments are not visible in the code due to update(?).

@SyverHaraldsen SyverHaraldsen force-pushed the SM_FMDFU branch 2 times, most recently from c6ad891 to 43158a8 Compare December 16, 2025 11:49
@trantanen trantanen requested a review from divipillai December 16, 2025 12:05
Comment thread app/src/sm_at_dfu.c
@SyverHaraldsen

Copy link
Copy Markdown
Contributor Author

Fixed sm_at_host.c conflict

Comment thread doc/app/DFU_AT_commands.rst Outdated
Comment thread doc/app/DFU_AT_commands.rst Outdated
Comment thread doc/app/DFU_AT_commands.rst Outdated
Comment thread doc/app/DFU_AT_commands.rst Outdated
Comment thread doc/app/DFU_AT_commands.rst Outdated
Comment thread doc/app/DFU_AT_commands.rst Outdated
Comment thread doc/app/DFU_AT_commands.rst Outdated
Comment thread doc/app/sm_description.rst Outdated
Comment thread doc/app/sm_description.rst Outdated
Comment thread doc/app/at_dfu.rst
@SyverHaraldsen SyverHaraldsen force-pushed the SM_FMDFU branch 2 times, most recently from c700a3d to aa772c8 Compare December 16, 2025 18:53
@SyverHaraldsen SyverHaraldsen force-pushed the SM_FMDFU branch 3 times, most recently from 9749d10 to 39e8768 Compare December 17, 2025 14:03

@MarkusLassila MarkusLassila left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Script feedback

Comment thread doc/app/at_dfu.rst
Comment thread app/scripts/sm_dfu_host.py Outdated
Comment thread app/scripts/sm_dfu_host.py Outdated
Comment thread app/scripts/sm_dfu_host.py
Comment thread app/scripts/sm_dfu_host.py Outdated
Comment thread app/scripts/sm_dfu_host.py Outdated
Comment thread app/scripts/sm_dfu_host.py
Comment thread app/scripts/sm_dfu_host.py
Comment thread app/scripts/sm_dfu_host.py Outdated
@SyverHaraldsen SyverHaraldsen force-pushed the SM_FMDFU branch 4 times, most recently from 2609e28 to f9b6cf5 Compare December 18, 2025 13:07

@MarkusLassila MarkusLassila left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fix the license and I will approve this.

Comment thread app/scripts/sm_dfu_host.py Outdated
Comment thread app/scripts/sm_dfu_host.py
Comment thread app/scripts/sm_dfu_host.py
@MarkusLassila

Copy link
Copy Markdown
Contributor

LGTM!

Comment thread app/Kconfig Outdated
This commit adds support for MCUBoot, delta modem and full modem DFU
to the serial modem firmware.

Signed-off-by: Syver Haraldsen <syver.haraldsen@nordicsemi.no>
This commit adds a Python host script for XDFU commands.
The script supports application, delta modem and full modem DFU.

Signed-off-by: Syver Haraldsen <syver.haraldsen@nordicsemi.no>
This commit adds DFU AT commands documentation.
It also documents an example Python host script for DFU.

Signed-off-by: Syver Haraldsen <syver.haraldsen@nordicsemi.no>
@trantanen trantanen merged commit ef55111 into nrfconnect:main Dec 19, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants