Skip to content

Flash the firmware on Bafang 850C LCD

casainho edited this page Jul 22, 2019 · 15 revisions

Table of Contents

WARNING: There is no way to backup the original firmware. Once you erase the original firmware you will never be able to go back.

Download the firmware binary file from here: https://github.com/OpenSource-EBike-firmware/Color_LCD/releases

Our OpenSource firmware repository: https://github.com/OpenSource-EBike-firmware/Color_LCD/tree/master/Bafang_LCD_850C/Bafang_LCD_850C_firmware

How to open the LCD

  1. use something thin to force open the front cover, by making force on the sides of the case
  2. remove the hard plastic layer that is on top of the LCD
  3. remove the 2 little screws that fix the LCD and the board to the case

Flash the firmware

JTAG SWD connector

The JTAG SWD pins are available on the board, on the pads as seen on next picture, with the following JTAG pins:

Pad number
(from left to right)
JTAG name
1 GND
2 NRST
3 SWCLK
4 SWDIO
5 VCC 3.3V
(no need to connect if LCD is already powered on)

Software to flash

To flash the firmware, use the software tool that works on your operation system to flash the STM32F103 microcontrollers.

On the very first time, you will need to first erase and/or unlock the microcontroller.

Linux

Use stm32flash or OpenOCD.
OpenOCD is usefull if you want to develop and do debug otherwise the stm32flash is the most indicated.

Windows

Use the STM32 ST-LINK Utility. Here the main steps:

  • Target Chip erase
  • Load bin file (load the firmware bin file)
  • Target program
Clone this wiki locally