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

User avatar
By alonewolfx2
#9678 can you share project files? (all files in zip)



BarryP wrote:Brilliant !! Thanks .
Got it working in eclipse .. Ye Ha !
Here is my modified Makefile .
Code: Select allXTENSA_TOOLS_ROOT    ?= c:/Espressif/xtensa-lx106-elf/bin
SDK_BASE         ?= c:/Espressif/ESP8266_SDK
SDK_INCDIR         = include
# I use a separate DIR for the includes that are not part of the official SDK
USER_INC_BASE      ?= C:/Espressif/ThirdParty/include

CC      := $(XTENSA_TOOLS_ROOT)/xtensa-lx106-elf-gcc
AR      := $(XTENSA_TOOLS_ROOT)/xtensa-lx106-elf-ar
OBJCOPY := $(XTENSA_TOOLS_ROOT)/xtensa-lx106-elf-objcopy



SDK_LIB_DIR ?= $(SDK_BASE)/lib

SDK_INCDIR   := $(addprefix -I$(SDK_BASE)/,$(SDK_INCDIR))

# The dir structuredoesn't play nice with eclipse so added -Isrc/include/ipv4/
CFLAGS = -Os -mlongcalls -Isrc/include/ipv4/ -Isrc/include/ -Iconfig/ -Iespressif/include/

CFLAGS += -DLWIP_OPEN_SRC
CFLAGS += -D__ets__

OBJS = \
src/api/api_lib.o \
src/api/api_msg.o \
src/api/err.o \
src/api/netbuf.o \
src/api/netdb.o \
src/api/netifapi.o \
src/api/sockets.o \
src/api/tcpip.o \
src/core/ipv4/autoip.o \
src/core/ipv4/icmp.o \
src/core/ipv4/igmp.o \
src/core/ipv4/inet.o \
src/core/ipv4/inet_chksum.o \
src/core/ipv4/ip.o \
src/core/ipv4/ip_addr.o \
src/core/ipv4/ip_frag.o \
src/core/dhcp.o \
src/core/dns.o \
src/core/def.o \
src/core/init.o \
src/core/netif.o \
src/core/mem.o \
src/core/memp.o \
src/core/pbuf.o \
src/core/raw.o \
src/core/stats.o \
src/core/sys.o \
src/core/tcp.o \
src/core/tcp_in.o \
src/core/tcp_out.o \
src/core/timers.o \
src/core/udp.o \
src/netif/etharp.o \
espressif/espconn.o \
espressif/espconn_tcp.o \
espressif/espconn_udp.o \
espressif/sys_arch.o \
espressif/netio.o \
espressif/dhcpserver.o \
espressif/ping.o \

.PHONY: all remove_user_includes copy_liblwip_to_sdk_lib_dir make_user_inc_dirs copy_includes_to_user_inc_dir

%.o: %.c
   $(CC) -c  $(SDK_INCDIR) $(CFLAGS) -o $@ $<
   $(OBJCOPY) --rename-section .text=.irom0.text --rename-section .literal=.irom0.literal $@

all: liblwip.a copy_liblwip_to_sdk_lib_dir

liblwip.a: $(OBJS)
   $(AR) rcs liblwip.a $(OBJS)
   
copy_liblwip_to_sdk_lib_dir:
   cp liblwip.a $(SDK_LIB_DIR)

make_user_inc_dirs:
   -mkdir $(USER_INC_BASE)/pp
   -mkdir $(USER_INC_BASE)/netif
   -mkdir $(USER_INC_BASE)/arch
   -mkdir $(USER_INC_BASE)/lwip
   -mkdir $(USER_INC_BASE)/lwip/app
   
copy_includes_to_user_inc_dir: make_user_inc_dirs
   cp ./src/include/ipv4/lwip/*.* $(USER_INC_BASE)/lwip/
   cp ./src/include/lwip/*.* $(USER_INC_BASE)/lwip/
   cp ./espressif/include/lwip/app/*.* $(USER_INC_BASE)/lwip/app/
   cp ./src/include/netif/*.* $(USER_INC_BASE)/netif/   
   cp ./espressif/include/arch/*.* $(USER_INC_BASE)/arch/
   cp ./espressif/include/pp/*.* $(USER_INC_BASE)/pp/

   
#-Isrc/include/ -Iconfig/ -Iespressif/include/
   
remove_user_includes:
   rm -rf $(USER_INC_BASE)/pp
   rm -rf $(USER_INC_BASE)/netif
   rm -rf $(USER_INC_BASE)/arch
   rm -rf $(USER_INC_BASE)/lwip/app
   rm -rf $(USER_INC_BASE)/lwip
   
clean:
   rm $(OBJS) liblwip.a
   

   

User avatar
By myeoman
#9707 @CHERTS: Thanks, I used your SDK to develop something that has just been picked up by Hackaday at http://hackaday.com/2015/02/12/a-haptic ... computing/

The guys there are complaining that your entry page at http://programs74.ru/udkew-en.html looks suspicious. You might want to take note of that, and maybe even join the comments?

Thanks for all your good work.

[tinkermax]
User avatar
By BarryP
#9710 The Makefile & process has changed a bit in the last few hours .
kadamski will probably see it as Bloatware considering how clean his original one was ........

It will however be interesting to see if the zip is generic enough to dropin to an existing setup.
I've tested on another machine doing an Import of "Existing Projects Into Workspace " & it worked .

# The current process for 'all' is
# Remove Current Copy of SDK Headers ,
# get a copy of Current SDK Headers ,
# Make the Lib ,
# Backup liblwip.a to org_ liblwip.a if org_ liblwip.a doesn't exist
# Overwrite existing liblwip.a in SDK
# Write headers used to a user folder
===========================
You need to check / modify some Dirs in the Makefile

I.E.
XTENSA_TOOLS_ROOT ?= c:/Espressif/xtensa-lx106-elf/bin
SDK_BASE ?= c:/Espressif/ESP8266_SDK

# I use a separate DIR for the includes that are not part of the official SDK
USER_INC_BASE ?= C:/Espressif/ThirdParty/include
=============================================================
Here tis
You do not have the required permissions to view the files attached to this post.
User avatar
By bkrajendra
#9729
CHERTS wrote:Hi

Based on a series of my articles I publish my assembly Espressif DevKit for developing firmware on Windows, all further discussion propose to write here.


My Dear friend @CHERTS,
You have done a remarkable job by compiling all required tools and compiler, sdk in one place.
Many beginners will definitely find these resources very much useful.

But let me tell you that 80% of this IT world do not trust any EXE unless it is digitally signed.
Hence it will be nice if you pack all of these tools in ZIP or RAR packages.
I hope there will not be any problem doing this, as you are not setting any system registry or environment variable in your installer. Even if its required you can provide sample BAT file or VBscript file or registry files.
You can even put entire content on github for better distribution and managment.

This will really grow the trust among developers and will also increase the popularity of your work.

I hope you understand my concerns.!