SDK5.0.3中suota升级失败问题:每次erase 2sector后退出

3 posts / 0 new
Last post
kurbylee
Offline
Last seen: 1 year 5 months ago
Joined: 2014-11-05 09:10
SDK5.0.3中suota升级失败问题:每次erase 2sector后退出

背景:
1》suota app ver1.3/1.1;
2》sdk5.0.3
问题描述:
1》14580中有bootload,8000处含spota应用程序,1f000头文件;
2》手机端启动suota,扫描到14580设备,选择某个image传输(block1,强制刷入8000),手机端看到suota启动,传输了20个包;
然后手机端就自行退出了链接,跳到suota扫描首页面;
3》链接smartsnipper,发现14580flash中8000-B000的数据已经erase,后续的没有变动,检查代码应该在此次app_spotar.c
// Erase header and image
if( spota_state.mem_dev == SPOTAR_IMG_SPI_FLASH )
{
#if (!SPOTAR_SPI_DISABLE)
ret = app_erase_flash_sectors(spota_state.mem_base_add, codesize + CODE_OFFSET);
if( ret != ERR_OK) return SPOTAR_EXT_MEM_WRITE_ERR;
#else
return SPOTAR_EXT_MEM_WRITE_ERR;
#endif
}
进入app_erase_flash_sectors,发现只是erase两个sector后就退出了;
for (i=0; i < sector; i++)
{
ret = spi_flash_block_erase(starting_sector, SECTOR_ERASE);
starting_sector += SPI_SECTOR_SIZE;
if (ret != ERR_OK) break;
}
修改ret = spi_flash_block_erase(starting_sector, SECTOR_ERASE);为do{ret = spi_flash_block_erase(starting_sector, SECTOR_ERASE);}while(ret != ERR_OK),依然只erase两个sector,然后挂掉;
怀疑看门狗,于是undef wdog,依然无果。

问题:
1》该现象是14580端这边主动挂掉可能性大,还是收到了手机端某个命令(reset)挂掉的可能性大?
2》是否存在可能擦除过程中有其他并行的底层任务冲突导致失败?
3》手机端的suota的log在什么目录,找了半天没找到:(,搜索suota关键字无果

Device: 
kurbylee
Offline
Last seen: 1 year 5 months ago
Joined: 2014-11-05 09:10
因为强制block2,13000本来就是ff

因为强制block2,13000本来就是ff,如果我强制erase的ret为ok,那么能够升级成功,何解?
for (i=0; i < sector; i++)
{
//ret = spi_flash_block_erase(starting_sector, SECTOR_ERASE);
ret = ERR_OK;
starting_sector += SPI_SECTOR_SIZE;
if (ret != ERR_OK) break;
}
return ret;

如果uncommet ret = spi_flash_block_erase(starting_sector, SECTOR_ERASE); 如下 ,升级还是失败,erase 2 sector后退出
for (i=0; i < sector; i++)
{
ret = spi_flash_block_erase(starting_sector, SECTOR_ERASE);
ret = ERR_OK;
starting_sector += SPI_SECTOR_SIZE;
if (ret != ERR_OK) break;
}
return ret;

似乎有某个定时器超时一般,但是我已经关闭了看门狗,费解中......

CYibin
Offline
Last seen: 16 hours 20 min ago
Staff
Joined: 2017-12-14 02:48
您好, 请问硬件环境是什么?是自己的板子还是官方开发板?

您好,

请问硬件环境是什么?是自己的板子还是官方开发板?

Topic locked