1. First, confirm whether the STM8 you are using has its own bootloader. Refer to the table below
2. STM8 empty devices can directly use the built-in bootloader.
3. After STM8 is burned with SWIM, if you want to continue to use the built-in bootloader, you must set the optional byte to 0x55AA. As shown below:
The method of setting these two bytes can be modified using ST Visual Programmer, as shown below:
However, this software shows that only 487Eh can be modified to 0x55, 487Fh has not been changed. The official software, very strange. So, I take the next approach
Set in the program, and then download it once with SWIM, once is enough . Use library functions as follows:
/* Define FLASH programming time */ FLASH_SetProgrammingTime(FLASH_PROGRAMTIME_STANDARD); /* Unlock EEPROM Data memory */ FLASH_Unlock(FLASH_MEMTYPE_DATA); FLASH_ProgramByte(0x487E,0x55); FLASH_ProgramByte(0x487F,0xAA);
FLASH_Lock(FLASH_MEMTYPE_DATA);
4. Finally, the Flashloader software of ST must be clicked within 1S after the device is reset. The settings are as follows:
The echo option can be unselected first. If the display fails, it prompts you to select echo, and then you select it.
Attached the original English description:
For the detailed bootloader process, please refer to UM0560. According to this manual, you can write the burning process into your own host computer software without using flashloader.