使用RT_Thread添加OTA功能

OTA(Over the Air),即空中下载技术,可实现远程升级固件,避免现场烧录的麻烦。

参考资料:工程基于stm32F103ZET6

1.官方资料 https://www.rt-thread.org/document/site/application-note/system/rtboot/an0028-rtboot/

2.论坛中遇到的BUG与解决方案https://club.rt-thread.org/ask/question/12241.html

3.Tools下载:

a:通用Bootloader生成网址http://iot.rt-thread.com/#/homePage,注意版本号、解压缩、密码必须相同

b:  固件打包器https://gitee.com/jzhiyu/ota_downloader?utm_source=aladin&utm_campaign=repo

c:  fal_cfg.h文件

#ifndef _FAL_CFG_H_
#define _FAL_CFG_H_

#include <rtthread.h>
#include <board.h>

extern const struct fal_flash_dev stm32_onchip_flash;
//#define RT_APP_PART_ADDR     0x08040000 //app中添加或此处添加,需要地址相同
/* flash device table */
#define FAL_FLASH_DEV_TABLE                                          \
{                                                                    \
    &stm32_onchip_flash,                                             \
}
/* ====================== Partition Configuration ========================== */
#ifdef FAL_PART_HAS_TABLE_CFG

/* partition table */
#define FAL_PART_TABLE                                                                      \
{                                                                                           \
    {FAL_PART_MAGIC_WROD,        "app",              "onchip_flash",       256* 1024,  128 * 1024, 0}, \
    {FAL_PART_MAGIC_WROD,        "download",        "onchip_flash",       128* 1024 , 128 * 1024, 0},  \
    {FAL_PART_MAGIC_WROD,        "factory",        "onchip_flash",       384* 1024 , 128 * 1024, 0},  \
}
#endif /* FAL_PART_HAS_TABLE_CFG */
#endif /* _FAL_CFG_H_ */
 

 

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值