Made everything a bit more friendly. Esp-open-sdk nowadays is the toolchain builder of choice anyway; it now works without modifications to that.

pull/30/head
Jeroen Domburg 10 years ago
parent da4d120b0c
commit f25557b9cf
  1. 11
      Makefile
  2. 17
      README
  3. 3
      include/espmissingincludes.h
  4. 8
      include/stdint.h
  5. 1
      user/heatshrink_decoder.c

@ -11,8 +11,9 @@
BUILD_BASE = build BUILD_BASE = build
FW_BASE = firmware FW_BASE = firmware
# Base directory for the compiler # Base directory for the compiler. Needs a / at the end; if not set it'll use the tools that are in
XTENSA_TOOLS_ROOT ?= /opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf/bin # the PATH.
XTENSA_TOOLS_ROOT ?=
#Extra Tensilica includes from the ESS VM #Extra Tensilica includes from the ESS VM
SDK_EXTRA_INCLUDES ?= /opt/Espressif/include SDK_EXTRA_INCLUDES ?= /opt/Espressif/include
@ -66,9 +67,9 @@ FW_FILE_2 = 0x40000
FW_FILE_2_ARGS = -es .irom0.text $@ -ec FW_FILE_2_ARGS = -es .irom0.text $@ -ec
# select which tools to use as compiler, librarian and linker # select which tools to use as compiler, librarian and linker
CC := $(XTENSA_TOOLS_ROOT)/xtensa-lx106-elf-gcc CC := $(XTENSA_TOOLS_ROOT)xtensa-lx106-elf-gcc
AR := $(XTENSA_TOOLS_ROOT)/xtensa-lx106-elf-ar AR := $(XTENSA_TOOLS_ROOT)xtensa-lx106-elf-ar
LD := $(XTENSA_TOOLS_ROOT)/xtensa-lx106-elf-gcc LD := $(XTENSA_TOOLS_ROOT)xtensa-lx106-elf-gcc

@ -34,18 +34,17 @@ allows you to control a LED that's connected to GPIO2.
BUILDING EVERYTHING BUILDING EVERYTHING
For this, you need an environment that can compile ESP8266 firmware. Environments for this still 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 are in flux at the moment, but I'm using esp-open-sdk: https://github.com/pfalcon/esp-open-sdk .
from the ESP SDK and ESP VM. You probably also need an UNIX-like system; I'm working on You probably also need an UNIX-like system; I'm working on Debian Linux myself.
Debian Linux myself.
To manage the paths to all this, you can source a small shell fragment into your current session. For 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: example, I source a file with these contents:
export PATH=${PWD}/crosstool-NG/builds/xtensa-lx106-elf/bin:$PATH export PATH=${PWD}/esp-open-sdk/xtensa-lx106-elf/bin:$PATH
export XTENSA_TOOLS_ROOT=${PWD}/crosstool-NG/builds/xtensa-lx106-elf/bin export SDK_BASE=${PWD}/esp-open-sdk/sdk
export SDK_BASE=${PWD}/esp_iot_sdk_v0.9.5/ export ESPTOOL=${PWD}/esptool/esptool
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 ESPPORT=/dev/ttyUSB0 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 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.
@ -75,7 +74,7 @@ WRITING CODE FOR THE WEBSERVER
the SDK works, this shouldn't be too hard :P 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 Change all occurences of
espconn_sent(connData->conn, (uint8 *)buff, len); espconn_sent(connData->conn, (uint8 *)buff, len);
to to

@ -1,8 +1,9 @@
#ifndef ESPMISSINGINCLUDES_H #ifndef ESPMISSINGINCLUDES_H
#define ESPMISSINGINCLUDES_H #define ESPMISSINGINCLUDES_H
#include <ets_sys.h>
#include <stdint.h> #include <stdint.h>
#include <c_types.h>
#include <ets_sys.h>
//Missing function prototypes in include folders. Gcc will warn on these if we don't define 'em anywhere. //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. //MOST OF THESE ARE GUESSED! but they seem to swork and shut up the compiler.

@ -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 <stdint.h>
#endif

@ -6,7 +6,6 @@
#define _STDLIB_H_ #define _STDLIB_H_
#define _STRING_H_ #define _STRING_H_
#define _STDDEF_H #define _STDDEF_H
#define _STDINT_H
#include "espmissingincludes.h" #include "espmissingincludes.h"
#include "c_types.h" #include "c_types.h"

Loading…
Cancel
Save