Compare commits

..

No commits in common. "master" and "sdk-0.9.3" have entirely different histories.

8 changed files with 96 additions and 277 deletions

4
.gitignore vendored
View file

@ -1,4 +0,0 @@
sdk
xtensa-lx106-elf/
.sdk_patch_*
esp_iot_sdk_*

116
Makefile
View file

@ -1,31 +1,15 @@
TOP = $(PWD)
TOOLCHAIN = $(TOP)/xtensa-lx106-elf
VENDOR_SDK = 1.0.1
UNZIP = unzip -q -o
TOP=$(PWD)
TOOLCHAIN=$(TOP)/xtensa-lx106-elf
VENDOR_SDK = 0.9.3
VENDOR_SDK_ZIP = $(VENDOR_SDK_ZIP_$(VENDOR_SDK))
VENDOR_SDK_DIR = $(VENDOR_SDK_DIR_$(VENDOR_SDK))
VENDOR_SDK_ZIP_1.0.1 = esp_iot_sdk_v1.0.1_15_04_24.zip
VENDOR_SDK_DIR_1.0.1 = esp_iot_sdk_v1.0.1
VENDOR_SDK_ZIP_1.0.1b2 = esp_iot_sdk_v1.0.1_b2_15_04_10.zip
VENDOR_SDK_DIR_1.0.1b2 = esp_iot_sdk_v1.0.1_b2
VENDOR_SDK_ZIP_1.0.1b1 = esp_iot_sdk_v1.0.1_b1_15_04_02.zip
VENDOR_SDK_DIR_1.0.1b1 = esp_iot_sdk_v1.0.1_b1
VENDOR_SDK_ZIP_1.0.0 = esp_iot_sdk_v1.0.0_15_03_20.zip
VENDOR_SDK_DIR_1.0.0 = esp_iot_sdk_v1.0.0
VENDOR_SDK_ZIP_0.9.6b1 = esp_iot_sdk_v0.9.6_b1_15_02_15.zip
VENDOR_SDK_DIR_0.9.6b1 = esp_iot_sdk_v0.9.6_b1
VENDOR_SDK_ZIP_0.9.5 = esp_iot_sdk_v0.9.5_15_01_23.zip
VENDOR_SDK_DIR_0.9.5 = esp_iot_sdk_v0.9.5
VENDOR_SDK_ZIP_0.9.4 = esp_iot_sdk_v0.9.4_14_12_19.zip
VENDOR_SDK_DIR_0.9.4 = esp_iot_sdk_v0.9.4
VENDOR_SDK_ZIP_0.9.3 = esp_iot_sdk_v0.9.3_14_11_21.zip
VENDOR_SDK_DIR_0.9.3 = esp_iot_sdk_v0.9.3
VENDOR_SDK_ZIP_0.9.2 = esp_iot_sdk_v0.9.2_14_10_24.zip
VENDOR_SDK_DIR_0.9.2 = esp_iot_sdk_v0.9.2
STANDALONE = y
VENDOR_SDK_ZIP_0.9.3=esp_iot_sdk_v0.9.3_14_11_21.zip
VENDOR_SDK_DIR_0.9.3=esp_iot_sdk_v0.9.3
VENDOR_SDK_ZIP_0.9.2=esp_iot_sdk_v0.9.2_14_10_24.zip
VENDOR_SDK_DIR_0.9.2=esp_iot_sdk_v0.9.2
STANDALONE=y
.PHONY: crosstool-NG toolchain libhal libcirom sdk
@ -49,7 +33,7 @@ endif
esptool: toolchain
cp esptool/esptool.py $(TOOLCHAIN)/bin/
$(TOOLCHAIN)/xtensa-lx106-elf/sysroot/lib/libcirom.a: $(TOOLCHAIN)/xtensa-lx106-elf/sysroot/lib/libc.a $(TOOLCHAIN)/bin/xtensa-lx106-elf-gcc
$(TOOLCHAIN)/xtensa-lx106-elf/sysroot/lib/libcirom.a: $(TOOLCHAIN)/xtensa-lx106-elf/sysroot/lib/libc.a toolchain
@echo "Creating irom version of libc..."
$(TOOLCHAIN)/bin/xtensa-lx106-elf-objcopy --rename-section .text=.irom0.text \
--rename-section .literal=.irom0.literal $(<) $(@);
@ -58,45 +42,8 @@ libcirom: $(TOOLCHAIN)/xtensa-lx106-elf/sysroot/lib/libcirom.a
sdk_patch: .sdk_patch_$(VENDOR_SDK)
.sdk_patch_1.0.1: libnet80211.zip
$(UNZIP) $<
mv libnet80211.a $(VENDOR_SDK_DIR)/lib/
rm libnet80211.zip
patch -d $(VENDOR_SDK_DIR_1.0.1) -p1 < c_types-c99.patch
@touch $@
.sdk_patch_1.0.1b2: libssl.zip esp_iot_sdk_v1.0.1_b2/.dir
$(UNZIP) $<
mv libssl/libssl.a $(VENDOR_SDK_DIR_1.0.1b2)/lib/
rm -r libssl libssl.zip
patch -d $(VENDOR_SDK_DIR_1.0.1b2) -p1 < c_types-c99.patch
@touch $@
.sdk_patch_1.0.1b1:
patch -d $(VENDOR_SDK_DIR_1.0.1b1) -p1 < c_types-c99.patch
@touch $@
.sdk_patch_1.0.0:
patch -d $(VENDOR_SDK_DIR_1.0.0) -p1 < c_types-c99.patch
@touch $@
.sdk_patch_0.9.6b1:
patch -d $(VENDOR_SDK_DIR_0.9.6b1) -p1 < c_types-c99.patch
@touch $@
.sdk_patch_0.9.5: sdk095_patch1.zip esp_iot_sdk_v0.9.5/.dir
$(UNZIP) $<
mv libmain_fix_0.9.5.a $(VENDOR_SDK_DIR)/lib/libmain.a
mv user_interface.h $(VENDOR_SDK_DIR)/include/
patch -d $(VENDOR_SDK_DIR_0.9.5) -p1 < c_types-c99.patch
@touch $@
.sdk_patch_0.9.4:
patch -d $(VENDOR_SDK_DIR_0.9.4) -p1 < c_types-c99.patch
@touch $@
.sdk_patch_0.9.3: esp_iot_sdk_v0.9.3_14_11_21_patch1.zip esp_iot_sdk_v0.9.3/.dir
$(UNZIP) $<
unzip -o $<
@touch $@
.sdk_patch_0.9.2: FRM_ERR_PATCH.rar esp_iot_sdk_v0.9.2/.dir
@ -119,42 +66,14 @@ FRM_ERR_PATCH.rar:
wget --content-disposition "http://bbs.espressif.com/download/file.php?id=10"
esp_iot_sdk_v0.9.3_14_11_21_patch1.zip:
wget --content-disposition "http://bbs.espressif.com/download/file.php?id=73"
sdk095_patch1.zip:
wget --content-disposition "http://bbs.espressif.com/download/file.php?id=190"
libssl.zip:
wget --content-disposition "http://bbs.espressif.com/download/file.php?id=316"
libnet80211.zip:
wget --content-disposition "http://bbs.espressif.com/download/file.php?id=361"
sdk: $(VENDOR_SDK_DIR)/.dir
ln -snf $(VENDOR_SDK_DIR) sdk
$(VENDOR_SDK_DIR)/.dir: $(VENDOR_SDK_ZIP)
$(UNZIP) $^
-mv License $(VENDOR_SDK_DIR)
unzip -o $^
touch $@
esp_iot_sdk_v1.0.1_15_04_24.zip:
wget --content-disposition "http://bbs.espressif.com/download/file.php?id=325"
esp_iot_sdk_v1.0.1_b2_15_04_10.zip:
wget --content-disposition "http://bbs.espressif.com/download/file.php?id=293"
esp_iot_sdk_v1.0.1_b1_15_04_02.zip:
wget --content-disposition "http://bbs.espressif.com/download/file.php?id=276"
esp_iot_sdk_v1.0.0_15_03_20.zip:
wget --content-disposition "http://bbs.espressif.com/download/file.php?id=250"
esp_iot_sdk_v0.9.6_b1_15_02_15.zip:
wget --content-disposition "http://bbs.espressif.com/download/file.php?id=220"
esp_iot_sdk_v0.9.5_15_01_23.zip:
wget --content-disposition "http://bbs.espressif.com/download/file.php?id=189"
esp_iot_sdk_v0.9.4_14_12_19.zip:
wget --content-disposition "http://bbs.espressif.com/download/file.php?id=111"
esp_iot_sdk_v0.9.3_14_11_21.zip:
wget --content-disposition "http://bbs.espressif.com/download/file.php?id=72"
@ -202,15 +121,8 @@ crosstool-NG/bootstrap:
git submodule update --init --recursive
clean: clean-sdk
clean:
make -C crosstool-NG clean MAKELEVEL=0
-rm -rf $(TOOLCHAIN)
clean-sdk:
rm -rf $(VENDOR_SDK_DIR)
rm -f sdk
rm -f .sdk_patch_$(VENDOR_SDK)
clean-sysroot:
rm -rf $(TOOLCHAIN)/xtensa-lx106-elf/sysroot/usr/lib/*
rm -rf $(TOOLCHAIN)/xtensa-lx106-elf/sysroot/usr/include/*
-rm -rf $(shell readlink sdk)
-rm -f sdk

79
README Normal file
View file

@ -0,0 +1,79 @@
This repository provides integration scripts to build complete standalone
SDK (with toolchain) for software development for Espressif ESP8266,
ESP8266EX chips.
Complete SDK consists of:
1. Xtensa lx106 architecture toolchain (100% OpenSource), based on
following projects:
https://github.com/jcmvbkbc/crosstool-NG
https://github.com/jcmvbkbc/gcc-xtensa
https://github.com/jcmvbkbc/newlib-xtensa
https://github.com/tommie/lx106-hal
The sourcecode above originates from work done directly by Tensilica Inc.,
Cadence Design Systems, Inc, or their contractors.
2. ESP8266 IoT SDK from Espressif Systems. This component is only partially
open source, some libraries provided as binary blobs.
http://bbs.espressif.com/viewforum.php?f=5
OpenSource components of SDK are based on:
lwIP, http://savannah.nongnu.org/projects/lwip/
Contiki, http://www.contiki-os.org/
axTLS, http://axtls.sourceforge.net/
wpa_supplicant, http://w1.fi/wpa_supplicant/ (source withheld by Espressif)
Building
========
To build standalone SDK with toolchain, you need GNU/POSIX system (Linux,
BSD, MacOSX, Windows with Cygwin) with standard GNU development tools
installed, like gcc, binutils, flex, bison, etc. For Ubuntu 14.04
install:
sudo apt-get install make unrar autoconf automake libtool gcc g++ gperf \
flex bison texinfo gawk ncurses-dev libexpat-dev python sed
For other Debian/Ubuntu versions, dependencies may be somewhat different.
E.g., you may need to install libtool-bin, etc.
The project can be build in two modes:
1. Where OpenSource toolchain and tools kept separate from vendor IoT SDK
containing binary blobs. That makes licensing more clear, and facilitates
upgrades to new vendor SDK releases.
2. Completely standalone ESP8266 SDK with vendor SDK files merged with
toolchain. This mode makes it easier to build software (no additinal
-I and -L flags are needed), but redistributability of this build is
unclear and upgrade to newer vendor IoT SDK release is complicated.
This mode is default for local builds. Note that if you want to
redistribute binary toolchain built with this mode, your should:
1) make it clear to your users that the release is bound to particular
vendor IoT SDK and provide instructions how to upgrade to newer vendor
IoT SDK releases; 2) abide by licensing terms of the vendor IoT SDK.
To build separated SDK:
make STANDALONE=n
To build standalone SDK:
make STANDALONE=y
This will download all necessary components and compile them. Once done,
the toolchain (with Xtensa HAL library) will be available in xtensa-lx106-elf/
directory. Add its bin/ subdirectory to execute "xtensa-lx106-elf-gcc"
and other tools.
ESP8266 SDK will be installed in sdk/. If you chose non-standalone SDK, to use it,
run the compiler with corresponding include and lib dir flags:
xtensa-lx106-elf-gcc -I$(THISDIR)/sdk/include -L$(THISDIR)/sdk/lib
Extra -I and -L flags are not needed for standalone SDK.

129
README.md
View file

@ -1,129 +0,0 @@
esp-open-sdk
------------
This repository provides the integration scripts to build a complete
standalone SDK (with toolchain) for software development with the
Espressif ESP8266 and ESP8266EX chips.
The complete SDK consists of:
1. Xtensa lx106 architecture toolchain (100% OpenSource), based on
following projects:
* https://github.com/jcmvbkbc/crosstool-NG
* https://github.com/jcmvbkbc/gcc-xtensa
* https://github.com/jcmvbkbc/newlib-xtensa
* https://github.com/tommie/lx106-hal
The source code above originates from work done directly by Tensilica Inc.,
Cadence Design Systems, Inc, and/or their contractors.
2. ESP8266 IoT SDK from Espressif Systems. This component is only
partially open source, (some libraries are provided as binary blobs).
* http://bbs.espressif.com/viewforum.php?f=5
OpenSource components of the SDK are based on:
* lwIP, http://savannah.nongnu.org/projects/lwip/
* Contiki, http://www.contiki-os.org/
* axTLS, http://axtls.sourceforge.net/
* wpa_supplicant, http://w1.fi/wpa_supplicant/ (source withheld by Espressif)
* net80211/ieee80211 (FreeBSD WiFi stack),
http://www.unix.com/man-page/freebsd/9/NET80211
(source withheld by Espressif)
Building
========
To build the standalone SDK and toolchain, you need a GNU/POSIX system
(Linux, BSD, MacOSX, Windows with Cygwin) with the standard GNU development
tools installed: gcc, binutils, flex, bison, etc.
## Ubuntu 14.04
```
$ sudo apt-get install make unrar autoconf automake libtool gcc g++ gperf \
flex bison texinfo gawk ncurses-dev libexpat-dev python sed
```
## MacOS:
```bash
$ brew tap homebrew/dupes
$ brew install binutils coreutils automake wget gawk libtool gperf gnu-sed --with-default-names grep
$ export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"
```
In addition to the development tools MacOS needs a case-sensitive filesystem.
You might need to create a virtual disk and build esp-open-sdk on it:
```bash
$ sudo hdiutil create ~/Documents/case-sensitive.dmg -volname "case-sensitive" -size 10g -fs "Case-sensitive HFS+"
$ sudo hdiutil mount ~/Documents/case-sensitive.dmg
$ cd /Volumes/case-sensitive
```
For other Debian/Ubuntu versions, dependencies may be somewhat different.
E.g. you may need to install libtool-bin, etc.
The project can be built in two modes:
1. Where the toolchain and tools are kept separate from the vendor IoT SDK
which contains binary blobs. This makes licensing more clear, and helps
facilitate upgrades to vendor SDK releases.
2. A completely standalone ESP8266 SDK with the vendor SDK files merged
into the toolchain. This mode makes it easier to build software (no
additinal `-I` and `-L` flags are needed), but redistributability of
this build is unclear and upgrades to newer vendor IoT SDK releases are
complicated. This mode is default for local builds. Note that if you
want to redistribute the binary toolchain built with this mode, you
should:
1. Make it clear to your users that the release is bound to a
particular vendor IoT SDK and provide instructions how to upgrade
to a newer vendor IoT SDK releases.
2. Abide by licensing terms of the vendor IoT SDK.
To build the separated SDK:
```
$ make STANDALONE=n
```
To build the standalone SDK:
```
$ make STANDALONE=y
```
This will download all necessary components and compile them. Once done,
the toolchain (with the Xtensa HAL library) will be available in the
`xtensa-lx106-elf/` directory. Add its `bin/` subdirectory to your
`$PATH` to execute `xtensa-lx106-elf-gcc` and other tools.
ESP8266 SDK will be installed in `sdk/`. If you chose the non-standalone
SDK, run the compiler with the corresponding include and lib dir flags:
```
$ xtensa-lx106-elf-gcc -I$(THISDIR)/sdk/include -L$(THISDIR)/sdk/lib
```
The extra -I and -L flags are not needed when using the standalone SDK.
Pulling updates
===============
The project is updated from time to time, to get updates and prepare to
build a new SDK, run:
```
$ make clean
$ git pull
$ git submodule update
```
If you don't issue `make clean` (which causes toolchain and SDK to be
rebuilt from scratch on next `make`), you risk getting broken/inconsistent
results.
Additional configuration
========================
You can build a statically linked toolchain by uncommenting
`CT_STATIC_TOOLCHAIN=y` in the file `crosstool-config-overrides`. More
fine-tunable options may be available in that file and/or Makefile.

View file

@ -1,37 +0,0 @@
This patch fixes vendor SDK header "c_types.h" for C99 compatibility.
diff -ur esp_iot_sdk_v0.9.4.org/include/c_types.h esp_iot_sdk_v0.9.4/include/c_types.h
--- esp_iot_sdk_v0.9.4.org/include/c_types.h 2014-12-19 18:07:46.000000000 +0200
+++ esp_iot_sdk_v0.9.4/include/c_types.h 2015-01-17 19:43:49.258975759 +0200
@@ -6,6 +6,9 @@
#ifndef _C_TYPES_H_
#define _C_TYPES_H_
+#include <stdint.h>
+#include <stdbool.h>
+#if 0
typedef unsigned char uint8_t;
typedef signed char sint8_t;
typedef signed char int8_t;
@@ -20,6 +23,7 @@
typedef unsigned long long u_int64_t;
typedef float real32_t;
typedef double real64_t;
+#endif
typedef unsigned char uint8;
typedef unsigned char u8;
@@ -78,10 +82,10 @@
#endif /* ICACHE_FLASH */
#ifndef __cplusplus
-typedef unsigned char bool;
+//typedef unsigned char bool;
#define BOOL bool
-#define true (1)
-#define false (0)
+//#define true (1)
+//#define false (0)
#define TRUE true
#define FALSE false

View file

@ -1,5 +1,3 @@
# Building static toolchain causes problems on some distros which
# by default don't install static libs for all required dependencies
#CT_STATIC_TOOLCHAIN=y
CT_STATIC_TOOLCHAIN=y
CT_LIBC_NEWLIB_ENABLE_TARGET_OPTSPACE=y

@ -1 +1 @@
Subproject commit 12debb7bfe5e978060ff1919bf87d00ed52c4a72
Subproject commit 4ee65c63ea2761ffcc8073e8122792981d742d37

@ -1 +1 @@
Subproject commit ecdc98953f2fc5058a79168528387cd14b287636
Subproject commit 90cdf910a8431675b6814ba447550edca3a78d4c