This invention discloses an OTA
upgrade and
rollback method for an electric two-wheeled vehicle controller and an electric two-wheeled vehicle. The controller includes an MCU and a
Bluetooth chip. The MCU's
flash memory is divided into a bootloader guidance area and an APP running area, while the
Bluetooth chip's
flash memory is divided into a
Bluetooth APP area and an MCU program
backup area. The method includes: after the controller is powered on, the MCU
chip enters the guidance area, detects a valid
upgrade flag, backs up the current
firmware in the APP running area, and encrypts and transmits it to the
backup area. After the
backup is completed, an OTA
upgrade is performed. After the upgrade is completed, the guidance area verifies the upgraded
firmware in the APP running area. If the
verification passes, it jumps to the running area and sets the upgrade flag to invalid; if the
verification fails, a
rollback process is triggered. The guidance area decrypts the
firmware stored in the backup area and rolls it back to the APP running area. By utilizing the remaining space resources of the Bluetooth chip, the overall
resource utilization efficiency of the controller is improved.