-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
applications: nrf_desktop: Add SMP SUIT DFU support for nrf54h20 #15553
Conversation
Test specificationCI/Jenkins/NRF
CI/Jenkins/integration
Detailed information of selected test modules Note: This message is automatically posted and updated by the CI |
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. |
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.
Looking good, suggested a few improvements
applications/nrf_desktop/configuration/nrf54h20dk_nrf54h20_cpuapp/prj_release.conf
Outdated
Show resolved
Hide resolved
applications/nrf_desktop/configuration/nrf54h20dk_nrf54h20_cpuapp/prj_release.conf
Outdated
Show resolved
Hide resolved
applications/nrf_desktop/configuration/nrf54h20dk_nrf54h20_cpuapp/prj_release.conf
Outdated
Show resolved
Hide resolved
applications/nrf_desktop/configuration/nrf54h20dk_nrf54h20_cpuapp/prj_release.conf
Show resolved
Hide resolved
applications/nrf_desktop/configuration/nrf54h20dk_nrf54h20_cpuapp/prj_release.conf
Outdated
Show resolved
Hide resolved
applications/nrf_desktop/configuration/nrf54h20dk_nrf54h20_cpuapp/prj_release.conf
Outdated
Show resolved
Hide resolved
applications/nrf_desktop/configuration/nrf54h20dk_nrf54h20_cpuapp/prj.conf
Show resolved
Hide resolved
c8ddd78
to
1ced105
Compare
applications/nrf_desktop/configuration/nrf54h20dk_nrf54h20_cpuapp/app.overlay
Show resolved
Hide resolved
suit_manifest_class_id_t *)&manifest_class_id, | ||
&seq_num, NULL, NULL, NULL, NULL); | ||
if (!err) { | ||
LOG_INF("SUIT image version: %d", seq_num); |
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.
Can we call it SUIT sequence number? To be consistent with how SUIT names it.
applications/nrf_desktop/configuration/nrf54h20dk_nrf54h20_cpuapp/prj.conf
Show resolved
Hide resolved
applications/nrf_desktop/configuration/nrf54h20dk_nrf54h20_cpuapp/prj.conf
Show resolved
Hide resolved
@@ -9,20 +9,16 @@ menuconfig DESKTOP_DFU_MCUMGR_ENABLE | |||
select EXPERIMENTAL | |||
select CAF_BLE_SMP_TRANSFER_EVENTS if MCUMGR_TRANSPORT_BT | |||
select MCUMGR | |||
select MCUMGR_GRP_IMG | |||
select MCUMGR_GRP_OS |
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.
Do we need CONFIG_MCUMGR_GRP_OS
for SUIT?
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.
Yes because:
Allow a DFU host to retrieve information about the number and size of MCUmgr buffers.
The nRF Connect Device Manager uses this information to speed up the DFU.
CONFIG_MCUMGR_GRP_OS_MCUMGR_PARAMS=y
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.
If it's only speed improvement (not an actual requirement) it should be enabled in *.conf
file I think (or eventually it can be implied). Keep in mind that OS mgmt is required for SMP DFU on nRF52, because it enables system reboot command that is used right after finalized DFU image transfer (phone triggers reboot command automatically on finalized DFU).
select MCUMGR_GRP_OS | ||
select MCUMGR_MGMT_NOTIFICATION_HOOKS | ||
select MCUMGR_GRP_IMG_MUTEX if DESKTOP_DFU_LOCK | ||
select MCUMGR_SMP_COMMAND_STATUS_HOOKS | ||
select NET_BUF | ||
select ZCBOR | ||
select CRC | ||
select IMG_MANAGER | ||
select MCUBOOT_BOOTUTIL_LIB | ||
select STREAM_FLASH |
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.
Is stream flash used by SUIT? (please also double check the remaining Kconfig options selected as common)
@zycz, could you resolve Compliance issue? |
82b4b6f
to
4c1ec45
Compare
5d77a95
to
877c939
Compare
applications/nrf_desktop/configuration/nrf54h20dk_nrf54h20_cpuapp/prj.conf
Show resolved
Hide resolved
|
||
# Allow for large Bluetooth data packets. | ||
CONFIG_BT_BUF_ACL_RX_SIZE=502 | ||
CONFIG_BT_BUF_ACL_TX_SIZE=251 |
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.
Shouldn't we also set CONFIG_BT_CTLR_DATA_LENGTH_MAX=251
?
#ifndef _DESKTOP_SUIT_UTIL_H_ | ||
#define _DESKTOP_SUIT_UTIL_H_ | ||
|
||
int suit_get_installed_manifest_seq_num(unsigned int *seq_num); |
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.
Not sure if it's worth to use separate file for this function (it's like 3 lines of code, it may be simply copy-pasted to the DFU module if needed)
img_mgmt_reset_upload(); | ||
#elif defined CONFIG_DESKTOP_DFU_BACKEND_SUIT | ||
suit_dfu_cleanup(); |
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.
Check returned value, 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.
@tomchy, do you plan to expose a suitfu API to allow application trigger the upload cleanup or we can rely on suit_dfu_cleanup
here? If you are going to cache some information about the image upload, our current approach may introduce side-effect for you - that's why I decided to notify you
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.
Check returned value, please.
module state error
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 idea was to provide suit_dfu
module if you want to manage the update in a more advanced way, so this usage is correct.
The SUITFU resets the internal state whenever an upload with off == 0
is received.
f47c2ce
to
305040e
Compare
depends on BOOTLOADER_MCUBOOT | ||
select FLASH_MAP | ||
select ZCBOR | ||
|
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.
Remove extra empty line, please
if (!err) { | ||
LOG_INF("SUIT sequence number: %d", seq_num); | ||
} else { | ||
LOG_ERR("suit_get_installed_manifest_seq_num failed (err: %d)", err); |
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 error log seems outdated
@@ -52,3 +52,18 @@ | |||
}; | |||
}; | |||
}; | |||
|
|||
&cpuapp_rw_partitions { | |||
dfu_partition: partition@13c000 { |
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.
I'll try to remember about it in #15490 🙂
img_mgmt_reset_upload(); | ||
#elif defined CONFIG_DESKTOP_DFU_BACKEND_SUIT | ||
suit_dfu_cleanup(); |
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 idea was to provide suit_dfu
module if you want to manage the update in a more advanced way, so this usage is correct.
The SUITFU resets the internal state whenever an upload with off == 0
is received.
Add SMP SUIT DFU support for nrf_desktop application. JIRA: NCSDK-26998 NCSDK-25024 Signed-off-by: Jan Zyczkowski <[email protected]>
Add SMP SUIT DFU support for nrf_desktop application.
JIRA: NCSDK-26998