Porting Lean to the ESP32-C3 RISC-V Microcontroller
kuruczgy.com·3h·
Flag this post

The goal of this project is to cross-compile Lean programs to the ESP32-C3. (You can find all the code in this repository.)

Lean is a dependently typed pure functional programming language and a proof assistant, though in this article I will mostly be using it just as a programming language. Its compiler can either emit LLVM IR or C code. I will be using the C output for simplicity, but using the LLVM IR instead should just involve setting up the right compiler flags.

The ESP32-C3 is a RISC-V microcontroller running at up to 160 MHz. Its main selling point is its integrated Wi-Fi peripheral, but I will not be using it for this project. It has 384 KiB of internal RAM, and I will be fitting everything into this including the …

Similar Posts

Loading similar posts...