From f25557b9cf91b23cb13824fc0461a828a7fedddf Mon Sep 17 00:00:00 2001 From: Jeroen Domburg Date: Tue, 17 Feb 2015 11:57:51 +0100 Subject: [PATCH] Made everything a bit more friendly. Esp-open-sdk nowadays is the toolchain builder of choice anyway; it now works without modifications to that. --- Makefile | 11 ++++++----- README | 19 +++++++++---------- include/espmissingincludes.h | 3 ++- include/stdint.h | 8 -------- user/heatshrink_decoder.c | 1 - 5 files changed, 17 insertions(+), 25 deletions(-) delete mode 100644 include/stdint.h diff --git a/Makefile b/Makefile index 564b82f..7fac6b4 100644 --- a/Makefile +++ b/Makefile @@ -11,8 +11,9 @@ BUILD_BASE = build FW_BASE = firmware -# Base directory for the compiler -XTENSA_TOOLS_ROOT ?= /opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf/bin +# Base directory for the compiler. Needs a / at the end; if not set it'll use the tools that are in +# the PATH. +XTENSA_TOOLS_ROOT ?= #Extra Tensilica includes from the ESS VM SDK_EXTRA_INCLUDES ?= /opt/Espressif/include @@ -66,9 +67,9 @@ FW_FILE_2 = 0x40000 FW_FILE_2_ARGS = -es .irom0.text $@ -ec # select which tools to use as compiler, librarian and linker -CC := $(XTENSA_TOOLS_ROOT)/xtensa-lx106-elf-gcc -AR := $(XTENSA_TOOLS_ROOT)/xtensa-lx106-elf-ar -LD := $(XTENSA_TOOLS_ROOT)/xtensa-lx106-elf-gcc +CC := $(XTENSA_TOOLS_ROOT)xtensa-lx106-elf-gcc +AR := $(XTENSA_TOOLS_ROOT)xtensa-lx106-elf-ar +LD := $(XTENSA_TOOLS_ROOT)xtensa-lx106-elf-gcc diff --git a/README b/README index 920346a..bf7c9fc 100644 --- a/README +++ b/README @@ -34,20 +34,19 @@ allows you to control a LED that's connected to GPIO2. BUILDING EVERYTHING For this, you need an environment that can compile ESP8266 firmware. Environments for this still -are in flux at the moment, but I'm using a crosstool-ng gcc setup combined with the libs & includes -from the ESP SDK and ESP VM. You probably also need an UNIX-like system; I'm working on -Debian Linux myself. +are in flux at the moment, but I'm using esp-open-sdk: https://github.com/pfalcon/esp-open-sdk . +You probably also need an UNIX-like system; I'm working on Debian Linux myself. To manage the paths to all this, you can source a small shell fragment into your current session. For example, I source a file with these contents: -export PATH=${PWD}/crosstool-NG/builds/xtensa-lx106-elf/bin:$PATH -export XTENSA_TOOLS_ROOT=${PWD}/crosstool-NG/builds/xtensa-lx106-elf/bin -export SDK_BASE=${PWD}/esp_iot_sdk_v0.9.5/ -export SDK_EXTRA_INCLUDES=${PWD}/esp_iot_sdk_novm_unpacked/usr/xtensa/XtDevTools/install/builds/RC-2010.1-win32/lx106/xtensa-elf/include/ -export ESPTOOL=${PWD}/esptool/esptool.py +export PATH=${PWD}/esp-open-sdk/xtensa-lx106-elf/bin:$PATH +export SDK_BASE=${PWD}/esp-open-sdk/sdk +export ESPTOOL=${PWD}/esptool/esptool export ESPPORT=/dev/ttyUSB0 +export ESPBAUD=460800 + Actual setup of the SDK and toolchain is out of the scope of this document, so I hope this helps you -enough to set up your own if you haven't already. +enough to set up your own if you haven't already. If you have that, you can clone out the source code: git clone http://git.spritesserver.nl/esphttpd.git/ @@ -75,7 +74,7 @@ WRITING CODE FOR THE WEBSERVER the SDK works, this shouldn't be too hard :P -CHANGE FROM SDK 0.9.3 (and earlier) TO SDK 0.9.4: +CHANGE FROM SDK 0.9.3 (and earlier) TO SDK 0.9.4 (and later): Change all occurences of espconn_sent(connData->conn, (uint8 *)buff, len); to diff --git a/include/espmissingincludes.h b/include/espmissingincludes.h index 0fff213..8c1334e 100644 --- a/include/espmissingincludes.h +++ b/include/espmissingincludes.h @@ -1,8 +1,9 @@ #ifndef ESPMISSINGINCLUDES_H #define ESPMISSINGINCLUDES_H -#include #include +#include +#include //Missing function prototypes in include folders. Gcc will warn on these if we don't define 'em anywhere. //MOST OF THESE ARE GUESSED! but they seem to swork and shut up the compiler. diff --git a/include/stdint.h b/include/stdint.h deleted file mode 100644 index 02723c6..0000000 --- a/include/stdint.h +++ /dev/null @@ -1,8 +0,0 @@ - -//Including the system-wide stdint.h messes stuff up... but I don't want to change heatshrink -//not to do it. Including this dummy file fixes it too, tho'. - -#ifndef __ets__ -//Do include stdint for testing builds. -#include_next -#endif \ No newline at end of file diff --git a/user/heatshrink_decoder.c b/user/heatshrink_decoder.c index 51e0852..6685652 100644 --- a/user/heatshrink_decoder.c +++ b/user/heatshrink_decoder.c @@ -6,7 +6,6 @@ #define _STDLIB_H_ #define _STRING_H_ #define _STDDEF_H -#define _STDINT_H #include "espmissingincludes.h" #include "c_types.h"