← Back to Lime Models

Lime Gen 3 Controller Hacking

⚠️ 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:

  1. Remove all deck screws (T15 Torx)
  2. Carefully lift the deck to expose electronics
  3. Disconnect battery connector (discharge capacitors first!)
  4. Unplug motor and dashboard connectors
  5. Remove the controller from its mounting
Controller location
2Identify SWD Pins

The STM32F103 microcontroller has SWD programming pins:

SWD Pinout

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
STLink Wiring

Power the controller with a stable 3.3V source if needed.

4Dump Stock Firmware

Before flashing, always backup the original firmware:

  1. Open ST-Link Utility
  2. Connect to the target
  3. Read back entire flash memory (0x08000000 - 0x0803FFFF)
  4. 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:

  1. Reassemble controller in scooter
  2. Connect serial console (115200 baud)
  3. Access bootloader menu with special key combo
  4. Configure region settings and speed limits
  5. Calibrate throttle response if needed
# Common serial console commands:
> set speed_limit 35
> set region US
> save_config
> reboot

Download Resources:

Custom Firmware ST-Link Utility
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