⚠️ DANGER: This procedure involves working with high-voltage components.
Improper handling can lead to electrical shock, battery fires, or permanent damage to your scooter.
Only attempt if you have electronics experience.
Legal Notice: Modifying rental scooters is illegal in most jurisdictions.
This tutorial is for privately-owned Lime Gen 3 scooters only.
STLink Firmware Flashing Guide
This tutorial will guide you through dumping the stock firmware and flashing custom firmware to unlock full speed and features.
Requirements:
- STLink V2 programmer (clone versions work)
- 4-pin SWD cable (Dupont wires work)
- Lime Gen 3 controller (removed from scooter)
- ST-Link Utility or OpenOCD software
- Custom firmware file (see download section)
- 3.3V USB-TTL adapter (for serial console)
- Jumper wires and basic soldering tools
1Controller Removal
Access the controller compartment under the deck:
- Remove all deck screws (T15 Torx)
- Carefully lift the deck to expose electronics
- Disconnect battery connector (discharge capacitors first!)
- Unplug motor and dashboard connectors
- Remove the controller from its mounting
2Identify SWD Pins
The STM32F103 microcontroller has SWD programming pins:
Locate these points on your controller board:
VCC → 3.3V (usually marked)
SWDIO → PA13
SWCLK → PA14
GND → Any ground point
Note: Some boards may have test points labeled "SWD"
3Connect STLink
Wire your STLink to the controller:
STLink V2 → Controller
-----------
3.3V → VCC
SWDIO → SWDIO
SWCLK → SWCLK
GND → GND
Power the controller with a stable 3.3V source if needed.
4Dump Stock Firmware
Before flashing, always backup the original firmware:
- Open ST-Link Utility
- Connect to the target
- Read back entire flash memory (0x08000000 - 0x0803FFFF)
- Save as "lime_gen3_stock.bin"
$ openocd -f interface/stlink-v2.cfg -f target/stm32f1x.cfg \
-c "init" -c "dump_image lime_gen3_stock.bin 0x08000000 0x40000"
Verify the dump matches known Lime Gen 3 firmware signatures.
5Flash Custom Firmware
Using either ST-Link Utility or command line:
# Using ST-Link Utility:
1. Target → Program...
2. Select custom firmware .bin file
3. Start address: 0x08000000
4. Verify after programming
5. Start programming
Or with OpenOCD:
$ openocd -f interface/stlink-v2.cfg -f target/stm32f1x.cfg \
-c "program lime_gen3_custom.bin verify reset exit 0x08000000"
Important: Never interrupt flashing process. Corrupted firmware may brick your controller.
6Post-Flash Configuration
After successful flash:
- Reassemble controller in scooter
- Connect serial console (115200 baud)
- Access bootloader menu with special key combo
- Configure region settings and speed limits
- Calibrate throttle response if needed
# Common serial console commands:
> set speed_limit 35
> set region US
> save_config
> reboot
Troubleshooting: If scooter doesn't boot after flash:
- Verify proper SWD connection
- Check voltage levels (must be stable 3.3V)
- Try recovery mode with BOOT0 pin pulled high
- Restore original firmware if issues persist