Skip to content

Instantly share code, notes, and snippets.

@robtinkers
Created February 16, 2023 00:07
Show Gist options
  • Save robtinkers/b653b045e3425903eff681d278e3823c to your computer and use it in GitHub Desktop.
Save robtinkers/b653b045e3425903eff681d278e3823c to your computer and use it in GitHub Desktop.
How To Compile Micropython + SoftUART for ESP8266
The build process for micropython is incredibly poorly documented all over the web,
often suggesting you try to coax many years-old toolchains out of retirement.
Here's how to do it simply, cleanly and (I hope!) correctly:
1. Install VirtualBox
2. Install Ubuntu 22.04.1 LTS minimal as a Virtualbox guest.
Other version will likely work, but this is what I used.
20GB hard drive should be enough space (assuming minimal)
3. Enable SSH during installation and use PuTTY to log in...
sudo apt update
sudo apt -y full-upgrade
sudo apt install git docker.io make
sudo usermod -a -G docker $USER
reboot
4. Use PuTTY to log back in...
git clone https://github.com/micropython/micropython-lib
git clone https://github.com/micropython/micropython
cd micropython
git checkout tags/v1.19.1
wget -q -O - https://github.com/micropython/micropython/pull/7784.diff | patch -p1
make -C ports/esp8266 submodules
docker run --rm -v $HOME:$HOME -u $UID -w $PWD larsks/esp-open-sdk make -j 4 -C mpy-cross
git submodule update --init
cd ports/esp8266
docker run --rm -v $HOME:$HOME -u $UID -w $PWD larsks/esp-open-sdk make -j 4
ls -l build-GENERIC/combined-firmware.bin
5. Use WinSCP to copy ~/micropython/ports/esp8266/build-GENERIC/combined-firmware.bin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment