SDKDIR ?= /opt/esp8266-sdk
-AR = $(SDKDIR)/bin/xtensa-lx106-elf-ar
-CC = $(SDKDIR)/bin/xtensa-lx106-elf-gcc
-LD = $(SDKDIR)/bin/xtensa-lx106-elf-gcc
-OBJCOPY = $(SDKDIR)/bin/xtensa-lx106-elf-objcopy
-OBJDUMP = $(SDKDIR)/bin/xtensa-lx106-elf-objdump
+AR = xtensa-lx106-elf-ar
+CC = xtensa-lx106-elf-gcc
+LD = xtensa-lx106-elf-gcc
+OBJCOPY = xtensa-lx106-elf-objcopy
+OBJDUMP = xtensa-lx106-elf-objdump
LIBS = -lc -lhal -lphy -lpp -lnet80211 -llwip -lwpa -lmain
-CFLAGS = -Wall -Os -fno-inline-functions -mlongcalls -DICACHE_FLASH -I.
-LDFLAGS = -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static
+CFLAGS = -Wall -Os -fno-inline-functions -mlongcalls -DICACHE_FLASH -I. \
+ -I$(SDKDIR)/xtensa-lx106-elf/include
+LDFLAGS = -nostdlib -Wl,--no-check-sections -Wl,--gc-sections -Wl,-static \
+ -u call_user_start \
+ -L$(SDKDIR)/xtensa-lx106-elf/lib
APP = clock
OBJS = user_main.o max7219.o spi.o clock.o
echo '#define CFG_WIFI_PASSWORD "password"' >> $@
clean:
- rm -f $(OBJS) $(APP)_app.a $(APP).elf rom0.bin rom1.bin
+ rm -f $(OBJS) $(APP)_app.a rom0.elf rom1.elf rom0.bin rom1.bin
.PHONY: all clean
#include <mem.h>
#include <osapi.h>
-#include "espmissingincludes.h"
-
#include "clock.h"
#define NTP_SERVER "uk.pool.ntp.org"
#include <os_type.h>
#include <gpio.h>
-#include "espmissingincludes.h"
#include "max7219.h"
#include "spi.h"
dport0_0_seg : org = 0x3FF00000, len = 0x10
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
iram1_0_seg : org = 0x40100000, len = 0x8000
- irom0_0_seg : org = 0x40202010, len = 0x3C000
+ irom0_0_seg : org = 0x40201010, len = 0x6B000
}
PHDRS
} >dram0_0_seg :dram0_0_bss_phdr
/* __stack = 0x3ffc8000; */
+ .irom0.text : ALIGN(4)
+ {
+ _irom0_text_start = ABSOLUTE(.);
+
+ *libat.a:(.literal.* .text.*)
+ *libcrypto.a:(.literal.* .text.*)
+ *libespnow.a:(.literal.* .text.*)
+ *libjson.a:(.literal.* .text.*)
+ *liblwip.a:(.literal.* .text.*)
+ *libnet80211.a:(.literal.* .text.*)
+ *libsmartconfig.a:(.literal.* .text.*)
+ *libssl.a:(.literal.* .text.*)
+ *libupgrade.a:(.literal.* .text.*)
+ *libwpa.a:(.literal.* .text.*)
+ *libwpa2.a:(.literal.* .text.*)
+ *libwps.a:(.literal.* .text.*)
+
+ *libmbedtls.a:(.literal.* .text.*)
+
+ *libm.a:(.literal .text .literal.* .text.*)
+
+ *(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text)
+ _irom0_text_end = ABSOLUTE(.);
+ } >irom0_0_seg :irom0_0_phdr
+
.text : ALIGN(4)
{
_stext = .;
*(.gnu.linkonce.lit4.*)
_lit4_end = ABSOLUTE(.);
} >iram1_0_seg :iram1_0_phdr
-
- .irom0.text : ALIGN(4)
- {
- _irom0_text_start = ABSOLUTE(.);
- *(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text)
- _irom0_text_end = ABSOLUTE(.);
- } >irom0_0_seg :irom0_0_phdr
}
/* get ROM code address */
dport0_0_seg : org = 0x3FF00000, len = 0x10
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
iram1_0_seg : org = 0x40100000, len = 0x8000
- irom0_0_seg : org = 0x40242010, len = 0x3C000
+ irom0_0_seg : org = 0x40281010, len = 0x6B000
}
PHDRS
} >dram0_0_seg :dram0_0_bss_phdr
/* __stack = 0x3ffc8000; */
+ .irom0.text : ALIGN(4)
+ {
+ _irom0_text_start = ABSOLUTE(.);
+
+ *libat.a:(.literal.* .text.*)
+ *libcrypto.a:(.literal.* .text.*)
+ *libespnow.a:(.literal.* .text.*)
+ *libjson.a:(.literal.* .text.*)
+ *liblwip.a:(.literal.* .text.*)
+ *libnet80211.a:(.literal.* .text.*)
+ *libsmartconfig.a:(.literal.* .text.*)
+ *libssl.a:(.literal.* .text.*)
+ *libupgrade.a:(.literal.* .text.*)
+ *libwpa.a:(.literal.* .text.*)
+ *libwpa2.a:(.literal.* .text.*)
+ *libwps.a:(.literal.* .text.*)
+
+ *libmbedtls.a:(.literal.* .text.*)
+
+ *libm.a:(.literal .text .literal.* .text.*)
+
+ *(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text)
+ _irom0_text_end = ABSOLUTE(.);
+ } >irom0_0_seg :irom0_0_phdr
+
.text : ALIGN(4)
{
_stext = .;
*(.gnu.linkonce.lit4.*)
_lit4_end = ABSOLUTE(.);
} >iram1_0_seg :iram1_0_phdr
-
- .irom0.text : ALIGN(4)
- {
- _irom0_text_start = ABSOLUTE(.);
- *(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text)
- _irom0_text_end = ABSOLUTE(.);
- } >irom0_0_seg :irom0_0_phdr
}
/* get ROM code address */
#include <os_type.h>
#include <user_interface.h>
-#include "espmissingincludes.h"
-
#include "project_config.h"
#include "clock.h"