Build Micropython firmware for ESP8266 on FreeBSD host and Ubuntu guest
Set up a Ubuntu VM on FreeBSD using vm-bhyve and install Micropython toolchain.
Tested with:¶
- FreeBSD 11.1-RELEASE-p8 + ZFS on baremetal server with virtualization support (host)
- Ubuntu Server 16.04.4 (guest, micropython build environment)
- Micropython 1.9.3 (esp8266 port)
How to:¶
- Install and configure vm-bhyve: Quickstart
-
Recommended: set up tmux with vm-bhyve
-
Create a vm for micropython
vm iso http://releases.ubuntu.com/16.04.4/ubuntu-16.04.4-server-amd64.iso
vm create -t ubuntu micropython
vm configure micropython
loader="grub"
guest="linux"
cpu=1
memory=2048M
network0_type="virtio-net"
network0_switch="public"
disk0_type="virtio-blk"
disk0_name="disk0.img"
vm install micropython ubuntu-16.04.4-server-amd64.iso
vm console micropython
-
Finish Ubuntu installation inside console.
-
Choose guided non-lvm partitioning.
-
Optionally enable openssh server.
-
Reboot guest, login
sudo apt-get update
sudo apt-get install -y make unrar autoconf automake \
libtool gcc g++ gperf flex bison texinfo gawk \
ncurses-dev libexpat-dev python-dev python python-serial \
sed git unzip bash help2man wget bzip2 libtool-bin
git clone --recursive https://github.com/pfalcon/esp-open-sdk
cd esp-open-sdk
make
echo "export PATH=/home/$USER/esp-open-sdk/xtensa-lx106-elf/bin:$PATH" >> ~/.bash_profile
exit
- Logout from guest, login
git clone --recursive https://github.com/micropython/micropython.git
cd micropython/ports/esp8266
make
- The firmware will be available as
build/firmware-combined.bin
.