add ota README.md

This commit is contained in:
wgzAIIT 2023-12-14 18:47:03 +08:00
parent 7af5ff7098
commit 0a241c26e8
32 changed files with 190 additions and 0 deletions

View File

@ -0,0 +1,190 @@
# OTA升级指导文档
## 一、 下载代码程序源码
git clone --branch prepare_for_master https://gitlink.org.cn/xuos/xiuos.git
## 二、 编译bootloader固件
进入到xiuos/Ubiquitous/XiZi_IioT目录下以xidatong-arm32开发板为例执行
make BOARD=xidatong-arm32 menuconfig
依次进入Tool feature > OTA function > Enable support OTA function
勾选如下编译选项:
![](img/bootloader.jpg)
退出menuconfig执行make BOARD=xidatong-arm32进行bin包编译。
最后在xiuos/Ubiquitous/XiZi_IIoT/build目录下编译出XiZi-xidatong-arm32-boot.bin文件:
![](img/bootloader-bin.jpg)
## 三、 Bootloader固件烧录
Bootloader烧录需要使用NXP-MCUBootUtility工具与xidatong-arm32整包烧录步骤一样开发板拨码开关1和2拨回ON后重新上电NXP-MCUBootUtility工具点击Connect to ROM然后起始地址设置为0x60000000长度根据XiZi-xidatong-arm32-boot.bin大小来确定最后选择bin文件的路径
![](img/MCUBootlUtility.jpg)
最后点击Write(Auto Erase)进行烧写。
## 四、 自研平台上新增设备
1登录自研平台网址[ http://115.238.53.59:9898//](http://192.168.141.13:9528/),账户密码需要向管理员索取:
![](img/platform1.jpg)
![](img/platform2.jpg)
2创建设备在登录后的界面左侧变蓝进行设备新增:
![](img/add-device1.jpg)
![](img/add-device2.jpg)
创建完成后,在未激活的设备列表里可以看到新增的设备。
这里的设备序列号我们记下来,编译阶段需要用。我们需要平台相关的五个信息用于设备登录:
CLIENTID: "xidatong0001",
USERNAME: "xiuosiot",
PASSWORD: "xiuosiot"
PLATFORM_SERVERIP: "115.238.53.59"
PLATFORM_SERVERPORT: "1883"
## 五、 编译APP应用程序固件
再次进入到xiuos/Ubiquitous/XiZi_IioT目录下依次执行
make BOARD=xidatong-arm32 distclean
make BOARD=xidatong-arm32 menuconfig
如果需要基于阿里云平台进行OTA升级编译APP应用程序固件需要使能如下选项:
1进入 Tool feature > OTA function > Enable support OTA function
选择编译APP:
![](img/app1.jpg)
![](img/app2.jpg)
2选择进行OTA升级的方式选择IOT平台:
![](img/IOT1.jpg)
![](img/IOT2.jpg)
3进入 APP_Framework > app lib > lib using MQTT > Enable support MQTT function 使能MQTT进入Choose xiuos platform or Alibaba Cloud platform选择xiuos platform:
![](img/MQTT1.jpg)
![](img/MQTT2.jpg)
![](img/MQTT3.jpg)
进入xiuos platform mqtt connection parameter configuration配置参数,将第四步获取到的5个信息填入:
![](img/MQTT4.jpg)
![](img/MQTT5.jpg)
退出menuconfig执行make BOARD=xidatong-arm32进行bin包编译。
最后在xiuos/Ubiquitous/XiZi_IIoT/build目录下编译出XiZi-xidatong-arm32-app.bin文件:
![](img/app-bin.jpg)
第一次烧写app文件通过iap的方式烧写完后设备会自动登录到xiuos管理平台与平台建立连接如下图所示设备端串口显示登录成功:
![](img/shell.jpg)
在设备管理→设备新增→已激活设备列表里可以看到该设备:
![](img/device-list.jpg)
另:设备断开连接时该设备在未激活设备列表中。
## 六、 利用xiuos管理平台进行OTA升级
1上传bin文件到管理平台
查看当前设备的固件版本:
![](img/version.jpg)
当前设备固件的版本为001.000.006接下来设置固件版本要比这个大。平台左边栏选择OTA升级添加升级包:
![](img/add-new-bin.jpg)
填写固件版本信息:
![](img/new-version.jpg)
选择固件进行上传:
![](img/binfile.jpg)
上传后点击验证,固件完成验证就可以进行升级了。
2添加完成后在升级包列表处选择刚添加的升级包点击升级跳出的界面里新增升级任务:
![](img/addtask1.jpg)
在跳出的界面选择新增升级任务:
![](img/addtask2.jpg)
填入升级设备的id就是创建设备时的CLIENTID进行设备在线监测显示设备在线后点击提交。终端设备连接串口助手可以看到升级进度:
![](img/progress1.jpg)
升级过程中,平台端显示进行中:
![](img/progress2.jpg)
3固件烧录完成后自动并登录xiuos管理平台上报最新的版本:
![](img/newversion-report1.jpg)
![](img/newversion-report2.jpg)
刷新固件升级记录,显示成功,升级成功:
![](img/success.jpg)
至此,升级完成。

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB