zigbee3.0 ota 实验

软件:simplicity stdio 、ubuntu18.04

芯片:EFR32MG21A020F768(设备),EFR32MG1P233F256GM48(ncp)

SDK:6.6.3

参考文档:AN728、

服务器:

在simplicity stdio 生成Z3gatewayHost ,然后按默认操作再ubuntu里面编译,编译成功后会有可执行文件,命名为Z3gatewayHost,将后面需要升级的ota文件放到ota-files这个文件夹

ncp:

先生成BootLoader,

步骤:

1.看下图

2.打开hwconf文件,更改usart0 的流控模式为软件流控(Xon-Xoff),然后生成编译,可执行文件命令为EFR32MG1P233F256GM48_bootloader-uart-xmodem-combined.s37

再生成ncp:

1.看图

2. 如下图,声明一点,我这里用的是usart1

3.如下图

4.如下图

 生成编译,固件命名为ncp-uart-sw.s37

设备:

生成BootLoader:BootLoader生成跟平时的一样但是里面的改动看图片

下面就是改动后的

生成编译,固件命名为bootloader-storage-internal-single_MG21A.s37

生成应用程序,按照AN728文档的步骤,一步步来,不同的地方如下图

生成编译,固件为SwitchSoc_Endpoint4.s37(version 1);

复制出来,将版本号改为version2 ,重新编译,将它复制到项目ota-files文件下;

将EFR32MG1P233F256GM48_bootloader-uart-xmodem-combined.s37和ncp-uart-sw.s37下载到EFR32MG1P233F256GM48芯片的设备,此设备跟电脑usb连接;

将bootloader-storage-internal-single_MG21A.s37和SwitchSoc_Endpoint4.s37(version 1)下载到EFR32MG21A020F768(设备)上;

在ubuntu上运行Z3GatewayHost, 打开网络,允许设备入网;

设备加网,执行ota命令,进行ota升级,在此过程,设备会发ota升级请求帧给网关,网关查看对比两个固件的版本是否一致,如果网关的固件版本比设备的固件版本高的话,就进行升级,整个过程大概8分钟;

开始:

[2019-09-17 17:01:31.092]# RECV ASCII>
Processing message: len=19 profile=0104 cluster=0019

T00000000:RX len 19, ep 01, clus 0x0019 (Over the Air Bootloading) FC 19 seq 05 cmd 07 payload[02 10 00 00 04 00 00 00 00 00 00 00 00 00 00 00 ]
OTA command from unrecognized server 0x0000.  My OTA server: 0xFFFD
Error: failed parsing OTA cmd 0x07
T00000000:TX (resp) Ucast 0x00
TX buffer: [00 05 0B 07 7E ]


[2019-09-17 17:03:42.982]# RECV ASCII>
Processing message: len=6 profile=0000 cluster=8006
Setting OTA Server to 0x0000


[2019-09-17 17:03:45.009]# RECV ASCII>
Bootload state: Get OTA Server EUI
OTA Cluster: setting IEEE address of OTA cluster
Last offset downloaded: 0x00000000
No image found in storage.
Processing message: len=16 profile=0104 cluster=0019

T00000000:RX len 16, ep 01, clus 0x0019 (Over the Air Bootloading) FC 19 seq 06 cmd 02 payload[00 02 10 00 00 04 00 00 00 F6 71 03 00 ]
Query next image response: New image is available for download.
Starting download, Version 0x00000004
Bootload state: Downloading Image
Starting erase from offset 0x0

[2019-09-17 17:03:45.094]# RECV ASCII>
0060000 to 0x000BC000


[2019-09-17 17:03:46.176]# RECV ASCII>
EEPROM Erase complete
Processing message: len=80 profile=0104 cluster=0019

T00000000:RX len 80, ep 01, clus 0x0019 (Over the Air Bootloading) FC 19 seq 07 cmd 05 payload[00 02 10 00 00 04 00 00 00 00 00 00 00 3F 1E F1 EE 0B 00 01 38 00 00 00 02 10 00 00 04 00 00 00 02 00 45 42 4C 20 53 77 69 74 63 68 53 6F 63 5F 45 6E 64 70 6F 69 6E 74 34 00 00 00 00 00 00 00 00 00 F6 71 03 00 00 00 B8 71 03 00 EB ]
Download: 0% complete


[2019-09-17 17:03:46.280]# RECV ASCII>
Processing message: len=80 profile=0104 cluster=0019

T00000000:RX len 80, ep 01, clus 0x0019 (Over the Air Bootloading) FC 19 seq 08 cmd 05 payload[00 02 10 00 00 04 00 00 00 3F 00 00 00 3F 17 A6 03 08 00 00 00 00 00 00 03 00 00 00 00 F4 0A 0A F4 1C 00 00 00 01 00 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FD 03 03 FD B0 00 00 00 00 40 00 00 ]

…………

…………

T00000000:RX len 19, ep 01, clus 0x0019 (Over the Air Bootloading) FC 19 seq 07 cmd 07 payload[02 10 00 00 04 00 00 00 00 00 00 00 00 00 00 00 ]
OTA Cluster: wait for 0 s
RXed timeOut 0x00000000 s, MAX timeOut 0x00000DBB s
Adding 3000 ms. delay for immediate upgrade.
Countdown to upgrade: 3000 ms
Bootload state: Co

[2019-09-17 17:10:12.733]# RECV ASCII>
untdown to Upgrade


[2019-09-17 17:10:15.705]# RECV ASCII>
Applying upgrade
Executing bootload callback.


[2019-09-17 17:10:21.266]# RECV ASCII>
Reset info: 0x02 (BTL)
Extended Reset info: 0x0201 (GO )


[2019-09-17 17:10:21.379]# RECV ASCII>
init pass
EEPROM init: 0x00
EMBER_NETWORK_UP 0xB0DC
Bootload state: Random Delay before start
Delaying 55 seconds before starting OTA client
 

 

 

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值