例程:FLASH_DataProgram中是这么写的
是块操作,我的是字节写
/* This function is executed from RAM */
FLASH_ProgramBlock(BLOCK_OPERATION, FLASH_MEMTYPE_DATA, FLASH_PROGRAMMODE_STANDARD, GBuffer);
/* Wait until End of high voltage flag is set*/
while (FLASH_GetFlagStatus(FLASH_FLAG_HVOFF) == RESET)
{}
/* Check the status of the specified FLASH flag */
if ((FLASH->IAPSR & (uint8_t)FLASH_FLAG) != (uint8_t)RESET)
{
status = SET; /* FLASH_FLAG is set */
}
else
{
status = RESET; /* FLASH_FLAG is reset*/
}
/* Return the FLASH_FLAG status */
return status;
}
1. STM8S105 has no RWW function. So programming data in eeprom will halt the MCU
2. Customer should use the EOP bit to judge the STM8 EEPROM programming end instead of HV OFF. HV OFF means MCU go back to normal status from halt status.
3. Reserve bit is not for customer use. It is reserved for future or internal usage.
我用STM8S105K4,也遇到了写EEPROM时程序halt之问题
在ST官网上的、最新的文档CD00200092.PDF(STM8S105xx之datasheet,February 2014 DocID14771 Rev 13)中,明明白白地吹:
4.3 Flash program and data EEPROM memory
• Up to 32 Kbytes of Flash program single voltage Flash memory
• Up to 1 Kbytes true data EEPROM
• Read while write: Writing in data memory possible while executing code in program memory
• User option byte area
这儿的专家,却说没这个RWW功能了。
我应该相信专家?
还是该相信官方文档??
我可以骂娘吗???