This article will take you through all the currently required step to build a MicroPython .bin file for the ESP8266. It uses VirtualBox to create a virtual development environment with all the suitable toolsets required to build MicroPython.
Create a new virtual machine:
|Give it a name and configure it for 32-bit Ubuntu|
|More memory is better. Here is am using 4GB.|
|I choose to create the virtual hard disk now.|
|I leave the default as VDI.|
|I choose to dynamically size the hard drive.|
|The hard disk for the virtual machine needs at least 20GB|
|When that step has completed you will now be ready to install the OS|
|Open the Setting for the new virtual machine and go to the Storage section. There select the ubuntu iso that we are using for this procedure.|
|Now we can start the virtual machine and Install Ubuntu|
|Install with your own preferences.
To simplify the process I choose to Login Automatically and I do not encrypt my home drive.
|Once it is installed we can begin the final steps for setting up the virtual machine|
sudo apt update
sudo apt upgrade
sudo usermod -a -G vboxsf <username>
We now have a clean Ubuntu development machine to start adding our tools too.
sudo apt-get install make unrar-free 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
git clone ––recursive https://github.com/pfalcon.esp_open_sdk
Before kicking off
make we need to fix two issues….
/esp-open-sdk/crosstool-ng/scripts/build/companion_libs/121-isl.sh needs to be edited in order for the isllib to be found. Open this file and change the location referenced to here…
/esp-open-sdk_crosstool-ng_config_companion_libs_expat.in needs to be updated to the latest available version.
In the terminal window with the current directory as esp_open_sdk, just enter the command make.
It will take some time, but eventually you should finish with instructions on how to at the tool chain to your path.
Now you are ready to build the ESP8266 firmware.
git clone https://github.com/micropython/micropython.git
git submodule update –init
make -C mpy-cross
git checkout 'v1.18'