电路部分:使用Type-C接口连接CH340C,连接STM32的串口1
1.使用FlyMCU烧录出现报错:
DTR电平置低(-3--12V),复位
RTS置高(+3-+12V),选择进入BootLoader
...延时100毫秒
DTR电平变高(+3-+12V)释放复位
RTS维持高
开始连接...5, 接收到:79 1F
在串口COM5连接成功@115200bps,耗时937毫秒
芯片内BootLoader版本号:3.1
芯片PID:00000413 STM32F40xx_41xx
读出的选项字节:
FFAA0055FFAA0055FFFF0000FFFF0000
开始全片擦除(全片擦除时间会比较长,请耐心等候!)
全片擦除成功
开始去除写保护
去除写保护成功
DTR电平置低(-3--12V),复位
RTS置高(+3-+12V),选择进入BootLoader
...延时100毫秒
DTR电平变高(+3-+12V)释放复位
RTS维持高
开始连接...5, 接收到:79 1F
在串口COM5连接成功@115200bps,耗时969毫秒
芯片内BootLoader版本号:3.1
芯片PID:00000413 STM32F40xx_41xx
芯片已设置读保护
第1032毫秒,已准备好
开始编程芯片,共需写入17KB,耗时1032毫秒
调试信息:-4 STM_WriteMemory
写入出错在0KB,进度0%,耗时1047毫秒
2.使用STM32CubeProgrammer连接报错:
10:24:13 : Timeout error occured while waiting for acknowledgement.
10:24:13 : Error: Activating device: KO. Please, verify the boot mode configuration and check the serial port configuration. Reset your device then try again...
10:24:13 : Disconnected from device.
10:24:13 : RTS low
10:24:13 : DTR High
10:24:13 : Serial Port COM5 is successfully opened.
10:24:13 : Port configuration: parity = even, baudrate = 115200, data-bit = 8, stop-bit = 1.0, flow-control = off
10:24:15 : Timeout error occured while waiting for acknowledgement.
10:24:15 : Error: Activating device: KO. Please, verify the boot mode configuration and check the serial port configuration. Reset your device then try again...
解决办法:使用正点原子串口ISP软件V1.1
连接正常,进入BootLoader正常
芯片PID:0x413
芯片参考信息:STM32F40xxx/41xxx
开始全片擦除(耗时较长)...
全片擦除成功
固件数量:1
文件地址段:0x8000000 Size:17864
开始编程...
编程完成,共写入:17KB
运行成功
关闭串口
执行完成,共耗时:5888(ms)
烧录成功