写Flash时发现,除了前128K,后面写不了,卡住了。
代码:
uint8_t FLASH_backup()
{
uint32_t i;
uint32_t src, dest;
__disable_irq();
src = (uint32_t)0x08000000;
dest = (uint32_t)0x08038000;
#if 1
//#define FLASH_TOTAL_PAGE (224*4)
for(i=0;i
{
PRINTF("2 SourcePage %d 0x%08X\r\n", i, src);
PRINTF("2 ErasePage %d 0x%08X\r\n", i, dest);
FLASH_ROM_ERASE(dest, 256);
PRINTF("2 ProgramPage %d 0x%08X\r\n", i, dest);
FLASH_ROM_WRITE(dest, (uint32_t *)src, 256);
src += 0x100;
dest += 0x100;
}
#else
PRINTF("3 SourcePage %d 0x%08X\r\n", i, src);
PRINTF("3 ErasePage %d 0x%08X\r\n", i, dest);
FLASH_ROM_ERASE(dest, 224 * 1024);
PRINTF("3 ProgramPage %d 0x%08X\r\n", i, dest);
FLASH_ROM_WRITE(dest, (uint32_t *)src, 224 * 1024);
PRINTF("3 ProgramPage end\r\n");
#endif
__enable_irq();
return 0;
}
#endif
Flash配置:128k+64k
下载配置: