ESP8266 Support WIKI

User Tools

Site Tools


setup-windows-compiler-esp8266

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
setup-windows-compiler-esp8266 [2017/11/27 14:45]
wickedcode [Visual Studio IDE]
setup-windows-compiler-esp8266 [2018/02/25 04:12] (current)
dcm684 [Things to watch out for] Escaped underscore
Line 13: Line 13:
  
 This particular version of the toolset is designed to work under Windows 7 or 8, 32 or 64bit. ​ This particular version of the toolset is designed to work under Windows 7 or 8, 32 or 64bit. ​
-You can download a pre-built ESP8266 toolchain that contains Python and the ESP8266 SDK [[http://​gnutoolchains.com/​esp8266/​|here]]. Alternatively you can gather the necessary components manually:+You can **[[http://​gnutoolchains.com/​esp8266/​|download]]** a pre-built ESP8266 toolchain that contains Python and the ESP8266 SDK. Alternatively you can gather the necessary components manually:
  
   * Create a directory to put all your ESP stuff in. I put mine in **E:​\ESP8266**,​ but obviously yours will be different.   * Create a directory to put all your ESP stuff in. I put mine in **E:​\ESP8266**,​ but obviously yours will be different.
Line 19: Line 19:
   * You need **[[http://​pyserial.sourceforge.net/​|PySerial]]**.   * You need **[[http://​pyserial.sourceforge.net/​|PySerial]]**.
   * Get **[[http://​www.mingw.org/​|minGW]]**. In the package manager, choose **mingw-developer-toolkit** and **mingw-base**. This will give you **make.exe** and some important utilities, like **mkdir.exe** that the makefiles will need.   * Get **[[http://​www.mingw.org/​|minGW]]**. In the package manager, choose **mingw-developer-toolkit** and **mingw-base**. This will give you **make.exe** and some important utilities, like **mkdir.exe** that the makefiles will need.
-  * Get the **[[https://​github.com/​espressif/​esp_iot_rtos_sdk/​archive/​master.zip|sdk]]**. Install it under your chosen directory. Mine is in **E:​\ESP8266\esp_iot_rtos_sdk-master**. +  * Get the **[[https://​github.com/​espressif/​esp_iot_rtos_sdk/​archive/​master.zip|sdk]]**. Install it under your chosen directory. Mine is in **E:​\ESP8266\esp\_iot\_rtos\_sdk-master**. 
-  * Download the missing libraries for the SDK: **[[https://​github.com/​espressif/​esp_iot_rtos_sdk_lib/​archive/​master.zip|FreeRTOS libraries for SDK]]**. Add them to the **E:​\ESP8266\esp_iot_rtos_sdk-master\lib** directory.+  * Download the missing libraries for the SDK: **[[https://​github.com/​espressif/​esp_iot_rtos_sdk_lib/​archive/​master.zip|FreeRTOS libraries for SDK]]**. Add them to the **E:​\ESP8266\esp\_iot\_rtos\_sdk-master\lib** directory.
   * Get the **[[https://​drive.google.com/​file/​d/​0B1kVUQJ3na10RkhtRDE1UFZBVzg/​view?​usp=sharing|pre-built compiler]]**. Stick it in your chosen directory. Mine is in **E:​\ESP8266\xtensa-lx106-elf**.   * Get the **[[https://​drive.google.com/​file/​d/​0B1kVUQJ3na10RkhtRDE1UFZBVzg/​view?​usp=sharing|pre-built compiler]]**. Stick it in your chosen directory. Mine is in **E:​\ESP8266\xtensa-lx106-elf**.
   * Get the missing xtensa includes for gcc **[[http://​bbs.espressif.com/​viewtopic.php?​f=5&​t=67|here]]**. It is the file **xtensa.tar.bz2**. Extract them into the compiler subdirectory:​ **E:​\ESP8266\xtensa-lx106-elf\xtensa-lx106-elf\include**.   * Get the missing xtensa includes for gcc **[[http://​bbs.espressif.com/​viewtopic.php?​f=5&​t=67|here]]**. It is the file **xtensa.tar.bz2**. Extract them into the compiler subdirectory:​ **E:​\ESP8266\xtensa-lx106-elf\xtensa-lx106-elf\include**.
Line 37: Line 37:
  
   * So in my project setup, in Visual Studio, I use ESPMAKE instead of make.   * So in my project setup, in Visual Studio, I use ESPMAKE instead of make.
-  * Modify the makefile in the xPL_ESP8266 ​project so that it reflects your locations for the tools and sdk. You should be able to compile and flash by simply typing '​make'​ or 'make flash' in the xPL_ESP8266 ​directory.+  * Modify the makefile in the xPL\_ESP8266 ​project so that it reflects your locations for the tools and sdk. You should be able to compile and flash by simply typing '​make'​ or 'make flash' in the xPL\_ESP8266 ​directory.
   * Get the enhanced **[[https://​github.com/​peteben/​ESP-Termie|serial terminal and firmware tool]]**. You need the modified Python tool to flash the chip, **esptool-py.py**. This version is enhanced to reset the chip and bring it into firmware update mode automatically by using DTR. It also connects to Termie, the serial terminal application to share the serial port connection.   * Get the enhanced **[[https://​github.com/​peteben/​ESP-Termie|serial terminal and firmware tool]]**. You need the modified Python tool to flash the chip, **esptool-py.py**. This version is enhanced to reset the chip and bring it into firmware update mode automatically by using DTR. It also connects to Termie, the serial terminal application to share the serial port connection.
   * Compile '​Termie'​ the serial terminal. I modified this program to use a named pipe to communicate with the esptool-py flasher application. Thus it knows when to disconnect from the serial port when you want to flash the chip.   * Compile '​Termie'​ the serial terminal. I modified this program to use a named pipe to communicate with the esptool-py flasher application. Thus it knows when to disconnect from the serial port when you want to flash the chip.
Line 59: Line 59:
 By default, all code goes into iram, which is only 32k, so it is easy to overflow that segment by linking in a bunch of stuff from the libraries or from your own code. By default, all code goes into iram, which is only 32k, so it is easy to overflow that segment by linking in a bunch of stuff from the libraries or from your own code.
  
-Use **ICACHE_FLASH_ATTR** on your functions to make sure they go into irom instead. Irom resides off-chip on a 4M flash ROM, thus leaving about 240-440kB for applications. Although the final compiled program appears huge (about 180k in irom, and 28k in iram), most of this is library code that runs the Wifi and IP stacks. The actual user application is something like 8k.+Use **ICACHE\_FLASH\_ATTR** on your functions to make sure they go into irom instead. Irom resides off-chip on a 4M flash ROM, thus leaving about 240-440kB for applications. Although the final compiled program appears huge (about 180k in irom, and 28k in iram), most of this is library code that runs the Wifi and IP stacks. The actual user application is something like 8k.
  
 The hardware design shown above also assumes that the switch will remain open at bootup, as GPIO2 needs to be high for the chip to boot normally. ​ The hardware design shown above also assumes that the switch will remain open at bootup, as GPIO2 needs to be high for the chip to boot normally. ​
Line 68: Line 68:
 [[http://​www.esp8266.com/​viewtopic.php?​f=9&​t=820|Eclipse IDE for ESP8266]] [[http://​www.esp8266.com/​viewtopic.php?​f=9&​t=820|Eclipse IDE for ESP8266]]
  
-======Arduino IDE =====+===== Arduino IDE =====
  Go to Arduino site and download the IDE   Go to Arduino site and download the IDE 
 Unzip it wherever ​ Unzip it wherever ​
setup-windows-compiler-esp8266.1511793953.txt.gz · Last modified: 2017/11/27 14:45 by wickedcode