Toggle navigation
首页
问答
文章
话题
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
软件包
ota_downloader
内存释放错误
软件包ota_downloader的http_ota解析导致内存释放断言
发布于 2020-08-19 16:46:44 浏览:986
## 硬件配置: STM32f407ZG平台,网口是LAN8720A,外挂SPIFlash ## 软件环境: RT-Thread Studio生成工程,使用设备维护云生成Bootloader,添加使用软件包ota_downloader并选择http_ota; ## 复现步骤: 使用rt_ota_packaging_tool生成固件并上传至CSDN资源,生成链接https://download.csdn.net/download/lf900619/12726993 ## 测试结果如下: ``` msh />http_ota http://download.csdn.net/download/lf900619/12726993 [581797] D/web: host address: download.csdn.net , port: 80 [581849] D/web: request header: [581852] D/web: GET /download/lf900619/12726993 HTTP/1.1 [581858] D/web: Host: download.csdn.net [581862] D/web: User-Agent: RT-Thread HTTP Agent [581867] D/web: response header: [581888] D/web: HTTP/1.1 301 Moved Permanently [581893] D/web: Server: openresty [581897] D/web: Date: Wed, 19 Aug 2020 06:46:20 GMT [581903] D/web: Content-Type: text/html [581907] D/web: Content-Length: 182 [581911] D/web: Connection: keep-alive [581915] D/web: Keep-Alive: timeout=20 [581920] D/web: Location: https://download.csdn.net/download/lf900619/12726993 [581929] D/web: get position handle response(301). [581934] E/web: not support https connect, please enable webclient https configure! [581944] E/http_ota: webclient GET request failed, response(-1) error. to free a bad data block: mem: 0x20012430, used flag: 0, magic code: 0x1ea0 (mem->used) assertion failed at function:rt_free, line number:587 ``` 这里出现内存释放断言 尝试过程: 将之前生成的固件并上传至七牛云,生成链接 http://qfaiezlse.hn-bkt.clouddn.com/otartthread.rbl ``` msh />http_ota http://qfaiezlse.hn-bkt.clouddn.com/otartthread.rbl [D/web] host address: qfaiezlse.hn-bkt.clouddn.com , port: 80 [D/web] request header: [D/web] GET /otartthread.rbl HTTP/1.1 [D/web] Host: qfaiezlse.hn-bkt.clouddn.com [D/web] User-Agent: RT-Thread HTTP Agent [D/web] response header: [D/web] HTTP/1.1 200 OK [D/web] Server: Tengine [D/web] Content-Type: application/octet-stream [D/web] Content-Length: 201456 [D/web] Connection: keep-alive [D/web] Date: Wed, 19 Aug 2020 03:00:18 GMT [D/web] Accept-Ranges: bytes [D/web] Access-Control-Allow-Origin: * [D/web] Access-Control-Expose-Headers: X-Log, X-Reqid [D/web] Access-Control-Max-Age: 2592000 [D/web] Cache-Control: public, max-age=31536000 [D/web] Content-Disposition: inline; filename="otartthread.rbl"; filename*=utf-8''otartthread.rbl [D/web] Content-Md5: Y4E787WTimN6sCHBpMipug== [D/web] Content-Transfer-Encoding: binary [D/web] Etag: "FmxrK9_HJLYtPKG7lZakMLKffBJo" [D/web] Last-Modified: Wed, 19 Aug 2020 02:55:10 GMT [D/web] X-Log: X-Log [D/web] X-M-Log: QNM:fs225;SRCPROXY:fs177;SRC:312;SRCPROXY:376;QNM3:390 [D/web] X-M-Reqid: 7EIAAMaAmKobjCwW [D/web] X-Qiniu-Zone: 2 [D/web] X-Qnm-Cache: Miss [D/web] X-Reqid: 7rcAAACRTa8bjCwW [D/web] X-Svr: IO [D/web] Ali-Swift-Global-Savetime: 1597806018 [D/web] Via: cache32.l2cn1851[0,200-0,H], cache28.l2cn1851[0,0], cache12.cn2310[0,200-0,H], cache1.cn2310[1,0] [D/web] Age: 3223 [D/web] X-Cache: HIT TCP_HIT dirn:12:927091760 [D/web] X-Swift-SaveTime: Wed, 19 Aug 2020 03:14:53 GMT [D/web] X-Swift-CacheTime: 2592000 [D/web] Timing-Allow-Origin: * [D/web] EagleId: b73cd01515978092418594536e [D/web] get position handle response(200). http file_size:201456 [I/http_ota] Start erase flash (download) partition! [I/http_ota] Erase flash (download) partition success! [I/http_ota] Download: [====================================================================================================] 100% [I/http_ota] Download firmware to flash success. [I/http_ota] System now will restart... [SFUD]Find a Winbond flash chip. Size is 16777216 bytes. [SFUD]spi flash device is initialize success. ``` 在七牛云上是升级成功 添加MbedTLS支持后: ``` msh />http_ota https://download.csdn.net/download/lf900619/12726993 [198457] D/web: host address: download.csdn.net , port: 443 [200161] E/mbedtls.clnt: verify peer certificate fail.... [200168] E/mbedtls.clnt: verification info: ! The certificate is not correctly signed by the trusted CA [200180] D/web: request header: [200183] D/web: GET /download/lf900619/12726993 HTTP/1.1 [200189] D/web: Host: download.csdn.net [200193] D/web: User-Agent: RT-Thread HTTP Agent [200198] D/web: response header: [200363] E/mbedtls.clnt: mbedtls_client_read data error, return -0x7200 [200371] D/web: get position handle response(-29184). [200376] E/http_ota: webclient GET request failed, response(-29184) error. ``` 识别出身份认证失败,没有出现断言情况
查看更多
lizhen9880
认证专家
2020-08-21
This guy hasn't written anything yet
题主可能并不是纠结于身份认证不对,或者是mbedtls,而是觉得即便没有打开mbedtls,直接用http去请求https链接,不应触发内存无法释放这种级别的断言,看起来像是某个内存被多释放了一次。 题主可以debug一下,在发生断言时看一下栈内容,哪些函数被压栈了,层层剥离找出原因。如果确实是bug,可发起 PR 让更多人受益,如果不熟悉如何PR,可在将查bug过程及结果在gitee或github发issues
3
个回答
默认排序
按发布时间排序
踩姑娘的小蘑菇
2020-08-19
This guy hasn't written anything yet
你这url有问题的,你把上面的url复制到浏览器,看能不能下载到文件,再用下面的试试
xiangxistu
2020-08-20
This guy hasn't written anything yet
https 比 http 多了一个 mbedtls 的使用。建议使能 webclient 软件包的 TLS 功能。
撰写答案
登录
注册新账号
关注者
1
被浏览
986
关于作者
Haley
This guy hasn't written anything yet
提问
1
回答
1
被采纳
0
关注TA
发私信
相关问题
1
更新软件包 没有自动下载软件包
2
点更新软件包后, 软件包并没有被下载
3
RTT加载软件包的机制是什么
4
mqtt软件包,不支持直接关闭?
5
sr04软件包排他性问题
6
有没有大神移植一个HX711称重芯片模块的软件包
7
【建议】软件包分类增加“算法”类
8
RT-Thread Studio软件包
9
rc522 软件包 问题
10
卡尔曼软件包 中的 ulapack.h 在哪里呢
推荐文章
1
RT-Thread应用项目汇总
2
玩转RT-Thread系列教程
3
五分钟玩转RT-Thread新社区
4
机器人操作系统 (ROS2) 和 RT-Thread 通信
5
关于STM32H7开发板上使用SDIO接口驱动SD卡挂载文件系统的问题总结
6
【技术三千问】之《玩转ART-Pi》,看这篇就够了!干货汇总
7
【ART-PI】RT-Thread 开启RTC 与 Alarm组件
8
STM32的“GPU”——DMA2D实例详解
9
RT-Thread隐藏的宝藏之completion
10
国产MCU移植系列教程汇总,欢迎查看!
最新文章
1
RT-Thread Studio V2.2.4 Release Note
2
RT-Thread studio里面的PWM驱动提示有误(浪费几个小时)
3
关于时间片调度算法issue的分析与解决
4
【社区福利】6月积分兑好礼(机械键盘、开发板、小风扇...)
5
[ART smart 开发板] SDL测试
热门标签
RT-Thread Studio
串口
LWIP
AT
FinSH
Env
ART-Pi
SPI
Bootloader
USB
Hardfault
CAN
文件系统
studio
DMA
RT-Thread
线程
Nano
stm32
ota
MQTT
SCons
rtthread
ESP8266
freemodbus
软件包
I2C
UART
flash
cubemx
RTC
定时器
W5500
FAL
BSP
rt-smart
rtt
PWM
AB32VG1
ADC
编译报错
msh
socket
SDIO
C++
dfs
at_device
SFUD
MicroPython
RT-Studio
本月问答贡献
小小李sunny
41
个答案
10
次被采纳
出出啊
34
个答案
10
次被采纳
红枫
25
个答案
7
次被采纳
crystal266
23
个答案
6
次被采纳
lchnu
13
个答案
6
次被采纳
本月文章贡献
张世争
11
篇文章
31
次点赞
吉利咕噜2022
7
篇文章
15
次点赞
xusiwei1236
3
篇文章
11
次点赞
crystal266
3
篇文章
8
次点赞
Liutao
3
篇文章
4
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部