Flash 512K+512K MAP下擦写扇区后崩溃

yungkit
Posts: 1
Joined: Tue Nov 20, 2018 4:36 pm

Flash 512K+512K MAP下擦写扇区后崩溃

Postby yungkit » Tue Nov 20, 2018 4:45 pm

是否有人与我遇到相同的问题

SDK版本3.1.0

在SPI Flash Size & Map: 32Mbit(512KB+512KB)的MAP下,其实只要是(512KB+512KB)的MAP中,user2的代码擦写user1的代码扇区时出现的崩溃。1024K+1024K MAP中可以正常操作。

就是代码在@0x81000地址启动后的user2下,执行了spi_flash_erase_sector(1);擦除0x1000地址的扇区,之后就卡死崩溃。





代码:
void ICACHE_FLASH_ATTR
user_init(void)
{
u8 systeam_user_bin=0;
partition_item_t partition_item;
os_printf("SDK version:%s\n", system_get_sdk_version());
systeam_user_bin = system_upgrade_userbin_check();

if(systeam_user_bin)
{
spi_flash_erase_protect_disable();

spi_flash_erase_sector(1);
os_printf("\r\n擦除扇区1");
spi_flash_erase_sector(2);
os_printf("\r\n擦除扇区2");
}
else{
system_upgrade_flag_set(0x02);
system_upgrade_reboot();
}


}

Who is online

Users browsing this forum: No registered users and 10 guests