<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/reverse-engineering-my-e-scooter-and-rewriting-the-firmware-in-rust-ctfvtbty9" -->

---
title: Reverse engineering my e-scooter and rewriting the...
description: A deep-dive into reverse engineering the hardware and firmware of an Egret GT e-scooter, covering Bluetooth app analysis, discovery of a CAN bus hidden behind...
canonical: https://daily.dev/posts/reverse-engineering-my-e-scooter-and-rewriting-the-firmware-in-rust-ctfvtbty9
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Reverse engineering my e-scooter and rewriting the firmware in rust | daily.dev
og:description: A deep-dive into reverse engineering the hardware and firmware of an Egret GT e-scooter, covering Bluetooth app analysis, discovery of a CAN bus hidden behind...
og:url: https://daily.dev/posts/reverse-engineering-my-e-scooter-and-rewriting-the-firmware-in-rust-ctfvtbty9
og:image: https://api.daily.dev/og/posts/ctfvtbTy9.png
og:image:alt: Reverse engineering my e-scooter and rewriting the firmware in rust
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Reverse engineering my e-scooter and rewriting the firmware in rust

**[Lobsters](https://daily.dev/sources/lobsters)** · 44 min read · 2 upvotes · 2 comments

## Summary

A deep-dive into reverse engineering the hardware and firmware of an Egret GT e-scooter, covering Bluetooth app analysis, discovery of a CAN bus hidden behind a USB-C port, firmware dumping via SWD/OpenOCD, decompilation with Ghidra, and the unauthenticated CAN-based firmware update mechanism. The author then builds a custom AT32F415 HAL, ports Embassy async runtime support, and rewrites the display unit firmware entirely in Rust using an actor model with tasks for ADC, system state, operation state, GUI, Bluetooth, CAN, buttons, and flash-backed config storage.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://bensimms.moe/reverse-engineering-scooter>

## Questions this post answers

### How can I write a HAL for a non-standard STM32 clone microcontroller like the AT32F415 in Rust?

Start from an existing stm32-rs fork and Embassy peripheral implementations, then cross-reference both the STM32F1 and AT32F415 datasheets to update register names and behavior to match the AT32 chip, since it mixes STM32F1-style peripherals with an STM32F3-style RTC rather than cloning one specific chip. Bringing up clocks and timers first enables an embassy-time-driver implementation before tackling ADC, UART, CAN, and RTC.

_Developers building HALs for oddball microcontroller clones can find similar reverse-engineering approaches curated on daily.dev._

### How do you avoid display flicker when building an embedded GUI with no framebuffer on a microcontroller with only 32KB of RAM?

Track dirty regions with two quadtrees instead of a single bounding rectangle: one quadtree records dirty areas and another records 'overdrawn' areas, so only components whose bounding boxes overlap a dirty or overdrawn region get redrawn. This precisely limits redraw commands sent to the display, since without a framebuffer every visible pixel would otherwise be redrawn on every frame, causing visible flicker.

_Anyone optimizing memory-constrained embedded UI rendering can track related firmware techniques on daily.dev._

### How does the Egret GT e-scooter firmware update process work over its CAN bus?

The update begins with a CAN message on ID 0x384 that triggers the bootloader to erase flash regions for VIN and configuration, after which the updater device sends 64-byte chunks across 9 CAN frames per chunk, checksummed with CRC-16-CCITT, starting with a chunk containing the firmware filename and length as null-terminated ASCII strings. There is no cryptographic verification anywhere in this process, so any device can flash arbitrary firmware onto the display, controller, or button panel without authentication.

_Engineers researching CAN bus firmware update protocols and their security gaps can follow similar teardowns on daily.dev._

## Community take

How the wider developer community reacted, aggregated from 2 discussions and 9 comments across lobsters, hackernews (as of 2026-09-13).

**TL;DR:** The write-up itself draws little direct commentary; most of the discussion is consumed by a side argument about whether alloc-free GUI libraries exist for Rust, with a couple of people expressing interest in doing similar reverse-engineering projects.

**Sentiment:** 40% positive · 10% mixed · 50% skeptical

**The case for**

- A couple of commenters were inspired to consider similar reverse-engineering projects on their own hardware (cars, EVs).

**The pushback**

- A dispute arose over whether the claim about a lack of alloc-free GUI libraries in Rust was fair or too generalized, derailing the thread.

**By community**

- lobsters (heated): Dominated by a prolonged back-and-forth argument about alloc-free GUI libraries in Rust rather than substantive discussion of the firmware project.
- hackernews (mixed): No comments available, so little signal on sentiment here.

**Hottest debate:** Whether it's fair to say there's a lack of alloc-free GUI libraries in Rust, versus that being an overly broad or pedantic claim.

**Highlights**

> Wow this is some crazy dedication for custom firmware. I’m a little surprised that there’s no alloc free libraries for rust. I guess it’s not as common of a problem. I would’ve expected slint to be able to do it
> — [vaguelytagged on lobsters · 2 points, 1 comments](https://lobste.rs/s/pdr2bo/reverse_engineering_my_e_scooter#c_hhhayy)

> > I’m a little surprised that there’s no alloc free libraries for rust. This statement makes absolutely no sense. There are tons of allocation free libraries in rust. The essay says that the broadly used *GUI libraries* require alloc/std/a framebuffer, but even then the following sentence they also indicate that they did find a GUI library which has no such requirement, so even in its most generous reading your comment is plainly incorrect per TFA.
> — [masklinn on lobsters · 1 points, 1 comments](https://lobste.rs/s/pdr2bo/reverse_engineering_my_e_scooter#c_rvjuxs)

> I disagree, this is comment section on rust embedded. A common topic to add on this may be in reference as to why this might be the case or a refute showing that there are in fact numerous libraries that meet the requirements.  I understand that there is one that the author found and deemed insufficient in the long run and opted to create their own. This demonstrates a continuing lack in the ecosystem, which is what my comment is referencing.  Something like egui is a pretty strong force in the ecosystem but there seems to be nothing for the authors use case that’s equally known. Slint seems to provide itself as a way to write a gui for embedded devices so I’m curious as to why the slint devs have not pursued this case. This could be expanded on or perhaps discussed on why they have or have not. If you’d like to engage you can do so. You’ve chosen to engage with something not relevant to the topic.
> — [vaguelytagged on lobsters · 1 points](https://lobste.rs/s/pdr2bo/reverse_engineering_my_e_scooter#c_zqpnlc)

> Noting this process as I would like to do this on my car one day lol.
> — [tobz619 on lobsters · 2 points, 1 comments](https://lobste.rs/s/pdr2bo/reverse_engineering_my_e_scooter#c_nnqa78)

**Source threads**

- [lobsters](https://lobste.rs/s/pdr2bo/reverse_engineering_my_e_scooter) · 55 points · 9 comments
- [hackernews](https://news.ycombinator.com/item?id=49613459) · 2 points · 0 comments

## Community discussion

Top comments from developers on daily.dev.

**@petermrozek** · 0 upvotes

> Oh, wow... And here I thought reverse-engineering a DOS game was a lot of work, but a scooter? This is an awesome read. 😁

**@agustinbarrientos** · 0 upvotes

> Impressive work porting Embassy to the AT32F415. Did the vendor ever answer the unauthenticated CAN update finding?

## Similar posts on daily.dev

- [Reverse Engineered Grill Controller Gets Open Firmware](https://daily.dev/posts/reverse-engineered-grill-controller-gets-open-firmware-hamrdatag) · Hackaday · 0 upvotes · 0 comments
- [Drone Hacking Part 1: Dumping Firmware and Bruteforcing ECC](https://daily.dev/posts/drone-hacking-part-1-dumping-firmware-and-bruteforcing-ecc-lpkjlhxth) · Hacker News · 1 upvotes · 0 comments

---

Tags: [#rust](https://daily.dev/tags/rust), [#embedded](https://daily.dev/tags/embedded), [#firmware](https://daily.dev/tags/firmware), [#reverse-engineering](https://daily.dev/tags/reverse-engineering)

[View this post on daily.dev](https://daily.dev/posts/reverse-engineering-my-e-scooter-and-rewriting-the-firmware-in-rust-ctfvtbty9)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Reverse engineering my e-scooter and rewriting the firmware in rust","url":"https://daily.dev/posts/reverse-engineering-my-e-scooter-and-rewriting-the-firmware-in-rust-ctfvtbty9","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/reverse-engineering-my-e-scooter-and-rewriting-the-firmware-in-rust-ctfvtbty9"},"datePublished":"2026-09-09T09:30:40.533Z","dateModified":"2026-09-13T20:23:59.197Z","description":"A deep-dive into reverse engineering the hardware and firmware of an Egret GT e-scooter, covering Bluetooth app analysis, discovery of a CAN bus hidden behind...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/971cd129ec76787f3eef4945c37932d6?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/971cd129ec76787f3eef4945c37932d6?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Lobsters","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Lobsters","logo":"https://media.daily.dev/image/upload/s--tl8v_Fku--/f_auto,t_logo/v1698841318/logos/lobste.jpg","url":"https://daily.dev/sources/lobsters"},"commentCount":2,"discussionUrl":"https://daily.dev/posts/reverse-engineering-my-e-scooter-and-rewriting-the-firmware-in-rust-ctfvtbty9","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":2}],"keywords":"rust,embedded,firmware,reverse-engineering","timeRequired":"PT44M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Lobsters","item":"https://daily.dev/sources/lobsters"},{"@type":"ListItem","position":3,"name":"Reverse engineering my e-scooter and rewriting the firmware in rust"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/reverse-engineering-my-e-scooter-and-rewriting-the-firmware-in-rust-ctfvtbty9","comment":[{"@type":"Comment","text":"Oh, wow… And here I thought reverse-engineering a DOS game was a lot of work, but a scooter? This is an awesome read. 😁","datePublished":"2026-09-09T18:53:40.876Z","url":"https://daily.dev/posts/ctfvtbTy9#c-nQPyenB9a","author":{"@type":"Person","name":"Peter Mrożek","url":"https://daily.dev/petermrozek","image":"https://media.daily.dev/image/upload/s--pBfYX68K--/f_auto/v1769247960/avatars/avatar_Qz65P1nVw3Bu6C5YwaZgA?_a=BAMAMiiu0"}},{"@type":"Comment","text":"Impressive work porting Embassy to the AT32F415. Did the vendor ever answer the unauthenticated CAN update finding?","datePublished":"2026-09-11T06:17:08.182Z","url":"https://daily.dev/posts/ctfvtbTy9#c-TM9CGBedr","author":{"@type":"Person","name":"Agustin Barrientos","url":"https://daily.dev/agustinbarrientos","image":"https://media.daily.dev/image/upload/s--5ayxQnqn--/f_auto/v1788281802/avatars/avatar_wQYYVe5Tbj0NJ7C7qPoa8?_a=BAMAMicg0"}}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/reverse-engineering-my-e-scooter-and-rewriting-the-firmware-in-rust-ctfvtbty9#faq","mainEntity":[{"@type":"Question","name":"How can I write a HAL for a non-standard STM32 clone microcontroller like the AT32F415 in Rust?","acceptedAnswer":{"@type":"Answer","text":"Start from an existing stm32-rs fork and Embassy peripheral implementations, then cross-reference both the STM32F1 and AT32F415 datasheets to update register names and behavior to match the AT32 chip, since it mixes STM32F1-style peripherals with an STM32F3-style RTC rather than cloning one specific chip. Bringing up clocks and timers first enables an embassy-time-driver implementation before tackling ADC, UART, CAN, and RTC. Developers building HALs for oddball microcontroller clones can find similar reverse-engineering approaches curated on daily.dev."}},{"@type":"Question","name":"How do you avoid display flicker when building an embedded GUI with no framebuffer on a microcontroller with only 32KB of RAM?","acceptedAnswer":{"@type":"Answer","text":"Track dirty regions with two quadtrees instead of a single bounding rectangle: one quadtree records dirty areas and another records 'overdrawn' areas, so only components whose bounding boxes overlap a dirty or overdrawn region get redrawn. This precisely limits redraw commands sent to the display, since without a framebuffer every visible pixel would otherwise be redrawn on every frame, causing visible flicker. Anyone optimizing memory-constrained embedded UI rendering can track related firmware techniques on daily.dev."}},{"@type":"Question","name":"How does the Egret GT e-scooter firmware update process work over its CAN bus?","acceptedAnswer":{"@type":"Answer","text":"The update begins with a CAN message on ID 0x384 that triggers the bootloader to erase flash regions for VIN and configuration, after which the updater device sends 64-byte chunks across 9 CAN frames per chunk, checksummed with CRC-16-CCITT, starting with a chunk containing the firmware filename and length as null-terminated ASCII strings. There is no cryptographic verification anywhere in this process, so any device can flash arbitrary firmware onto the display, controller, or button panel without authentication. Engineers researching CAN bus firmware update protocols and their security gaps can follow similar teardowns on daily.dev."}}]}
```

