Compare commits
60 commits
lwip-heade
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| cd8dd08b30 | |||
|
|
5518fb6116 | ||
|
|
4ea62358c9 | ||
|
|
11ca71d47d | ||
|
|
11a7e7e57f | ||
|
|
350c0e9174 | ||
|
|
f2031692d8 | ||
|
|
bf5eb90f34 | ||
|
|
c416ce38f8 | ||
|
|
b069537944 | ||
|
|
12cb4b142e | ||
|
|
b4ca4e59a8 | ||
|
|
b1929e33f4 | ||
|
|
e8d757b1a7 | ||
|
|
24f10eb164 | ||
|
|
3701f042ed | ||
|
|
5caadc5428 | ||
|
|
89ecaadb99 | ||
|
|
2d7d170698 | ||
|
|
d18f815c8d | ||
|
|
b10756d25a | ||
|
|
e95cd3ae22 | ||
|
|
9dac80583d | ||
|
|
e629109c76 | ||
|
|
c1974f7551 | ||
|
|
03f5e898a0 | ||
|
|
9b1dba19f4 | ||
|
|
485f53368b | ||
|
|
0ea6a4ea10 | ||
|
|
8f9f0eb969 | ||
|
|
62bda07d7c | ||
|
|
90eb4a8d83 | ||
|
|
6cc801e9c3 | ||
|
|
ff88978708 | ||
|
|
875e9d6483 | ||
|
|
7625d2e270 | ||
|
|
9edd758891 | ||
|
|
8297c7c515 | ||
|
|
1e7888b26f | ||
|
|
a48b12fd71 | ||
|
|
0cf36c05b2 | ||
|
|
a1f1e10bc2 | ||
|
|
cab39f4c48 | ||
|
|
0d69c85350 | ||
|
|
9bd3aba51c | ||
|
|
40e6883285 | ||
|
|
63ad1888ac | ||
|
|
e42da92b05 | ||
|
|
cfe15bd826 | ||
|
|
f4c8cb9e70 | ||
|
|
d0d9997ec5 | ||
|
|
d7c9889cbb | ||
|
|
e33c0ad3be | ||
|
|
d86df3497f | ||
|
|
ee9b6a231b | ||
|
|
7235b03ebd | ||
|
|
55d6be74ff | ||
|
|
a890758ed8 | ||
|
|
9820cf981e | ||
|
|
511ff3c290 |
13 changed files with 495 additions and 48 deletions
6
.gitmodules
vendored
6
.gitmodules
vendored
|
|
@ -1,14 +1,14 @@
|
||||||
[submodule "crosstool-NG"]
|
[submodule "crosstool-NG"]
|
||||||
path = crosstool-NG
|
path = crosstool-NG
|
||||||
url = https://github.com/jcmvbkbc/crosstool-NG
|
url = https://github.com/jcmvbkbc/crosstool-NG
|
||||||
branch = lx106-g++
|
branch = xtensa-1.22.x
|
||||||
[submodule "lx106-hal"]
|
[submodule "lx106-hal"]
|
||||||
path = lx106-hal
|
path = lx106-hal
|
||||||
url = https://github.com/tommie/lx106-hal
|
url = https://github.com/tommie/lx106-hal
|
||||||
[submodule "esptool"]
|
[submodule "esptool"]
|
||||||
path = esptool
|
path = esptool
|
||||||
url = https://github.com/pfalcon/esptool
|
url = https://github.com/themadinventor/esptool
|
||||||
[submodule "esp-open-lwip"]
|
[submodule "esp-open-lwip"]
|
||||||
path = esp-open-lwip
|
path = esp-open-lwip
|
||||||
url = https://github.com/pfalcon/esp-open-lwip
|
url = https://github.com/pfalcon/esp-open-lwip
|
||||||
branch = sdk-1.5.0
|
branch = sdk-1.5.0-experimental
|
||||||
|
|
|
||||||
48
.travis.yml
Normal file
48
.travis.yml
Normal file
|
|
@ -0,0 +1,48 @@
|
||||||
|
dist: trusty
|
||||||
|
language: bash
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- "${HOME}/persist"
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- make
|
||||||
|
- unrar-free
|
||||||
|
- autoconf
|
||||||
|
- automake
|
||||||
|
- libtool
|
||||||
|
- gcc
|
||||||
|
- g++
|
||||||
|
- gperf
|
||||||
|
- flex
|
||||||
|
- bison
|
||||||
|
- texinfo
|
||||||
|
- gawk
|
||||||
|
- ncurses-dev
|
||||||
|
- libexpat-dev
|
||||||
|
- python-dev
|
||||||
|
- python
|
||||||
|
- python-serial
|
||||||
|
- sed
|
||||||
|
- git
|
||||||
|
- unzip
|
||||||
|
- bash
|
||||||
|
- help2man
|
||||||
|
- wget
|
||||||
|
- bzip2
|
||||||
|
script:
|
||||||
|
- make toolchain
|
||||||
|
- ls -l xtensa-lx106-elf/bin/
|
||||||
|
- make STANDALONE=y
|
||||||
|
after_success:
|
||||||
|
- mkdir -p dist
|
||||||
|
- tar cavf dist/xtensa-lx106-elf-standalone.tar.gz xtensa-lx106-elf
|
||||||
|
deploy:
|
||||||
|
provider: releases
|
||||||
|
api_key:
|
||||||
|
secure: fw5W0SFdMtP+rTlRRMEGHhWgbN3DrOfBjXK1OblRsiotUeMxesjKBb0DflMfxT3+hqpNm7qj4l4BZ/M755dnZEE64wCCah8p8CXP0yRl5KpH27Nkfg1vLmWDkZgcSqd3UIv6GMfgZlXolWpXhPYmv/ZR0JuMJBhpkMgJs1aRDHabM34477HuOvuOujm7lbnC1+EWDvyrsK/7OL5PzDLD8f3F7G/3JI1MwpHxpof6vsDK1ao6t/TYfcy+wRQVLgda2m6xz5IERly1rAwuoQII5n9q+p0+XVuPUFKW6YKZdGFo2zIlv++JuU96uLImXAZXI5TTpVS7xckW1ODCUNPNKPww+lW4TThfnB0b6OoNcACDbQV4CbI17zQNN9Qxb3cKKbBVEhKmc1Q31ajzTQfsaXkmuoj+EWAOM6/vwQgkNfBwYQ7e2reYc3+i+IAthdbYRs1ia3yWYLPomrr1DFNyoSHnGB0IKkynfe66n4oCX9F5BMsKIAh7r0YTBjO7O7DSBqS2SsQI5twiNgU5KtXBlPfTwoH5lmydBW5DInNAr+SOXRQKJvpqVbXDxffagYxgejB+QTeTNi2IH62xeWIx2aK/9lKA2fWwoj/WcJ/X1ZP4ZdUNNnOtdgrI1MIrj85b+bgW0cuE1AdLHn9Do74OKDiG0w6LrhvTFirHOCEIo3g=
|
||||||
|
file: dist/xtensa-lx106-elf-standalone.tar.gz
|
||||||
|
skip_cleanup: true
|
||||||
|
on:
|
||||||
|
repo: jepler/esp-open-sdk
|
||||||
|
tags: true
|
||||||
253
1000-mforce-l32.patch
Normal file
253
1000-mforce-l32.patch
Normal file
|
|
@ -0,0 +1,253 @@
|
||||||
|
https://github.com/jcmvbkbc/gcc-xtensa/commit/6b0c9f92fb8e11c6be098febb4f502f6af37cd35.patch
|
||||||
|
|
||||||
|
From 6b0c9f92fb8e11c6be098febb4f502f6af37cd35 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Max Filippov <jcmvbkbc@gmail.com>
|
||||||
|
Date: Thu, 11 Jun 2015 17:56:57 +0300
|
||||||
|
Subject: [PATCH] WIP: xtensa: add -mforce-l32
|
||||||
|
|
||||||
|
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
|
||||||
|
---
|
||||||
|
gcc/config/xtensa/constraints.md | 15 ++++++++++++
|
||||||
|
gcc/config/xtensa/xtensa.c | 53 +++++++++++++++++++++++++++++++++++++++-
|
||||||
|
gcc/config/xtensa/xtensa.md | 49 ++++++++++++++++++++-----------------
|
||||||
|
gcc/config/xtensa/xtensa.opt | 4 +++
|
||||||
|
4 files changed, 98 insertions(+), 23 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/gcc/config/xtensa/constraints.md b/gcc/config/xtensa/constraints.md
|
||||||
|
index 30f4c1f..5fd9337 100644
|
||||||
|
--- a/gcc/config/xtensa/constraints.md
|
||||||
|
+++ b/gcc/config/xtensa/constraints.md
|
||||||
|
@@ -137,3 +137,18 @@
|
||||||
|
(and (match_code "reg")
|
||||||
|
(match_test "reload_in_progress
|
||||||
|
&& REGNO (op) >= FIRST_PSEUDO_REGISTER"))))
|
||||||
|
+
|
||||||
|
+(define_constraint "Y"
|
||||||
|
+ "Memory that is not in a literal pool."
|
||||||
|
+ (ior (and (and (match_code "mem")
|
||||||
|
+ (match_test "! constantpool_mem_p (op)"))
|
||||||
|
+ (match_test "!TARGET_FORCE_L32"))
|
||||||
|
+ (and (match_code "reg")
|
||||||
|
+ (match_test "reload_in_progress
|
||||||
|
+ && REGNO (op) >= FIRST_PSEUDO_REGISTER"))))
|
||||||
|
+
|
||||||
|
+(define_constraint "Z"
|
||||||
|
+ "Memory that is not in a literal pool."
|
||||||
|
+ (and (and (match_code "mem")
|
||||||
|
+ (match_test "! constantpool_mem_p (op)"))
|
||||||
|
+ (match_test "TARGET_FORCE_L32")))
|
||||||
|
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
|
||||||
|
index d8c5b41..559b181 100644
|
||||||
|
--- a/gcc/config/xtensa/xtensa.c
|
||||||
|
+++ b/gcc/config/xtensa/xtensa.c
|
||||||
|
@@ -1824,7 +1824,8 @@ xtensa_legitimate_address_p (machine_mode mode, rtx addr, bool strict)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
/* Check for "register + offset" addressing. */
|
||||||
|
- if (GET_CODE (addr) == PLUS)
|
||||||
|
+ if (GET_CODE (addr) == PLUS &&
|
||||||
|
+ (!TARGET_FORCE_L32 || (mode != HImode && mode != QImode)))
|
||||||
|
{
|
||||||
|
rtx xplus0 = XEXP (addr, 0);
|
||||||
|
rtx xplus1 = XEXP (addr, 1);
|
||||||
|
@@ -2308,6 +2309,8 @@ printx (FILE *file, signed int val)
|
||||||
|
fprintf (file, "0x%x", val);
|
||||||
|
}
|
||||||
|
|
||||||
|
+static void
|
||||||
|
+output_address_base (FILE *file, rtx addr);
|
||||||
|
|
||||||
|
void
|
||||||
|
print_operand (FILE *file, rtx x, int letter)
|
||||||
|
@@ -2317,6 +2320,13 @@ print_operand (FILE *file, rtx x, int letter)
|
||||||
|
|
||||||
|
switch (letter)
|
||||||
|
{
|
||||||
|
+ case 'B':
|
||||||
|
+ if (GET_CODE (x) == MEM)
|
||||||
|
+ output_address_base (file, XEXP (x, 0));
|
||||||
|
+ else
|
||||||
|
+ output_operand_lossage ("invalid %%B value");
|
||||||
|
+ break;
|
||||||
|
+
|
||||||
|
case 'D':
|
||||||
|
if (GET_CODE (x) == REG || GET_CODE (x) == SUBREG)
|
||||||
|
fprintf (file, "%s", reg_names[xt_true_regnum (x) + 1]);
|
||||||
|
@@ -2450,6 +2460,47 @@ print_operand (FILE *file, rtx x, int letter)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+static void
|
||||||
|
+output_address_base (FILE *file, rtx addr)
|
||||||
|
+{
|
||||||
|
+ switch (GET_CODE (addr))
|
||||||
|
+ {
|
||||||
|
+ default:
|
||||||
|
+ fatal_insn ("invalid address", addr);
|
||||||
|
+ break;
|
||||||
|
+
|
||||||
|
+ case REG:
|
||||||
|
+ fprintf (file, "%s", reg_names [REGNO (addr)]);
|
||||||
|
+ break;
|
||||||
|
+
|
||||||
|
+ case PLUS:
|
||||||
|
+ {
|
||||||
|
+ rtx reg = (rtx)0;
|
||||||
|
+ rtx offset = (rtx)0;
|
||||||
|
+ rtx arg0 = XEXP (addr, 0);
|
||||||
|
+ rtx arg1 = XEXP (addr, 1);
|
||||||
|
+
|
||||||
|
+ if (GET_CODE (arg0) == REG)
|
||||||
|
+ {
|
||||||
|
+ reg = arg0;
|
||||||
|
+ offset = arg1;
|
||||||
|
+ }
|
||||||
|
+ else if (GET_CODE (arg1) == REG)
|
||||||
|
+ {
|
||||||
|
+ reg = arg1;
|
||||||
|
+ offset = arg0;
|
||||||
|
+ }
|
||||||
|
+ else
|
||||||
|
+ fatal_insn ("no register in address", addr);
|
||||||
|
+
|
||||||
|
+ if (CONSTANT_P (offset))
|
||||||
|
+ fprintf (file, "%s", reg_names [REGNO (reg)]);
|
||||||
|
+ else
|
||||||
|
+ fatal_insn ("address offset not a constant", addr);
|
||||||
|
+ }
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
|
||||||
|
/* A C compound statement to output to stdio stream STREAM the
|
||||||
|
assembler syntax for an instruction operand that is a memory
|
||||||
|
diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md
|
||||||
|
index a577aa3..f56c45e 100644
|
||||||
|
--- a/gcc/config/xtensa/xtensa.md
|
||||||
|
+++ b/gcc/config/xtensa/xtensa.md
|
||||||
|
@@ -532,26 +532,28 @@
|
||||||
|
;; Zero-extend instructions.
|
||||||
|
|
||||||
|
(define_insn "zero_extendhisi2"
|
||||||
|
- [(set (match_operand:SI 0 "register_operand" "=a,a")
|
||||||
|
- (zero_extend:SI (match_operand:HI 1 "nonimmed_operand" "r,U")))]
|
||||||
|
+ [(set (match_operand:SI 0 "register_operand" "=a,a,a")
|
||||||
|
+ (zero_extend:SI (match_operand:HI 1 "nonimmed_operand" "r,Y,Z")))]
|
||||||
|
""
|
||||||
|
"@
|
||||||
|
extui\t%0, %1, 0, 16
|
||||||
|
- l16ui\t%0, %1"
|
||||||
|
- [(set_attr "type" "arith,load")
|
||||||
|
+ l16ui\t%0, %1
|
||||||
|
+ ssa8l\t%B1 ; srli\t%0, %B1, 2 ; slli\t%0, %0, 2 ; l32i\t%0, %0, 0 ; srl\t%0, %0 ; extui\t%0, %0, 0, 16"
|
||||||
|
+ [(set_attr "type" "arith,load,load")
|
||||||
|
(set_attr "mode" "SI")
|
||||||
|
- (set_attr "length" "3,3")])
|
||||||
|
+ (set_attr "length" "3,3,18")])
|
||||||
|
|
||||||
|
(define_insn "zero_extendqisi2"
|
||||||
|
- [(set (match_operand:SI 0 "register_operand" "=a,a")
|
||||||
|
- (zero_extend:SI (match_operand:QI 1 "nonimmed_operand" "r,U")))]
|
||||||
|
+ [(set (match_operand:SI 0 "register_operand" "=a,a,a")
|
||||||
|
+ (zero_extend:SI (match_operand:QI 1 "nonimmed_operand" "r,Y,Z")))]
|
||||||
|
""
|
||||||
|
"@
|
||||||
|
extui\t%0, %1, 0, 8
|
||||||
|
- l8ui\t%0, %1"
|
||||||
|
- [(set_attr "type" "arith,load")
|
||||||
|
+ l8ui\t%0, %1
|
||||||
|
+ ssa8l\t%B1 ; srli\t%0, %B1, 2 ; slli\t%0, %0, 2 ; l32i\t%0, %0, 0 ; srl\t%0, %0 ; extui\t%0, %0, 0, 8"
|
||||||
|
+ [(set_attr "type" "arith,load,load")
|
||||||
|
(set_attr "mode" "SI")
|
||||||
|
- (set_attr "length" "3,3")])
|
||||||
|
+ (set_attr "length" "3,3,18")])
|
||||||
|
|
||||||
|
|
||||||
|
;; Sign-extend instructions.
|
||||||
|
@@ -569,15 +571,16 @@
|
||||||
|
})
|
||||||
|
|
||||||
|
(define_insn "extendhisi2_internal"
|
||||||
|
- [(set (match_operand:SI 0 "register_operand" "=B,a")
|
||||||
|
- (sign_extend:SI (match_operand:HI 1 "sext_operand" "r,U")))]
|
||||||
|
+ [(set (match_operand:SI 0 "register_operand" "=B,a,a")
|
||||||
|
+ (sign_extend:SI (match_operand:HI 1 "sext_operand" "r,r,Y")))]
|
||||||
|
""
|
||||||
|
"@
|
||||||
|
sext\t%0, %1, 15
|
||||||
|
+ slli\t%0, %1, 16 ; srai\t%0, %0, 16
|
||||||
|
l16si\t%0, %1"
|
||||||
|
- [(set_attr "type" "arith,load")
|
||||||
|
+ [(set_attr "type" "arith,arith,load")
|
||||||
|
(set_attr "mode" "SI")
|
||||||
|
- (set_attr "length" "3,3")])
|
||||||
|
+ (set_attr "length" "3,6,3")])
|
||||||
|
|
||||||
|
(define_expand "extendqisi2"
|
||||||
|
[(set (match_operand:SI 0 "register_operand" "")
|
||||||
|
@@ -796,8 +799,8 @@
|
||||||
|
})
|
||||||
|
|
||||||
|
(define_insn "movhi_internal"
|
||||||
|
- [(set (match_operand:HI 0 "nonimmed_operand" "=D,D,a,a,a,U,*a,*A")
|
||||||
|
- (match_operand:HI 1 "move_operand" "M,d,r,I,U,r,*A,*r"))]
|
||||||
|
+ [(set (match_operand:HI 0 "nonimmed_operand" "=D,D,a,a,a,a,U,*a,*A")
|
||||||
|
+ (match_operand:HI 1 "move_operand" "M,d,r,I,Y,Z,r,*A,*r"))]
|
||||||
|
"xtensa_valid_move (HImode, operands)"
|
||||||
|
"@
|
||||||
|
movi.n\t%0, %x1
|
||||||
|
@@ -805,12 +808,13 @@
|
||||||
|
mov\t%0, %1
|
||||||
|
movi\t%0, %x1
|
||||||
|
%v1l16ui\t%0, %1
|
||||||
|
+ ssa8l\t%B1 ; srli\t%0, %B1, 2 ; slli\t%0, %0, 2 ; %v1l32i\t%0, %0, 0 ; srl\t%0, %0 ; extui\t%0, %0, 0, 16
|
||||||
|
%v0s16i\t%1, %0
|
||||||
|
rsr\t%0, ACCLO
|
||||||
|
wsr\t%1, ACCLO"
|
||||||
|
- [(set_attr "type" "move,move,move,move,load,store,rsr,wsr")
|
||||||
|
+ [(set_attr "type" "move,move,move,move,load,load,store,rsr,wsr")
|
||||||
|
(set_attr "mode" "HI")
|
||||||
|
- (set_attr "length" "2,2,3,3,3,3,3,3")])
|
||||||
|
+ (set_attr "length" "2,2,3,3,3,18,3,3,3")])
|
||||||
|
|
||||||
|
;; 8-bit Integer moves
|
||||||
|
|
||||||
|
@@ -824,8 +828,8 @@
|
||||||
|
})
|
||||||
|
|
||||||
|
(define_insn "movqi_internal"
|
||||||
|
- [(set (match_operand:QI 0 "nonimmed_operand" "=D,D,a,a,a,U,*a,*A")
|
||||||
|
- (match_operand:QI 1 "move_operand" "M,d,r,I,U,r,*A,*r"))]
|
||||||
|
+ [(set (match_operand:QI 0 "nonimmed_operand" "=D,D,a,a,a,a,U,*a,*A")
|
||||||
|
+ (match_operand:QI 1 "move_operand" "M,d,r,I,Y,Z,r,*A,*r"))]
|
||||||
|
"xtensa_valid_move (QImode, operands)"
|
||||||
|
"@
|
||||||
|
movi.n\t%0, %x1
|
||||||
|
@@ -833,12 +837,13 @@
|
||||||
|
mov\t%0, %1
|
||||||
|
movi\t%0, %x1
|
||||||
|
%v1l8ui\t%0, %1
|
||||||
|
+ ssa8l\t%B1 ; srli\t%0, %B1, 2 ; slli\t%0, %0, 2 ; %v1l32i\t%0, %0, 0 ; srl\t%0, %0 ; extui\t%0, %0, 0, 8
|
||||||
|
%v0s8i\t%1, %0
|
||||||
|
rsr\t%0, ACCLO
|
||||||
|
wsr\t%1, ACCLO"
|
||||||
|
- [(set_attr "type" "move,move,move,move,load,store,rsr,wsr")
|
||||||
|
+ [(set_attr "type" "move,move,move,move,load,load,store,rsr,wsr")
|
||||||
|
(set_attr "mode" "QI")
|
||||||
|
- (set_attr "length" "2,2,3,3,3,3,3,3")])
|
||||||
|
+ (set_attr "length" "2,2,3,3,3,18,3,3,3")])
|
||||||
|
|
||||||
|
;; Sub-word reloads from the constant pool.
|
||||||
|
|
||||||
|
diff --git a/gcc/config/xtensa/xtensa.opt b/gcc/config/xtensa/xtensa.opt
|
||||||
|
index 2fd6cee..02020d2 100644
|
||||||
|
--- a/gcc/config/xtensa/xtensa.opt
|
||||||
|
+++ b/gcc/config/xtensa/xtensa.opt
|
||||||
|
@@ -41,3 +41,7 @@ Intersperse literal pools with code in the text section
|
||||||
|
mserialize-volatile
|
||||||
|
Target Report Mask(SERIALIZE_VOLATILE)
|
||||||
|
-mno-serialize-volatile Do not serialize volatile memory references with MEMW instructions
|
||||||
|
+
|
||||||
|
+mforce-l32
|
||||||
|
+Target Report Mask(FORCE_L32)
|
||||||
|
+Use l32i to access 1- and 2-byte quantities in memory instead of l8ui/l16ui
|
||||||
145
Makefile
145
Makefile
|
|
@ -10,18 +10,28 @@ TOOLCHAIN = $(TOP)/xtensa-lx106-elf
|
||||||
|
|
||||||
# Vendor SDK version to install, see VENDOR_SDK_ZIP_* vars below
|
# Vendor SDK version to install, see VENDOR_SDK_ZIP_* vars below
|
||||||
# for supported versions.
|
# for supported versions.
|
||||||
VENDOR_SDK = 1.5.2
|
VENDOR_SDK = 2.1.0-18-g61248df
|
||||||
|
|
||||||
.PHONY: crosstool-NG toolchain libhal libcirom sdk
|
.PHONY: crosstool-NG toolchain libhal libcirom sdk
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TOP = $(PWD)
|
TOP = $(PWD)
|
||||||
|
SHELL = /bin/bash
|
||||||
PATCH = patch -b -N
|
PATCH = patch -b -N
|
||||||
UNZIP = unzip -q -o
|
UNZIP = unzip -q -o
|
||||||
VENDOR_SDK_ZIP = $(VENDOR_SDK_ZIP_$(VENDOR_SDK))
|
VENDOR_SDK_ZIP = $(VENDOR_SDK_ZIP_$(VENDOR_SDK))
|
||||||
VENDOR_SDK_DIR = $(VENDOR_SDK_DIR_$(VENDOR_SDK))
|
VENDOR_SDK_DIR = $(VENDOR_SDK_DIR_$(VENDOR_SDK))
|
||||||
|
|
||||||
|
VENDOR_SDK_DIR_2.1.0-18-g61248df = ESP8266_NONOS_SDK-2.1.0-18-g61248df
|
||||||
|
VENDOR_SDK_ZIP_2.1.0 = ESP8266_NONOS_SDK-2.1.0.zip
|
||||||
|
VENDOR_SDK_DIR_2.1.0 = ESP8266_NONOS_SDK-2.1.0
|
||||||
|
VENDOR_SDK_ZIP_2.0.0 = ESP8266_NONOS_SDK_V2.0.0_16_08_10.zip
|
||||||
|
VENDOR_SDK_DIR_2.0.0 = ESP8266_NONOS_SDK_V2.0.0_16_08_10
|
||||||
|
VENDOR_SDK_ZIP_1.5.4 = ESP8266_NONOS_SDK_V1.5.4_16_05_20.zip
|
||||||
|
VENDOR_SDK_DIR_1.5.4 = ESP8266_NONOS_SDK_V1.5.4_16_05_20
|
||||||
|
VENDOR_SDK_ZIP_1.5.3 = ESP8266_NONOS_SDK_V1.5.3_16_04_18.zip
|
||||||
|
VENDOR_SDK_DIR_1.5.3 = ESP8266_NONOS_SDK_V1.5.3_16_04_18/ESP8266_NONOS_SDK
|
||||||
VENDOR_SDK_ZIP_1.5.2 = ESP8266_NONOS_SDK_V1.5.2_16_01_29.zip
|
VENDOR_SDK_ZIP_1.5.2 = ESP8266_NONOS_SDK_V1.5.2_16_01_29.zip
|
||||||
VENDOR_SDK_DIR_1.5.2 = esp_iot_sdk_v1.5.2
|
VENDOR_SDK_DIR_1.5.2 = esp_iot_sdk_v1.5.2
|
||||||
VENDOR_SDK_ZIP_1.5.1 = ESP8266_NONOS_SDK_V1.5.1_16_01_08.zip
|
VENDOR_SDK_ZIP_1.5.1 = ESP8266_NONOS_SDK_V1.5.1_16_01_08.zip
|
||||||
|
|
@ -93,10 +103,21 @@ ifeq ($(STANDALONE),y)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
clean: clean-sdk
|
clean: clean-sdk
|
||||||
make -C crosstool-NG clean MAKELEVEL=0
|
$(MAKE) -C crosstool-NG clean MAKELEVEL=0
|
||||||
-rm -rf crosstool-NG/.build/src
|
-rm -rf crosstool-NG/.build/src
|
||||||
|
-rm -f crosstool-NG/local-patches/gcc/4.8.5/1000-*
|
||||||
-rm -rf $(TOOLCHAIN)
|
-rm -rf $(TOOLCHAIN)
|
||||||
|
|
||||||
|
clean-sdk:
|
||||||
|
rm -rf $(VENDOR_SDK_DIR)
|
||||||
|
rm -f sdk
|
||||||
|
rm -f .sdk_patch_$(VENDOR_SDK)
|
||||||
|
rm -f user_rf_cal_sector_set.o empty_user_rf_pre_init.o
|
||||||
|
$(MAKE) -C esp-open-lwip -f Makefile.open clean
|
||||||
|
|
||||||
|
clean-sysroot:
|
||||||
|
rm -rf $(TOOLCHAIN)/xtensa-lx106-elf/sysroot/usr/lib/*
|
||||||
|
rm -rf $(TOOLCHAIN)/xtensa-lx106-elf/sysroot/usr/include/*
|
||||||
|
|
||||||
|
|
||||||
esptool: toolchain
|
esptool: toolchain
|
||||||
|
|
@ -105,7 +126,8 @@ esptool: toolchain
|
||||||
toolchain: $(TOOLCHAIN)/bin/xtensa-lx106-elf-gcc
|
toolchain: $(TOOLCHAIN)/bin/xtensa-lx106-elf-gcc
|
||||||
|
|
||||||
$(TOOLCHAIN)/bin/xtensa-lx106-elf-gcc: crosstool-NG/ct-ng
|
$(TOOLCHAIN)/bin/xtensa-lx106-elf-gcc: crosstool-NG/ct-ng
|
||||||
make -C crosstool-NG -f ../Makefile _toolchain
|
cp -f 1000-mforce-l32.patch crosstool-NG/local-patches/gcc/4.8.5/
|
||||||
|
$(MAKE) -C crosstool-NG -f ../Makefile _toolchain
|
||||||
|
|
||||||
_toolchain:
|
_toolchain:
|
||||||
./ct-ng xtensa-lx106-elf
|
./ct-ng xtensa-lx106-elf
|
||||||
|
|
@ -114,20 +136,17 @@ _toolchain:
|
||||||
cat ../crosstool-config-overrides >> .config
|
cat ../crosstool-config-overrides >> .config
|
||||||
./ct-ng build
|
./ct-ng build
|
||||||
|
|
||||||
clean-sysroot:
|
|
||||||
rm -rf $(TOOLCHAIN)/xtensa-lx106-elf/sysroot/usr/lib/*
|
|
||||||
rm -rf $(TOOLCHAIN)/xtensa-lx106-elf/sysroot/usr/include/*
|
|
||||||
|
|
||||||
crosstool-NG: crosstool-NG/ct-ng
|
crosstool-NG: crosstool-NG/ct-ng
|
||||||
|
|
||||||
crosstool-NG/ct-ng: crosstool-NG/bootstrap
|
crosstool-NG/ct-ng: crosstool-NG/bootstrap
|
||||||
make -C crosstool-NG -f ../Makefile _ct-ng
|
$(MAKE) -C crosstool-NG -f ../Makefile _ct-ng
|
||||||
|
|
||||||
_ct-ng:
|
_ct-ng:
|
||||||
./bootstrap
|
./bootstrap
|
||||||
./configure --prefix=`pwd`
|
./configure --prefix=`pwd`
|
||||||
make MAKELEVEL=0
|
$(MAKE) MAKELEVEL=0
|
||||||
make install MAKELEVEL=0
|
$(MAKE) install MAKELEVEL=0
|
||||||
|
|
||||||
crosstool-NG/bootstrap:
|
crosstool-NG/bootstrap:
|
||||||
@echo "You cloned without --recursive, fetching submodules for you."
|
@echo "You cloned without --recursive, fetching submodules for you."
|
||||||
|
|
@ -143,13 +162,13 @@ $(TOOLCHAIN)/xtensa-lx106-elf/sysroot/lib/libcirom.a: $(TOOLCHAIN)/xtensa-lx106-
|
||||||
libhal: $(TOOLCHAIN)/xtensa-lx106-elf/sysroot/usr/lib/libhal.a
|
libhal: $(TOOLCHAIN)/xtensa-lx106-elf/sysroot/usr/lib/libhal.a
|
||||||
|
|
||||||
$(TOOLCHAIN)/xtensa-lx106-elf/sysroot/usr/lib/libhal.a: $(TOOLCHAIN)/bin/xtensa-lx106-elf-gcc
|
$(TOOLCHAIN)/xtensa-lx106-elf/sysroot/usr/lib/libhal.a: $(TOOLCHAIN)/bin/xtensa-lx106-elf-gcc
|
||||||
make -C lx106-hal -f ../Makefile _libhal
|
$(MAKE) -C lx106-hal -f ../Makefile _libhal
|
||||||
|
|
||||||
_libhal:
|
_libhal:
|
||||||
autoreconf -i
|
autoreconf -i
|
||||||
PATH=$(TOOLCHAIN)/bin:$(PATH) ./configure --host=xtensa-lx106-elf --prefix=$(TOOLCHAIN)/xtensa-lx106-elf/sysroot/usr
|
PATH="$(TOOLCHAIN)/bin:$(PATH)" ./configure --host=xtensa-lx106-elf --prefix=$(TOOLCHAIN)/xtensa-lx106-elf/sysroot/usr
|
||||||
PATH=$(TOOLCHAIN)/bin:$(PATH) make
|
PATH="$(TOOLCHAIN)/bin:$(PATH)" $(MAKE)
|
||||||
PATH=$(TOOLCHAIN)/bin:$(PATH) make install
|
PATH="$(TOOLCHAIN)/bin:$(PATH)" $(MAKE) install
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -161,10 +180,62 @@ $(VENDOR_SDK_DIR)/.dir: $(VENDOR_SDK_ZIP)
|
||||||
-mv License $(VENDOR_SDK_DIR)
|
-mv License $(VENDOR_SDK_DIR)
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
|
$(VENDOR_SDK_DIR_2.1.0-18-g61248df)/.dir:
|
||||||
|
echo $(VENDOR_SDK_DIR_2.1.0-18-g61248df)
|
||||||
|
git clone https://github.com/espressif/ESP8266_NONOS_SDK $(VENDOR_SDK_DIR_2.1.0-18-g61248df)
|
||||||
|
(cd $(VENDOR_SDK_DIR_2.1.0-18-g61248df); git checkout 61248df5f6)
|
||||||
|
touch $@
|
||||||
|
|
||||||
|
$(VENDOR_SDK_DIR_2.1.0)/.dir: $(VENDOR_SDK_ZIP_2.1.0)
|
||||||
|
$(UNZIP) $^
|
||||||
|
touch $@
|
||||||
|
|
||||||
|
$(VENDOR_SDK_DIR_2.0.0)/.dir: $(VENDOR_SDK_ZIP_2.0.0)
|
||||||
|
$(UNZIP) $^
|
||||||
|
mv ESP8266_NONOS_SDK $(VENDOR_SDK_DIR_2.0.0)
|
||||||
|
-mv License $(VENDOR_SDK_DIR)
|
||||||
|
touch $@
|
||||||
|
|
||||||
|
$(VENDOR_SDK_DIR_1.5.4)/.dir: $(VENDOR_SDK_ZIP_1.5.4)
|
||||||
|
$(UNZIP) $^
|
||||||
|
mv ESP8266_NONOS_SDK $(VENDOR_SDK_DIR_1.5.4)
|
||||||
|
-mv License $(VENDOR_SDK_DIR)
|
||||||
|
touch $@
|
||||||
|
|
||||||
sdk_patch: $(VENDOR_SDK_DIR)/.dir .sdk_patch_$(VENDOR_SDK)
|
sdk_patch: $(VENDOR_SDK_DIR)/.dir .sdk_patch_$(VENDOR_SDK)
|
||||||
|
|
||||||
.sdk_patch_1.5.2:
|
.sdk_patch_2.1.0-18-g61248df .sdk_patch_2.1.0: user_rf_cal_sector_set.o
|
||||||
|
echo -e "#undef ESP_SDK_VERSION\n#define ESP_SDK_VERSION 020100" >>$(VENDOR_SDK_DIR)/include/esp_sdk_ver.h
|
||||||
|
$(PATCH) -d $(VENDOR_SDK_DIR) -p1 < c_types-c99_sdk_2.patch
|
||||||
|
cd $(VENDOR_SDK_DIR)/lib; mkdir -p tmp; cd tmp; $(TOOLCHAIN)/bin/xtensa-lx106-elf-ar x ../libcrypto.a; cd ..; $(TOOLCHAIN)/bin/xtensa-lx106-elf-ar rs libwpa.a tmp/*.o
|
||||||
|
$(TOOLCHAIN)/bin/xtensa-lx106-elf-ar r $(VENDOR_SDK_DIR)/lib/libmain.a user_rf_cal_sector_set.o
|
||||||
|
@touch $@
|
||||||
|
|
||||||
|
.sdk_patch_2.0.0: ESP8266_NONOS_SDK_V2.0.0_patch_16_08_09.zip user_rf_cal_sector_set.o
|
||||||
|
echo -e "#undef ESP_SDK_VERSION\n#define ESP_SDK_VERSION 020000" >>$(VENDOR_SDK_DIR)/include/esp_sdk_ver.h
|
||||||
|
$(UNZIP) ESP8266_NONOS_SDK_V2.0.0_patch_16_08_09.zip
|
||||||
|
mv libmain.a libnet80211.a libpp.a $(VENDOR_SDK_DIR_2.0.0)/lib/
|
||||||
|
$(PATCH) -d $(VENDOR_SDK_DIR) -p1 < c_types-c99_sdk_2.patch
|
||||||
|
cd $(VENDOR_SDK_DIR)/lib; mkdir -p tmp; cd tmp; $(TOOLCHAIN)/bin/xtensa-lx106-elf-ar x ../libcrypto.a; cd ..; $(TOOLCHAIN)/bin/xtensa-lx106-elf-ar rs libwpa.a tmp/*.o
|
||||||
|
$(TOOLCHAIN)/bin/xtensa-lx106-elf-ar r $(VENDOR_SDK_DIR)/lib/libmain.a user_rf_cal_sector_set.o
|
||||||
|
@touch $@
|
||||||
|
|
||||||
|
.sdk_patch_1.5.4:
|
||||||
|
echo -e "#undef ESP_SDK_VERSION\n#define ESP_SDK_VERSION 010504" >>$(VENDOR_SDK_DIR)/include/esp_sdk_ver.h
|
||||||
|
$(PATCH) -d $(VENDOR_SDK_DIR) -p1 < c_types-c99.patch
|
||||||
|
cd $(VENDOR_SDK_DIR)/lib; mkdir -p tmp; cd tmp; $(TOOLCHAIN)/bin/xtensa-lx106-elf-ar x ../libcrypto.a; cd ..; $(TOOLCHAIN)/bin/xtensa-lx106-elf-ar rs libwpa.a tmp/*.o
|
||||||
|
@touch $@
|
||||||
|
|
||||||
|
.sdk_patch_1.5.3:
|
||||||
|
echo -e "#undef ESP_SDK_VERSION\n#define ESP_SDK_VERSION 010503" >>$(VENDOR_SDK_DIR)/include/esp_sdk_ver.h
|
||||||
|
$(PATCH) -d $(VENDOR_SDK_DIR) -p1 < c_types-c99.patch
|
||||||
|
cd $(VENDOR_SDK_DIR)/lib; mkdir -p tmp; cd tmp; $(TOOLCHAIN)/bin/xtensa-lx106-elf-ar x ../libcrypto.a; cd ..; $(TOOLCHAIN)/bin/xtensa-lx106-elf-ar rs libwpa.a tmp/*.o
|
||||||
|
@touch $@
|
||||||
|
|
||||||
|
.sdk_patch_1.5.2: Patch01_for_ESP8266_NONOS_SDK_V1.5.2.zip
|
||||||
echo -e "#undef ESP_SDK_VERSION\n#define ESP_SDK_VERSION 010502" >>$(VENDOR_SDK_DIR)/include/esp_sdk_ver.h
|
echo -e "#undef ESP_SDK_VERSION\n#define ESP_SDK_VERSION 010502" >>$(VENDOR_SDK_DIR)/include/esp_sdk_ver.h
|
||||||
|
$(UNZIP) Patch01_for_ESP8266_NONOS_SDK_V1.5.2.zip
|
||||||
|
mv libssl.a libnet80211.a libmain.a $(VENDOR_SDK_DIR_1.5.2)/lib/
|
||||||
$(PATCH) -d $(VENDOR_SDK_DIR) -p1 < c_types-c99.patch
|
$(PATCH) -d $(VENDOR_SDK_DIR) -p1 < c_types-c99.patch
|
||||||
cd $(VENDOR_SDK_DIR)/lib; mkdir -p tmp; cd tmp; $(TOOLCHAIN)/bin/xtensa-lx106-elf-ar x ../libcrypto.a; cd ..; $(TOOLCHAIN)/bin/xtensa-lx106-elf-ar rs libwpa.a tmp/*.o
|
cd $(VENDOR_SDK_DIR)/lib; mkdir -p tmp; cd tmp; $(TOOLCHAIN)/bin/xtensa-lx106-elf-ar x ../libcrypto.a; cd ..; $(TOOLCHAIN)/bin/xtensa-lx106-elf-ar rs libwpa.a tmp/*.o
|
||||||
@touch $@
|
@touch $@
|
||||||
|
|
@ -276,14 +347,36 @@ sdk_patch: $(VENDOR_SDK_DIR)/.dir .sdk_patch_$(VENDOR_SDK)
|
||||||
cp FRM_ERR_PATCH/*.a $(VENDOR_SDK_DIR)/lib/
|
cp FRM_ERR_PATCH/*.a $(VENDOR_SDK_DIR)/lib/
|
||||||
@touch $@
|
@touch $@
|
||||||
|
|
||||||
empty_user_rf_pre_init.o: empty_user_rf_pre_init.c $(TOOLCHAIN)/bin/xtensa-lx106-elf-gcc
|
empty_user_rf_pre_init.o: empty_user_rf_pre_init.c $(TOOLCHAIN)/bin/xtensa-lx106-elf-gcc $(VENDOR_SDK_DIR)/.dir
|
||||||
$(TOOLCHAIN)/bin/xtensa-lx106-elf-gcc -O2 -c $<
|
$(TOOLCHAIN)/bin/xtensa-lx106-elf-gcc -O2 -I$(VENDOR_SDK_DIR)/include -c $<
|
||||||
|
|
||||||
|
user_rf_cal_sector_set.o: user_rf_cal_sector_set.c $(TOOLCHAIN)/bin/xtensa-lx106-elf-gcc $(VENDOR_SDK_DIR)/.dir
|
||||||
|
$(TOOLCHAIN)/bin/xtensa-lx106-elf-gcc -O2 -I$(VENDOR_SDK_DIR)/include -c $<
|
||||||
|
|
||||||
lwip: toolchain sdk_patch
|
lwip: toolchain sdk_patch
|
||||||
make -C esp-open-lwip -f Makefile.open install \
|
ifeq ($(STANDALONE),y)
|
||||||
|
$(MAKE) -C esp-open-lwip -f Makefile.open install \
|
||||||
CC=$(TOOLCHAIN)/bin/xtensa-lx106-elf-gcc \
|
CC=$(TOOLCHAIN)/bin/xtensa-lx106-elf-gcc \
|
||||||
|
AR=$(TOOLCHAIN)/bin/xtensa-lx106-elf-ar \
|
||||||
PREFIX=$(TOOLCHAIN)
|
PREFIX=$(TOOLCHAIN)
|
||||||
|
cp -a esp-open-lwip/include/arch esp-open-lwip/include/lwip esp-open-lwip/include/netif \
|
||||||
|
esp-open-lwip/include/lwipopts.h \
|
||||||
|
$(TOOLCHAIN)/xtensa-lx106-elf/sysroot/usr/include/
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
ESP8266_NONOS_SDK-2.1.0.zip:
|
||||||
|
wget --content-disposition "https://github.com/espressif/ESP8266_NONOS_SDK/archive/v2.1.0.zip"
|
||||||
|
# The only change wrt to ESP8266_NONOS_SDK_V2.0.0_16_07_19.zip is licensing blurb in source/
|
||||||
|
# header files. Libs are the same (and patch is required just the same).
|
||||||
|
ESP8266_NONOS_SDK_V2.0.0_16_08_10.zip:
|
||||||
|
wget --content-disposition "http://bbs.espressif.com/download/file.php?id=1690"
|
||||||
|
ESP8266_NONOS_SDK_V2.0.0_16_07_19.zip:
|
||||||
|
wget --content-disposition "http://bbs.espressif.com/download/file.php?id=1613"
|
||||||
|
ESP8266_NONOS_SDK_V1.5.4_16_05_20.zip:
|
||||||
|
wget --content-disposition "http://bbs.espressif.com/download/file.php?id=1469"
|
||||||
|
ESP8266_NONOS_SDK_V1.5.3_16_04_18.zip:
|
||||||
|
wget --content-disposition "http://bbs.espressif.com/download/file.php?id=1361"
|
||||||
ESP8266_NONOS_SDK_V1.5.2_16_01_29.zip:
|
ESP8266_NONOS_SDK_V1.5.2_16_01_29.zip:
|
||||||
wget --content-disposition "http://bbs.espressif.com/download/file.php?id=1079"
|
wget --content-disposition "http://bbs.espressif.com/download/file.php?id=1079"
|
||||||
ESP8266_NONOS_SDK_V1.5.1_16_01_08.zip:
|
ESP8266_NONOS_SDK_V1.5.1_16_01_08.zip:
|
||||||
|
|
@ -347,17 +440,7 @@ libsmartconfig_2.4.2.zip:
|
||||||
wget --content-disposition "http://bbs.espressif.com/download/file.php?id=585"
|
wget --content-disposition "http://bbs.espressif.com/download/file.php?id=585"
|
||||||
lib_mem_optimize_150714.zip:
|
lib_mem_optimize_150714.zip:
|
||||||
wget --content-disposition "http://bbs.espressif.com/download/file.php?id=594"
|
wget --content-disposition "http://bbs.espressif.com/download/file.php?id=594"
|
||||||
|
Patch01_for_ESP8266_NONOS_SDK_V1.5.2.zip:
|
||||||
clean-sdk:
|
wget --content-disposition "http://bbs.espressif.com/download/file.php?id=1168"
|
||||||
rm -rf $(VENDOR_SDK_DIR)
|
ESP8266_NONOS_SDK_V2.0.0_patch_16_08_09.zip:
|
||||||
rm -f sdk
|
wget --content-disposition "http://bbs.espressif.com/download/file.php?id=1654"
|
||||||
rm -f .sdk_patch_$(VENDOR_SDK)
|
|
||||||
make -C esp-open-lwip -f Makefile.open clean
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
17
README.md
17
README.md
|
|
@ -36,7 +36,7 @@ Requirements and Dependencies
|
||||||
|
|
||||||
To build the standalone SDK and toolchain, you need a GNU/POSIX system
|
To build the standalone SDK and toolchain, you need a GNU/POSIX system
|
||||||
(Linux, BSD, MacOSX, Windows with Cygwin) with the standard GNU development
|
(Linux, BSD, MacOSX, Windows with Cygwin) with the standard GNU development
|
||||||
tools installed: gcc, binutils, flex, bison, etc.
|
tools installed: bash, gcc, binutils, flex, bison, etc.
|
||||||
|
|
||||||
Please make sure that the machine you use to build the toolchain has at least
|
Please make sure that the machine you use to build the toolchain has at least
|
||||||
1G free RAM+swap (or more, which will speed up the build).
|
1G free RAM+swap (or more, which will speed up the build).
|
||||||
|
|
@ -45,9 +45,9 @@ Please make sure that the machine you use to build the toolchain has at least
|
||||||
|
|
||||||
Ubuntu 14.04:
|
Ubuntu 14.04:
|
||||||
```
|
```
|
||||||
$ sudo apt-get install make unrar autoconf automake libtool gcc g++ gperf \
|
$ sudo apt-get install make unrar-free autoconf automake libtool gcc g++ gperf \
|
||||||
flex bison texinfo gawk ncurses-dev libexpat-dev python python-serial sed \
|
flex bison texinfo gawk ncurses-dev libexpat-dev python-dev python python-serial \
|
||||||
git unzip
|
sed git unzip bash help2man wget bzip2
|
||||||
```
|
```
|
||||||
|
|
||||||
Later Debian/Ubuntu versions may require:
|
Later Debian/Ubuntu versions may require:
|
||||||
|
|
@ -58,7 +58,7 @@ $ sudo apt-get install libtool-bin
|
||||||
## MacOS:
|
## MacOS:
|
||||||
```bash
|
```bash
|
||||||
$ brew tap homebrew/dupes
|
$ brew tap homebrew/dupes
|
||||||
$ brew install binutils coreutils automake wget gawk libtool gperf gnu-sed --with-default-names grep
|
$ brew install binutils coreutils automake wget gawk libtool help2man gperf gnu-sed --with-default-names grep
|
||||||
$ export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"
|
$ export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -139,6 +139,11 @@ $ 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.
|
The extra -I and -L flags are not needed when using the standalone SDK.
|
||||||
|
|
||||||
|
Subdirectory `examples/` contains some example application(s) which
|
||||||
|
can be built with esp-open-sdk. If you are interested in real-world,
|
||||||
|
full-fledged, advanced example of a project built using esp-open-sdk,
|
||||||
|
check https://github.com/micropython/micropython/tree/master/ports/esp8266.
|
||||||
|
|
||||||
Pulling updates
|
Pulling updates
|
||||||
===============
|
===============
|
||||||
The project is updated from time to time, to get updates and prepare to
|
The project is updated from time to time, to get updates and prepare to
|
||||||
|
|
@ -148,7 +153,7 @@ build a new SDK, run:
|
||||||
$ make clean
|
$ make clean
|
||||||
$ git pull
|
$ git pull
|
||||||
$ git submodule sync
|
$ git submodule sync
|
||||||
$ git submodule update
|
$ git submodule update --init
|
||||||
```
|
```
|
||||||
|
|
||||||
If you don't issue `make clean` (which causes toolchain and SDK to be
|
If you don't issue `make clean` (which causes toolchain and SDK to be
|
||||||
|
|
|
||||||
45
c_types-c99_sdk_2.patch
Normal file
45
c_types-c99_sdk_2.patch
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
This patch fixes vendor SDK header "c_types.h" for C99 compatibility.
|
||||||
|
|
||||||
|
--- ESP8266_NONOS_SDK_V2.0.0_16_07_19/include/c_types.h.orig 2016-07-18 07:16:07.000000000 -0700
|
||||||
|
+++ ESP8266_NONOS_SDK_V2.0.0_16_07_19/include/c_types.h 2016-07-26 21:45:18.904657700 -0700
|
||||||
|
@@ -6,17 +6,19 @@
|
||||||
|
#ifndef _C_TYPES_H_
|
||||||
|
#define _C_TYPES_H_
|
||||||
|
|
||||||
|
-typedef unsigned char uint8_t;
|
||||||
|
+#include <stdint.h>
|
||||||
|
+#include <stdbool.h>
|
||||||
|
+//typedef unsigned char uint8_t;
|
||||||
|
typedef signed char sint8_t;
|
||||||
|
-typedef signed char int8_t;
|
||||||
|
-typedef unsigned short uint16_t;
|
||||||
|
+//typedef signed char int8_t;
|
||||||
|
+//typedef unsigned short uint16_t;
|
||||||
|
typedef signed short sint16_t;
|
||||||
|
-typedef signed short int16_t;
|
||||||
|
-typedef unsigned int uint32_t;
|
||||||
|
+//typedef signed short int16_t;
|
||||||
|
+//typedef unsigned int uint32_t;
|
||||||
|
typedef signed long sint32_t;
|
||||||
|
-typedef signed int int32_t;
|
||||||
|
+//typedef signed int int32_t;
|
||||||
|
typedef signed long long sint64_t;
|
||||||
|
-typedef unsigned long long uint64_t;
|
||||||
|
+//typedef unsigned long long uint64_t;
|
||||||
|
typedef unsigned long long u_int64_t;
|
||||||
|
typedef float real32_t;
|
||||||
|
typedef double real64_t;
|
||||||
|
@@ -82,10 +84,10 @@
|
||||||
|
#define STORE_ATTR __attribute__((aligned(4)))
|
||||||
|
|
||||||
|
#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
|
||||||
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit feb1fb829d5cb4f8739e488cbd2f0b72304705bb
|
Subproject commit 37b07f6fbea2e5d23434f7e91614528f839db056
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit 5bd20afa6869b682001250e2a95c261390f1098d
|
Subproject commit 8c39d2179a273553466043f388772abb6251a4ca
|
||||||
2
esptool
2
esptool
|
|
@ -1 +1 @@
|
||||||
Subproject commit aafef9cebe1b196368567d6c3dd1fe896222a35f
|
Subproject commit 9dfcb350e1a91bb4641f725fc6c2f126791013ce
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
CC = xtensa-lx106-elf-gcc
|
CC = xtensa-lx106-elf-gcc
|
||||||
CFLAGS = -I. -mlongcalls
|
CFLAGS = -I. -mlongcalls
|
||||||
LDLIBS = -nostdlib -Wl,--start-group -lmain -lnet80211 -lwpa -llwip -lpp -lphy -Wl,--end-group -lgcc
|
LDLIBS = -nostdlib -Wl,--start-group -lmain -lnet80211 -lwpa -llwip -lpp -lphy -lc -Wl,--end-group -lgcc
|
||||||
LDFLAGS = -Teagle.app.v6.ld
|
LDFLAGS = -Teagle.app.v6.ld
|
||||||
|
|
||||||
blinky-0x00000.bin: blinky
|
blinky-0x00000.bin: blinky
|
||||||
|
|
@ -11,7 +11,7 @@ blinky: blinky.o
|
||||||
blinky.o: blinky.c
|
blinky.o: blinky.c
|
||||||
|
|
||||||
flash: blinky-0x00000.bin
|
flash: blinky-0x00000.bin
|
||||||
esptool.py write_flash 0 blinky-0x00000.bin 0x40000 blinky-0x40000.bin
|
esptool.py write_flash 0 blinky-0x00000.bin 0x10000 blinky-0x10000.bin
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f blinky blinky.o blinky-0x00000.bin blinky-0x400000.bin
|
rm -f blinky blinky.o blinky-0x00000.bin blinky-0x10000.bin
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -3,7 +3,9 @@
|
||||||
#include "gpio.h"
|
#include "gpio.h"
|
||||||
#include "os_type.h"
|
#include "os_type.h"
|
||||||
|
|
||||||
static const int pin = 1;
|
// ESP-12 modules have LED on GPIO2. Change to another GPIO
|
||||||
|
// for other boards.
|
||||||
|
static const int pin = 2;
|
||||||
static volatile os_timer_t some_timer;
|
static volatile os_timer_t some_timer;
|
||||||
|
|
||||||
void some_timerfunc(void *arg)
|
void some_timerfunc(void *arg)
|
||||||
|
|
@ -23,7 +25,7 @@ void some_timerfunc(void *arg)
|
||||||
|
|
||||||
void ICACHE_FLASH_ATTR user_init()
|
void ICACHE_FLASH_ATTR user_init()
|
||||||
{
|
{
|
||||||
// init gpio sussytem
|
// init gpio subsytem
|
||||||
gpio_init();
|
gpio_init();
|
||||||
|
|
||||||
// configure UART TXD to be GPIO1, set as output
|
// configure UART TXD to be GPIO1, set as output
|
||||||
|
|
|
||||||
11
user_rf_cal_sector_set.c
Normal file
11
user_rf_cal_sector_set.c
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
#include <c_types.h>
|
||||||
|
#include <spi_flash.h>
|
||||||
|
|
||||||
|
uint32 user_rf_cal_sector_set(void) {
|
||||||
|
extern char flashchip;
|
||||||
|
SpiFlashChip *flash = (SpiFlashChip*)(&flashchip + 4);
|
||||||
|
// We know that sector size in 4096
|
||||||
|
//uint32_t sec_num = flash->chip_size / flash->sector_size;
|
||||||
|
uint32_t sec_num = flash->chip_size >> 12;
|
||||||
|
return sec_num - 5;
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue