ESP32 + Rust: The Legendary “Hello, world!” Quest

352 words 2 minutes esp32 rust

When you start a new project, you think: “How hard could it be?”

I had a SuperPlan:

  • Get a code editor
  • Write fn main() with println!("Hello, world!");
  • Run cargo build
  • Flash it to ESP32
  • Celebrate 🎉

…right?

EEEEEEEEEEEEEEEEEEE ❌❌❌

Reality had other plans...


Round 1: Windows 11

I started straight from my main desktop. Rust installed, crates pulled, tried setting up ESP-IDF… Result: almost a full day of endless errors. Cargo just couldn’t get the right toolchain. Lesson learned: Windows + ESP32 + Rust = chaos.


Round 2: Docker

Logical next step: Linux Docker. In theory, perfect solution. In practice… nope. Every variant tried to fetch ESP-IDF from repos, and every time something broke.


Round 3: WSL2

Next logical step: Linux inside WSL2. This is perfect. No additional software needed. Ha! …until the image of WSL grew beyond 100GB. My I/O system went into full panic mode. I started using the computer in step-by-step mode… brilliance. Time to delete and clean space… again and again.


Round 4: VirtualBox

Time to go hardcore: a fresh Linux VM. “Easiest installation path”? More like “path to despair.” The latest ESP-IDF wasn’t supported, libraries conflicted, nothing worked on the first try.


Round 5: Victory

Exhaustion, frustration, thoughts: "Why am I even doing this?"

But... After all the patches and retries. My eye almost pops out of orbit when I finally get a successful build and after flashing to device see on the console:

Hello, world!

OMG! It's a LIVE!!


Want a Shortcut?

If you’re a beginner and don’t want to spend days configuring your environment, there’s a [step-by-step guide on Patreon]. It shows way to set up a working Rust + ESP32 environment on Linux without endless errors.


Conclusion

What should have taken five minutes turned into a multi-day boss fight. That’s embedded development: rough tools, confusing instructions, endless errors… and yet, the sense of victory when the first working code finally appears is priceless.

If I survived “Hello, world!” with Rust + ESP32, the rest should be easier… probably.