nRF Connect SDK v2.6.1 DFU 配置(由 SDK v2.1.0 迁移)

1. 参考:Add DFU support to your application

Add DFU support to your application

首先我们使用SDK v2.6.1新建一个project,请根据上述链接中的配置工程。
DFU over Bluetooth
Modify the Peripheral LBS sample

重点:

#Enable MCUBOOT bootloader build in the application
CONFIG_BOOTLOADER_MCUBOOT=y
#Include MCUMGR and the dependencies in the build
CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y

以上使用NRF52840DK 测试通过。

2. 配置原有的旧porject

因为我们的project是 SDK v2.1.0 版本的,SDK v2.6.1的DFU配置已经变化了很多,所以我们根据第一步参考的配置移植。

有关 CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU 的描述请点击链接查看,其使能了很多相关配置。

将上述配置复制到我们project的overlay-dfu.conf 文件,需要更改格式,如下:

# Allow for large Bluetooth data packets.
CONFIG_BT_L2CAP_TX_MTU=498
CONFIG_BT_BUF_ACL_TX_SIZE=251
CONFIG_BT_BUF_ACL_RX_SIZE=502
CONFIG_BT_CTLR_DATA_LENGTH_MAX=251

#Enable MCUBOOT bootloader build in the application
CONFIG_BOOTLOADER_MCUBOOT=y

CONFIG_NET_BUF=y
CONFIG_ZCBOR=y
CONFIG_CRC=y
CONFIG_STREAM_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_FLASH=y

CONFIG_IMG_MANAGER=y
CONFIG_IMG_ERASE_PROGRESSIVELY=y

CONFIG_MCUMGR=y
CONFIG_MCUMGR_GRP_IMG=y
CONFIG_MCUMGR_GRP_OS=y
CONFIG_MCUMGR_GRP_OS_BOOTLOADER_INFO=y
CONFIG_MCUMGR_GRP_OS_MCUMGR_PARAMS=y
# Enable the Bluetooth mcumgr transport (unauthenticated).
CONFIG_MCUMGR_TRANSPORT_BT=y
CONFIG_MCUMGR_TRANSPORT_BT_AUTHEN=n
# Enable the mcumgr Packet Reassembly feature over Bluetooth and its configuration dependencies.
# MCUmgr buffer size is optimized to fit one SMP packet divided into five Bluetooth Write Commands,
# transmitted with the maximum possible MTU value: 498 bytes.
CONFIG_MCUMGR_TRANSPORT_BT_REASSEMBLY=y
CONFIG_MCUMGR_TRANSPORT_BT_CONN_PARAM_CONTROL=y
CONFIG_MCUMGR_TRANSPORT_NETBUF_SIZE=2475

# Enable the Shell mcumgr transport.
#CONFIG_BASE64=y
#CONFIG_SHELL=y
#CONFIG_SHELL_BACKEND_SERIAL=y
#CONFIG_MCUMGR_TRANSPORT_SHELL=y

# #if (SETTINGS_FCB || SETTINGS_NVS)
# # Enable support for the storage erase operation only when the storage
# # partition is created by the Partition Manager.
# CONFIG_MCUMGR_GRP_ZBASIC=y
# CONFIG_MCUMGR_GRP_ZBASIC_STORAGE_ERASE=y
# #endif # (SETTINGS_FCB || SETTINGS_NVS)

以上配置测试通过。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值