Discuss here different C compiler set ups, and compiling executables for the ESP8266

User avatar
By andrew melvin
#10110 I've given this a bunch of goes. Tried on my mac, on ubuntu virtual machines. And no luck.

I've followed the instructions here.. https://github.com/pfalcon/esp-open-sdk

changed my paths

but i get this error. I can build the examples just fine, as well as node-mcu?

Code: Select allandrew@ubuntu-testbed:~/esphttpd$ make
CC user/auth.c
In file included from /home/andrew/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/include/os_type.h:10:0,
                 from /home/andrew/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/include/user_interface.h:9,
                 from user/auth.c:17:
/home/andrew/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/include/ets_sys.h:11:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before string constant
 include "c_types.h"
         ^
In file included from /home/andrew/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/include/os_type.h:10:0,
                 from /home/andrew/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/include/user_interface.h:9,
                 from user/auth.c:17:
/home/andrew/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/include/ets_sys.h:15:1: error: unknown type name 'uint32_t'
 typedef uint32_t ETSParam;
 ^
/home/andrew/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/include/ets_sys.h:20:5: error: unknown type name 'ETSSignal'
     ETSSignal sig;
     ^
/home/andrew/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/include/ets_sys.h:27:1: error: unknown type name 'uint32_t'
 typedef uint32_t ETSHandle;
 ^
/home/andrew/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/include/ets_sys.h:32:5: error: unknown type name 'uint32_t'
     uint32_t              timer_expire;
     ^
/home/andrew/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/include/ets_sys.h:33:5: error: unknown type name 'uint32_t'
     uint32_t              timer_period;
     ^
In file included from /home/andrew/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/include/user_interface.h:9:0,
                 from user/auth.c:17:
/home/andrew/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/include/user_interface.h:67:33: error: unknown type name 'ETSSignal'
 bool system_os_post(uint8 prio, os_signal_t sig, os_param_t par);
User avatar
By tim1073
#10299 I ran into the same problem. As part of the environment setup, the c_types.h file in the sdk include directory is replaced. The old file is left in the directory as c_types.h.orig. The new file removes the definition for uint32_t and a bunch of other types. I don't know why this was done and it may break something else, but restoring the original c_types.h file allowed me to compile.
User avatar
By andrew melvin
#10498 Thanks

somehow, a fresh installation (try number 4) and git clone from the spritserver NOT the github repository bjpirt, seemed to compile without errors...

unfortunately hit another hurdle to do with the esptool....

Code: Select allandrew@ubuntu-testbed:~/esphttpd$ make
CC user/espfs.c
CC user/heatshrink_decoder.c
CC user/httpd.c
CC user/httpdespfs.c
CC user/io.c
CC user/stdout.c
CC user/user_main.c
AR build/httpd_app.a
LD build/httpd.out
FW firmware/0x00000.bin
usage: esptool [-h] [--port PORT] [--baud BAUD]
               {load_ram,dump_mem,read_mem,write_mem,write_flash,run,image_info,make_image,elf2image,read_mac}
               ...
esptool: error: argument operation: invalid choice: 'build/httpd.out' (choose from 'load_ram', 'dump_mem', 'read_mem', 'write_mem', 'write_flash', 'run', 'image_info', 'make_image', 'elf2image', 'read_mac')
make: *** [firmware/0x00000.bin] Error 2


now i realise that there are two esptools... but can't find reference to the other one. Are they both to flash?

I can't for the life of me get this stuff to work on my mac, so its all in an ubuntuVM.

I need the binaries to just be put into a directory, but unfortunately there is nothing there..