Manual Windows Installation
Code built for the ESP8266 uses a separate Espressif compiler, but Components such as SPIFFS require additional tools which are built as Windows executable applications.
MinGW provides a (mostly) POSIX-compliant development environment for Windows, including GNU Make and various other command-line tools.
There are two versions of MinGW.
MinGW is the original, and the version recommended for use with Sming.
MinGW-w64 was forked from MinGW in 2007 in order to provide support for 64 bits and new APIs. (Which we don’t need!)
To find out if you already have GCC on your system, type:
If it shows
C:\MinGW\bin\gcc.exe then you have a standard MinGW installation. Check the gcc version:
The current version is 8.2.0. You can upgrade by renaming or removing your existing installation then following these instructions.
Download MinGW.7z from the SmingTools repository.
Unzip to default location:
7z -oC:\ x MinGW.7z
You can obtain 7-zip from https://www.7-zip.org/.
SETX PATH "C:\mingw\bin;C:\mingw\msys\1.0\bin;%PATH%"
Make sure it is in this exact order. If you have Cygwin installed make sure the above entries appear first.
You will need to restart your command prompt (and Eclipse, if already running) for these changes to take effect.
To install from the original MinGW source repository:
Get the MingGW Setup and run it. This will create the
C:\MinGWdirectory with minimal content.
Set PATH environment variable as above.
Install required MinGW packages:
mingw-get install mingw32-base-bin mingw-developer-toolkit-bin mingw32-gcc-g++-bin mingw32-pthreads-w32-dev mingw32-libmingwex
Note that you can upgrade packages using:
mingw-get update mingw-get upgrade
However this will not upgrade a 6.3.0 installation to 8.2.0.
Install ESP8266 Toolchain
Download toolchain ESP Quick Toolchain.
Unzip to default location:
7z -oC:\tools\esp-quick-toolchain x x86_64-w64-mingw32.xtensa-lx106-elf-e6a192b.201211.zip
SETX ESP_HOME C:\tools\esp-quick-toolchain
There is NO trailing slash on the path!
If you want to set environment variables system-wide, append /M to the command. You’ll need to do this from an administrative command prompt.
Get the current version from https://www.python.org/.
By default, python gets installed here:
Wherever it ends up will either need to be in the path:
setx PATH "C:\Users\xxx\AppData\Local\Programs\Python\Python38;%PATH%"
or located using the
PYTHON environment variable:
setx PYTHON "C:\Users\xxx\AppData\Local\Programs\Python\Python38"
The PYTHON variable may not contain spaces. This is a MinGW restriction.
This is required to fetch and update Sming code from its repository.
Install command-line GIT client.
These steps are optional, but highly recommended:
You can put Sming anywhere convenient, provided there are no spaces in the path! For example, C:\tools\sming:
mkdir C:\tools cd /d C:\tools
To obtain the latest develop code with all the latest features and fixes:
git clone https://github.com/SmingHub/Sming
To obtain the latest release:
git clone https://github.com/SmingHub/Sming --branch master
SETX SMING_HOME C:\tools\Sming\Sming
Note: there is NO trailing slash on the path!
Whilst Windows filenames are not (by default) case-sensitive, the compiler tools are.
Please take care to type paths exactly as shown.
At this stage you should be able to build a sample:
cd samples\Basic_Blink make -j
If you want to try out the Host emulator, do this:
make -j SMING_ARCH=Host
For build options:
Install Eclipse IDE
Whilst building and configuring your application is generally easier and faster using the command prompt, developing and debugging code is greatly simplified using an Integrated Development Environment (IDE).
Install Java Runtime Environment.
Install Eclipse IDE for C++ Developers.
Start Eclipse IDE. When prompted, enter
C:\tools\smingas the workspace path.
Select File -> Import -> General -> Existing Project into Workspace. In the line Select root directory, select the directory
C:\tools\sming\Smingand import everything.
Go have a cup of coffee while Eclipse scans all the source code. It can take a while!
To build a project, right-click and select Build project. Alternatively, select the project and press F9.
Eclipse IDE variables
The only variable you should need to set within Eclipse is
You can set this within the Eclipse IDE via Window > Preferences -> C/C++ > Build > Environment.
If you set this via global environment variable before starting Eclipse then this step is not necessary.
Variables set within the IDE won’t be accessible in other Eclipse sessions or the command prompt.
All other configuration should be done either in your project’s component.mk file or via command line.
For example, to switch to a Host emulator build, do this:
make SMING_ARCH=Host list-config
This also displays the current configuration settings. Whether you build from command line or Eclipse, the same settings will be used.
Proceed to Configuration.