Chat here about code rewrites, mods, etc... with respect to the github project https://github.com/esp8266/Arduino

Moderator: igrr

User avatar
By eduperez
#30837 I have set up the Arduino IDE to develop sketches for the ESP, and I have also configured Eclipse as an IDE to develop sketches for Arduino; but I could not make Eclipse work with the ESP using Arduino sketches. Has anybody else managed to make that work?
User avatar
By kolban
#30839 When I tried it, it worked for me. What I'd suggest you do is elaborate on each step you attempted, where you got the "code" that you used, exactly what parameters you entered and what were the results you encountered.
User avatar
By eduperez
#30979 Many thanks for your answer!

This is the basic system information:
  • Fedora: 22
  • Eclipse: 4.4.2
  • Arduino IDE: 1.6.5

As I mentioned before, the Arduino IDE has been previously configured to compile and upload sketches to the ESP with no issues at all.

I install the latest (2.2.0.1) "Arduino Eclipse Extensions" plug-in from "http://www.baeyens.it/eclipse/V2", and restart Eclipse. In "Window > Preferences" I fill all the paths for my IDE, private library, and hardware. Then I create a "New Arduino Sketch", fill in all the information, and copy one of my working sketches inside the ".cpp" file already created inside the project.

Now, when I try to build the project, it fails with the message "/bin/sh: /bin/xtensa-lx106-elf-g++: No such file or directory", because the compiler is not at "/bin". After some investigation, I add the following lines to my "/home/eperez/.arduino15/packages/esp8266/hardware/esp8266/1.6.5-947-g39819f0/platform.txt" file:

Code: Select allruntime.platform.path=/home/eperez/.arduino15/packages/esp8266/hardware/esp8266/1.6.5-947-g39819f0

runtime.tools.xtensa-lx106-elf-gcc.path={runtime.platform.path}/../../../tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9
runtime.tools.esptool.path={runtime.platform.path}/../../../tools/esptool/0.4.5


I delete the project, create a new one, copy the code, and build the project. Now I get a "fatal error: ESP8266WiFi.h: No such file or directory"... Ops! I forgot to add the libraries; I go to "Add library to the selected project" and add "esp8266", "ESP8266WiFi", and "ESP8266WebServer". Clean the project, build again, and get:

Code: Select allStarting combiner
"/home/eperez/.arduino15/packages/esp8266/hardware/esp8266/1.6.5-947-g39819f0/../../../tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9/bin/xtensa-lx106-elf-gcc" -g -Os -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static "-L/home/eperez/.arduino15/packages/esp8266/hardware/esp8266/1.6.5-947-g39819f0/tools/sdk//lib" "-L/home/eperez/.arduino15/packages/esp8266/hardware/esp8266/1.6.5-947-g39819f0/tools/sdk//ld" "-Teagle.flash.512k.ld" -Wl,-wrap,system_restart_local -Wl,-wrap,register_chipv6_phy  -o "/home/eperez/workspace/IOT/Release/IOT.elf" -Wl,--start-group    ./IOT.cpp.o  ./Libraries/ESP8266WiFi/src/ESP8266WiFi.cpp.o ./Libraries/ESP8266WiFi/src/ESP8266WiFiMulti.cpp.o ./Libraries/ESP8266WiFi/src/WiFiClient.cpp.o ./Libraries/ESP8266WiFi/src/WiFiServer.cpp.o ./Libraries/ESP8266WiFi/src/WiFiUdp.cpp.o  ./Libraries/ESP8266WebServer/src/ESP8266WebServer.cpp.o ./Libraries/ESP8266WebServer/src/Parsing.cpp.o   /home/eperez/workspace/IOT/Release/arduino.ar   "/home/eperez/workspace/IOT/Release/arduino.ar" -lm -lgcc -lhal -lphy -lnet80211 -llwip -lwpa -lmain -lpp -lsmartconfig -lwps -lcrypto -Wl,--end-group  "-L/home/eperez/workspace/IOT/Release"
/home/eperez/workspace/IOT/Release/arduino.ar(core_esp8266_main.cpp.o):(.text+0x14): undefined reference to `cont_run'
makefile:76: recipe for target 'IOT.elf' failed
/home/eperez/workspace/IOT/Release/arduino.ar(core_esp8266_main.cpp.o): In function `loop_task':
/home/eperez/.arduino15/packages/esp8266/hardware/esp8266/1.6.5-947-g39819f0/cores/esp8266/core_esp8266_main.cpp:117: undefined reference to `cont_run'
/home/eperez/workspace/IOT/Release/arduino.ar(core_esp8266_main.cpp.o): In function `abort':
/home/eperez/.arduino15/packages/esp8266/hardware/esp8266/1.6.5-947-g39819f0/cores/esp8266/core_esp8266_main.cpp:70: undefined reference to `cont_yield'
/home/eperez/workspace/IOT/Release/arduino.ar(core_esp8266_main.cpp.o): In function `esp_yield':
/home/eperez/.arduino15/packages/esp8266/hardware/esp8266/1.6.5-947-g39819f0/cores/esp8266/core_esp8266_main.cpp:76: undefined reference to `cont_yield'
collect2: error: ld returned 1 exit status
make: *** [IOT.elf] Error 1


These "cont_something" routines seem to be defined at "/home/eperez./packages/esp8266/hardware/esp8266/1.6.5-947-g39819f0/cores/esp8266/cont.S"; but I do not know how to add them to the Eclipse plug-in... any hints here, please?
User avatar
By kolban
#30992 Ive been down that road already ... see:

https://github.com/jantje/arduino-eclip ... issues/293

Also ... it may be useful, at the end of this post you will find a link to a PDF where I keep my ESP8266 notes. On page 162, are my recipes for getting Eclipse working with the Arduino environment. However, I was using Windows and not Linux....