Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Potential bug when checking SoftDevice requirements (sd_req_ok)

// Don't allow SoftDevice updates which assume no SD is present already.
result = !prevent_downgrade || (p_init->type != DFU_FW_TYPE_SOFTDEVICE);

Hi everyone, I would like to confirm if this is a bug.

Per the comment, it seems that the intent of the code is to reject an attempted SoftDevice update.

However, this only works if type is DFU_FW_TYPE_SOFTDEVICE.

This allows an attempted SoftDevice update if DFU_FW_TYPE_SOFTDEVICE_BOOTLOADER is used.

Should the condition be something similar to:

(!(p_init->type & DFU_FW_TYPE_SOFTDEVICE))

Related