ESP8266 SDK 2.0


Catching up with the latest ESP8266_NONOS_SDK_V2.0.0_16_07_19

– got into some issues.

Seems like Espressif integrated some time compatibility functions into libmain.a which i already had into the tree, most likely due mbed tls port

If you have millis(), micros(), mktime() and friends then you may need to comment them out.

There is one exception – open soruce xtensa gcc provides time() which is required by ANSI C so it is in  – platform must provide gettimeofday.
The problem is time() is in libmain from the SDK – so the workaround is to strip time from your libc and use the one in the SDK.

You’ll get an error like:

lib/libmain.a(time.o): In function `time’:
(.irom0.text+0x1dc): multiple definition of `time’
/…/esp-open-sdk/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/lib/libcirom.a(lib_a-time.o):/…/esp-open-sdk/crosstool-NG/.build/src/newlib-2.0.0/newlib/libc/time/time.c:43: first defined here

To solve:

cd  esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/lib/

cp libc.a

xtensa-lx106-elf-objcopy -N time libc.a

and this does the trick.

Firmware booted with sdk 2.0 and looks working.

Happy hacking!


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.