How to fix Error 22 and 23
Posted: Sun Oct 27, 2019 5:52 pm
Recently I erased the EEPROM of a BMS by mistake and then I was faced to a series of errors starting by Error 22.
Here is a quick "how to" in order to fix these errors. To be honest I simply applied a method suggest by Conejo on https://electro.club/forum/razborka_pro ... iaomi_M365
What you need :
- ST Link
- STVP only for Windows https://www.st.com/en/development-tools/stvp-stm32.html eventually you can try to use https://github.com/vdudouyt/stm8flash but beware of encrypted bin.
- Your serial (written on the battery cover)
![Image](https://scooterhacking.org/forum/images/upload/romano_bms_fix/bms.jpg)
Step 1 :
Power on the Ninebot ES. Now you should get an error 23. Here we start the 2nd step:
Step 2 :
![Image](https://scooterhacking.org/forum/images/upload/romano_bms_fix/stvp.png)
Here is a quick "how to" in order to fix these errors. To be honest I simply applied a method suggest by Conejo on https://electro.club/forum/razborka_pro ... iaomi_M365
What you need :
- ST Link
- STVP only for Windows https://www.st.com/en/development-tools/stvp-stm32.html eventually you can try to use https://github.com/vdudouyt/stm8flash but beware of encrypted bin.
- Your serial (written on the battery cover)
![Image](https://scooterhacking.org/forum/images/upload/romano_bms_fix/bms.jpg)
Step 1 :
- Remove the BMS from the battery
- Solder your ST-Link to the BMS. From Top to down : RESET, GND, SWIM and 3.3V
- Plug you USB St-Link and open STVP using the following parameters:
Hardware : ST-LINK, Port: USB, Programme mode: SWIM, Device: STM8L15xK6
- Click on read all tabs
- Go the DATA Memory TAB
- At address 00001000, write AA AA for the 2 first columns and then click on Program Current Tab
Power on the Ninebot ES. Now you should get an error 23. Here we start the 2nd step:
Step 2 :
- Remove the BMS from the battery
- Plug you USB St-Link and go back to STVP
- Click on read Data Memory Tab, now you should see 5A 5A instead of AA AA
- At address 00001020, input the serial number of the battery in hexa
- At address 00001030, input 50 14 50 14. Actually it's the value of the capacity of the battery in Ah. Because Ninebot ES battery capacity is 5200 mAh, 5200 => 14 50 in Hexadecimal. As it follows LSB (least significant bit) we should input 50 14.
- At address 00001060, we input 01 00 (which represents the status of the BMS at the current moment, valid config is 01 00
- Click on program current tab.
![Image](https://scooterhacking.org/forum/images/upload/romano_bms_fix/stvp.png)