STM8 bootloader纪要

STM8 bootloader-UM0560

mcu:STM8L051F3P6,属于 STM8L Series low density

bootloder 支持

已经内置bootloader的mcu
bootloader group

没有内置bootloader的mcu

bootloder 执行流程图

bootloader执行流程图:

bootloder 传输设置

ota 同步消息SYNCHR=0x7F

支持传输的外设

从图上看,051F支持UART或者SPI
UART设置:1 start bit, 8 data bit, 1 bit 奇校验 ,1 stop bit
波特率:通过0x7F的传输,自动适配波特率,最大115200,最小4800.

传输回复
串口:1 start bit, 8 data bit, no parity bit, 1 stop bit,波特率自适应

SPI设置
• 8 data bit, MSB first
• Bit rate: Set by the host which acts as a master
• Peripheral set in slave mode with software management of NSS
• Data polarity: CPOL = 0 (SCK to 0 when idle), CPHA = 0 (the first clock transition is the
first data capture edge).

收到命令后,bl回复ACK 0x79

bootloder 外设选择

从资源的角度,我们倾向于使用spi做外设,因为uart可以预留来做用户调试用,但是目前官方提供了uart的串口下载PC客户端,方便测试。所以目前看使用uart作为bl外设可能更方便。这里也就要求选用单片机时,最好是多串口的设备。

bootloder 跳转地址表

关键点检测后,要跳转的地址表:

目前我们可以先考虑实现串口的版本,但是最后还是SPI的更实用。

完整文档:UM0560

2 comments

  1. Very helpful! I appreciate it.
    just a typo – the title of the user manual is UM0560.

    Thanks a lot

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注