从来没想过,竟然如此简单!简直是超快的开发啊.
#include "stm8s.h" uint8_t val = 0; void main(void) { FLASH_Unlock(FLASH_MEMTYPE_DATA); FLASH_ProgramByte(FLASH_DATA_START_PHYSICAL_ADDRESS,0xAA); val = FLASH_ReadByte(FLASH_DATA_START_PHYSICAL_ADDRESS); FLASH_ProgramByte(FLASH_DATA_START_PHYSICAL_ADDRESS,0x55); val = FLASH_ReadByte(FLASH_DATA_START_PHYSICAL_ADDRESS); while (1); }