It is not easy to enter the IAP mode of STM32 single-chip microcomputer, and the communication count with the host computer is very slow, IAP cannot continuously flash the firmware, and the time for IAP to flash the firmware is long.

Problem: IAP mode is not easy to enter, the communication count with the host computer is very slow, IAP cannot flash the firmware continuously, and it takes a long time for IAP to flash the firmware.

Reason: IAP is not easy to enter and the problem of continuous IAP is that the accelerometer initialization is placed after the serial port initialization, and the accelerometer initialization takes a little time. During continuous IAP, the update is just completed, the microcontroller is restarting, and the serial port initialization has just completed , The host computer communicates with it, and at the beginning of receiving the bytes sent by the host computer, and then the accelerometer initialization starts, which causes the serial port to receive abnormalities and cannot receive normally, so IAP is not easy to enter and continuous IAP is not possible. The slow communication count and the long download time are because the accelerometer reading time is relatively long, which slows down the entire IAP time.

Solution: For the problem of difficult access and continuous IAP, you only need to adjust the initialization sequence of the peripherals, and place the serial port initialization after the accelerometer initialization. The second problem of long download time is to add IAP mode judgment at the top of the accelerometer reading function. When IAP is detected, it can be solved by returning, and the download time is greatly reduced.

Guess you like

Origin blog.csdn.net/qq_37449342/article/details/108146319