STM8S003F3做IAP升级
用STM9S003F3做IAP升级, 用IAR编译器,ST提供的库函数,稍加改写,以块编程的方式(64Byte),去写FLASH, 现在是流程可以跑通,但是在写APP程序到APP地址区时,发现有字节没有写成功,
请帮忙分析,谢谢。
下面贴上我的块写程序:
IN_RAM(void userFLASH_ProgramBlock(uint16_t BlockAddr, uint8_t *Buffer))
{
uint16_t Count;
/* Point to the first block address */
/* Standard programming mode */ /*No need in standard mode */
FLASH->CR2 |= FLASH_CR2_PRG;
FLASH->NCR2 &= (uint8_t)(~FLASH_NCR2_NPRG);
/* Copy data bytes from RAM to FLASH memory */
for(Count = 0; Count < FLASH_BLOCK_SIZE; Count++)
{
*((PointerAttr uint8_t *) (MemoryAddressCast)BlockAddr + Count) = ((uint8_t)(Buffer));
}
}
有一个stm8 tinyboot可以参考那个 原来的你 发表于 2019-1-23 08:54
有一个stm8 tinyboot可以参考那个
这个可以,谢谢!
页:
[1]