Skip to content

Flashing & Compiling

verybadsoldier edited this page Jul 19, 2019 · 5 revisions

There are several possibilities to flash your controller, but most commonly you want to either flash pre-compiled binaries or compile the binaries yourself and flash them afterward.

The pre-compiled binaries provided via github are generated by an automatic build process (TRAVIS-CI) whenever a new version is released. This ensures, that the binaries have not been modified in any sense or include code that might be harmful.



Precompiled rom and filesystems

In order to flash your controller, you will need:

Steps for ESPTOOL

  • copy esptool to the directory of the extracted firmware files
  • Put the device into serial bootloader mode. First hold reset Button, than set PT0 to GND than release reset Button than release PT0 from GND. Now Device should be in serial bootloader mode.
  • replace COMPORT with the port of your Serial programmer in the following code and execute it

greater equal 4.0.0

esptool.py -p /dev/COMPORT -b 115200 erase_flash
esptool.py -p /dev/ttyUSB0 -b 115200 write_flash -ff 40m -fm qio -fs 32m 0x3fc000 esp_init_data_default.bin 0x3fe000 blank.bin 0x100000 blankfs.bin
esptool.py -p /dev/ttyUSB0 -b 115200 write_flash -ff 40m -fm qio -fs 32m 0x00000 rboot.bin 0x02000 rom0.bin 0x100000 spiff_rom.bin

< 4.0.0:

esptool -p COMPORT -b 115200 write_flash -ff 40m -fm qio -fs 32m 0x00000 rboot.bin 0x02000 rom0.bin 0x100000 spiff_rom.bin

After successfully flashing it is recommended to reset the controller (via reset button or by cycling the power)



Compiling yourself

This option is only recommended if you have experience in setting up your own development environments, are comfortable using git/commandline tools/make. This project is using a modified version of the SMING framework. The correct version is included as a submodule (subfolder Sming). You do not need to have a seperate SMING checkout.

If you want to include the webapplication, you also need:

Steps

  1. Clone the repository
  • Clone the firmware repository to your local filesystem using git clone --recursive.
  • git submodul update --init
  • Clone the esp-open-sdk to a separate directory: https://github.com/pfalcon/esp-open-sdk
  1. Compile esp-open-sdk
  • git clone --recursive https://github.com/pfalcon/esp-open-sdk
  • make STANDALONE=n VENDOR_SDK=2.1.0-18-g61248df (we use STANDALONE=n to build only the toolchain as we use the SDK that comes bundled with Sming)

or

  1. Download esp-open-sdk (Linux only)
  1. Setup your development environments
  • Export the environment variable SMING_HOME to the Sming/Sming directory inside the cloned directory (e.g. export SMING_HOME=/home/me/esp_rgbww_firmware/Sming/Sming)
  • export ESP_HOME pointing to the directory of the esp-open-sdk
  • export SDK_BASE pointing to Sming's SDK directory e.g. SDK_BASE=/home/me/Projects/esp_rgbww_firmware/Sming/Sming/third-party/ESP8266_NONOS_SDK/
  • cd into Sming/Sming and do make (Further documentation regarding compilation of Sming: https://github.com/SmingHub/Sming)
  1. Webinterface
  • Ready-To-Use webinterface is included in the checkout.
  1. Make and Flash
  • If you have followed the instructions until here, you can now compile your own version of the firmware via running make. Use make flash to also flash the firmware to the controller after compilation.
  • Find the compiled binaries in ./out/firmware

After successfully flashing it is recommended to reset the controller (via reset button or by cycling the power)