错误日志是内存不足,建议可以增加一下接收内存。
另外也有人这种情况原因是网络问题导致的,需要优化程序,可以参考这个 (https://club.rt-thread.org/ask/question/423912.html)
可能是传输速度太快,socket数据缓存来不及释放,可以在http_ota第155行后加rt_thread_mdelay试试
我试了下还是不行,然后我再urc_recv_func函数中添加了,打印 内存使用率 的函数。
msh />http_ota
using uri: http://192.168.1.101:80/rtthread.rbl
[37412] D/web: host address: 192.168.1.101 , port: 80
total memory: 56560
used memory : 24968
maximum allocated memory: 25048
total memory: 56560
used memory : 26292
maximum allocated memory: 26444
total memory: 56560
used memory : 27816
maximum allocated memory: 27816
total memory: 56560
used memory : 29324
maximum allocated memory: 29324
[386total memory: 56560
used memory : 30832
maximum allocated memory: 30832
80total memory: 56560
used memory : 32340
maximum allocated memory: 32340
total memory: 56560
used memory : 32420
maximum allocated memory: 32420
]total memory: 56560
used memory : 33928
maximum allocated memory: 33928
Dtotal memory: 56560
used memory : 35436
maximum allocated memory: 35436
/webtotal memory: 56560
used memory : 36944
maximum allocated memory: 36944
total memory: 56560
used memory : 37004
maximum allocated memory: 37004
: total memory: 56560
used memory : 38512
maximum allocated memory: 38512
reqtotal memory: 56560
used memory : 40020
maximum allocated memory: 40020
total memory: 56560
used memory : 41528
maximum allocated memory: 41528
uest total memory: 56560
used memory : 43036
maximum allocated memory: 43036
heatotal memory: 56560
used memory : 44544
maximum allocated memory: 44544
dertotal memory: 56560
used memory : 46052
maximum allocated memory: 46052
total memory: 56560
used memory : 47560
maximum allocated memory: 47560
total memory: 56560
used memory : 49068
maximum allocated memory: 49068
total memory: 56560
used memory : 50576
maximum allocated memory: 50576
total memory: 56560
used memory : 50636
maximum allocated memory: 50636
total memory: 56560
used memory : 52144
maximum allocated memory: 52144
total memory: 56560
used memory : 53652
maximum allocated memory: 53652
[4total memory: 56560
used memory : 55160
maximum allocated memory: 55160
0744] D/web: GET /rtthread.rbl HTTP/1.1
[41025] E/at.skt.esp: no memory receive buffer(1460).
total memory: 56560
used memory : 55160
maximum allocated memory: 55160
[41150] E/at.skt.esp: no memory receive buffer(1460).
total memory: 56560
used memory : 55160
maximum allocated memory: 55160
[41237] D/web: Host: 192.168.1.101
[41281] E/at.skt.esp: no memory receive buffer(1460).
total memory: 56560
used memory : 55160
maximum allocated memory: 55160
[41406] E/at.skt.esp: no memory receive buffer(1460).
total memory: 56560
used memory : 55160
maximum allocated memory: 55160
[41440] D/web: User-Agent: RT-Thread HTTP Agent
[41539] E/at.skt.esp: no memory receive buffer(1460).
total memory: 56560
used memory : 55160
maximum allocated memory: 55160
[41663] E/at.skt.esp: no memory receive buffer(1460).
total memory: 56560
used memory : 55160
maximum allocated memory: 55160
[41783] D/web: response header:
[41794] E/at.skt.esp: no memory receive buffer(1460).
total memory: 56560
used memory : 55160
maximum allocated memory: 55160
[41920] D/web: HTTP/1.1 200 OK
[41926] D/web: Server: MyWebServer/3.6.22 Unicode (By TGY)
[41934] D/web: Date: Wed, 10 Mar 2021 03:18:31 GMT
[41940] D/web: Accept-Ranges: bytes
[41947] D/web: Last-Modified: Sun, 07 Mar 2021 06:27:11 GMT
[41955] D/web: Content-Type: application/octet-stream
[41964] D/web: Content-Disposition: attachment;filename=rtthread.rbl
[41972] D/web: Content-Length: 181520
[41979] D/web: ETag: "/rtthread.rbl:Sun, 07 Mar 2021 06:27:11 GMT"
[41987] D/web: Connection: Keep-Alive
[41996] D/web: get position handle response(200).
http file_size:181520
[42004] I/http_ota: Start erase flash (download) partition!
total memory: 56560
used memory : 55220
maximum allocated memory: 55252
[42212] E/at.skt.esp: no memory receive buffer(1460).
total memory: 56560
used memory : 55220
maximum allocated memory: 55252
[42402] E/at.skt.esp: no memory receive buffer(1460).
total memory: 56560
used memory : 55220
maximum allocated memory: 55252
[42530] E/at.skt.esp: no memory receive buffer(1460).
total memory: 56560
used memory : 55220
maximum allocated memory: 55252
[42659] E/at.skt.esp: no memory receive buffer(1460).
total memory: 56560
used memory : 55220
maximum allocated memory: 55252
[42787] E/at.skt.esp: no memory receive buffer(1460).
total memory: 56560
used memory : 55220
maximum allocated memory: 55252
[42915] E/at.skt.esp: no memory receive buffer(1460).
[43314] I/http_ota: Erase flash (download) partition success!
[43321] E/http_ota: No memory for http ota!
添加打印 内存 ,