Skip to content

Commit 0bfec5b

Browse files
committed
Merge branch 'feat/support_1MB_flash' into 'master'
feat: Add at_small demo to support 1MB flash on v3.x.x See merge request sdk/ESP8266_NONOS_SDK!272
2 parents 3fe474e + 34ea486 commit 0bfec5b

File tree

9 files changed

+1124
-2
lines changed

9 files changed

+1124
-2
lines changed

examples/at/!!!readme!!!.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
Notice: AT added some functions so it's larger than before, if you want to compile it, please compile it as 1024KB or larger flash in compilation STEP 5.
1+
Notice:
2+
AT firmware becomes larger since it supports more functions. So, we provide two examples here:
3+
4+
* Normal AT, esp-at/examples/at, supports 2MB or larger flash, uses mbedTLS lib, the default AT.
5+
* Nano AT, esp-at/examples/at_nano, supports 1MB flash, uses SSL lib which supports less cipher suites.
6+
It is suggested to use normal AT, if your flash size is 2MB or larger.
7+
8+
Please compile this demo as 1024KB or larger flash in compilation STEP 5.
29

310
1��compile options
411

@@ -39,4 +46,4 @@ For example:
3946
2��You can also use gen_misc to make and generate specific bin you needed.
4047
Linux: ./gen_misc.sh
4148
Windows: gen_misc.bat
42-
Follow the tips and steps.
49+
Follow the tips and steps.

examples/at_nano/!!!readme!!!.txt

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
Notice:
2+
AT firmware becomes larger since it supports more functions. So, we provide two examples here:
3+
4+
* Normal AT, esp-at/examples/at, supports 2MB or larger flash, uses mbedTLS lib, the default AT.
5+
* Nano AT, esp-at/examples/at_nano, supports 1MB flash, uses SSL lib which supports less cipher suites.
6+
It is suggested to use normal AT, if your flash size is 2MB or larger.
7+
8+
1��compile options
9+
10+
(1) COMPILE
11+
Possible value: gcc
12+
Default value:
13+
If not set, use xt-xcc by default.
14+
15+
(2) BOOT
16+
Possible value: none/old/new
17+
none: no need boot
18+
old: use boot_v1.1
19+
new: use boot_v1.2+
20+
Default value: none
21+
22+
(3) APP
23+
Possible value: 0/1/2
24+
0: original mode, generate eagle.app.v6.flash.bin and eagle.app.v6.irom0text.bin
25+
1: generate user1
26+
2: generate user2
27+
Default value: 0
28+
29+
(3) SPI_SPEED
30+
Possible value: 20/26.7/40/80
31+
Default value: 40
32+
33+
(4) SPI_MODE
34+
Possible value: QIO/QOUT/DIO/DOUT
35+
Default value: QIO
36+
37+
(4) SPI_SIZE
38+
Possible value: 0/2/3/4/5/6
39+
Default value: 0
40+
41+
For example:
42+
make COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=0
43+
44+
2��You can also use gen_misc to make and generate specific bin you needed.
45+
Linux: ./gen_misc.sh
46+
Windows: gen_misc.bat
47+
Follow the tips and steps.

examples/at_nano/Makefile

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
#############################################################
2+
# Required variables for each makefile
3+
# Discard this section from all parent makefiles
4+
# Expected variables (with automatic defaults):
5+
# CSRCS (all "C" files in the dir)
6+
# SUBDIRS (all subdirs with a Makefile)
7+
# GEN_LIBS - list of libs to be generated ()
8+
# GEN_IMAGES - list of object file images to be generated ()
9+
# GEN_BINS - list of binaries to be generated ()
10+
# COMPONENTS_xxx - a list of libs/objs in the form
11+
# subdir/lib to be extracted and rolled up into
12+
# a generated lib/image xxx.a ()
13+
#
14+
TARGET = eagle
15+
#FLAVOR = release
16+
FLAVOR = debug
17+
18+
#EXTRA_CCFLAGS += -u
19+
20+
ifndef PDIR # {
21+
GEN_IMAGES= eagle.app.v6.out
22+
GEN_BINS= eagle.app.v6.bin
23+
SPECIAL_MKTARGETS=$(APP_MKTARGETS)
24+
SUBDIRS= \
25+
user
26+
ifdef AT_OPEN_SRC
27+
SUBDIRS += \
28+
at
29+
endif
30+
endif # } PDIR
31+
32+
APPDIR = .
33+
LDDIR = ../ld
34+
35+
CCFLAGS += -Os
36+
37+
ifdef ESP_AT_FW_VERSION
38+
CCFLAGS += -DESP_AT_FW_VERSION=\"$(ESP_AT_FW_VERSION)\"
39+
endif
40+
41+
TARGET_LDFLAGS = \
42+
-nostdlib \
43+
-Wl,-EL \
44+
--longcalls \
45+
--text-section-literals
46+
47+
ifeq ($(FLAVOR),debug)
48+
TARGET_LDFLAGS += -g -O2
49+
endif
50+
51+
ifeq ($(FLAVOR),release)
52+
TARGET_LDFLAGS += -g -O0
53+
endif
54+
55+
COMPONENTS_eagle.app.v6 = \
56+
user/libuser.a
57+
58+
ifdef AT_OPEN_SRC
59+
COMPONENTS_eagle.app.v6 += \
60+
at/libat.a
61+
endif
62+
63+
LINKFLAGS_eagle.app.v6 = \
64+
-L../lib \
65+
-nostdlib \
66+
-T$(LD_FILE) \
67+
-Wl,--no-check-sections \
68+
-Wl,--gc-sections \
69+
-u call_user_start \
70+
-Wl,-static \
71+
-Wl,--start-group \
72+
-lc \
73+
-lgcc \
74+
-lhal \
75+
-lphy \
76+
-lpp \
77+
-lnet80211 \
78+
-llwip \
79+
-lwpa \
80+
-lwpa2 \
81+
-lcrypto \
82+
-lmain \
83+
-ljson \
84+
-lupgrade \
85+
-lssl \
86+
-lwps \
87+
-lsmartconfig \
88+
-lairkiss \
89+
$(DEP_LIBS_eagle.app.v6)
90+
91+
ifndef AT_OPEN_SRC
92+
LINKFLAGS_eagle.app.v6 += \
93+
-lat
94+
endif
95+
96+
LINKFLAGS_eagle.app.v6 += \
97+
-Wl,--end-group
98+
DEPENDS_eagle.app.v6 = \
99+
$(LD_FILE) \
100+
$(LDDIR)/eagle.rom.addr.v6.ld
101+
102+
#############################################################
103+
# Configuration i.e. compile options etc.
104+
# Target specific stuff (defines etc.) goes in here!
105+
# Generally values applying to a tree are captured in the
106+
# makefile at its root level - these are then overridden
107+
# for a subtree within the makefile rooted therein
108+
#
109+
110+
#UNIVERSAL_TARGET_DEFINES = \
111+
112+
# Other potential configuration flags include:
113+
# -DTXRX_TXBUF_DEBUG
114+
# -DTXRX_RXBUF_DEBUG
115+
# -DWLAN_CONFIG_CCX
116+
CONFIGURATION_DEFINES = -DICACHE_FLASH -DUSE_OPTIMIZE_PRINTF
117+
118+
ifdef AT_OPEN_SRC
119+
CONFIGURATION_DEFINES += \
120+
-DAT_OPEN_SRC
121+
endif
122+
123+
ifeq ($(APP),0)
124+
else
125+
CONFIGURATION_DEFINES += \
126+
-DAT_UPGRADE_SUPPORT
127+
endif
128+
129+
ifeq ($(SPI_SIZE_MAP),5)
130+
CONFIGURATION_DEFINES += -DFLASH_MAP=$(SPI_SIZE_MAP)
131+
endif
132+
133+
DEFINES += \
134+
$(UNIVERSAL_TARGET_DEFINES) \
135+
$(CONFIGURATION_DEFINES)
136+
137+
DDEFINES += \
138+
$(UNIVERSAL_TARGET_DEFINES) \
139+
$(CONFIGURATION_DEFINES)
140+
141+
142+
#############################################################
143+
# Recursion Magic - Don't touch this!!
144+
#
145+
# Each subtree potentially has an include directory
146+
# corresponding to the common APIs applicable to modules
147+
# rooted at that subtree. Accordingly, the INCLUDE PATH
148+
# of a module can only contain the include directories up
149+
# its parent path, and not its siblings
150+
#
151+
# Required for each makefile to inherit from the parent
152+
#
153+
154+
INCLUDES := $(INCLUDES) -I $(PDIR)include
155+
PDIR := ../$(PDIR)
156+
sinclude $(PDIR)Makefile
157+
158+
.PHONY: FORCE
159+
FORCE:
160+

examples/at_nano/gen_misc.bat

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
@echo off
2+
3+
echo gen_misc.bat version 20150511
4+
echo .
5+
6+
echo Please follow below steps(1-5) to generate specific bin(s):
7+
echo STEP 1: choose boot version(0=boot_v1.1, 1=boot_v1.2+, 2=none)
8+
set input=default
9+
set /p input=enter(0/1/2, default 2):
10+
11+
if %input% equ 0 (
12+
set boot=old
13+
) else (
14+
if %input% equ 1 (
15+
set boot=new
16+
) else (
17+
set boot=none
18+
)
19+
)
20+
21+
echo boot mode: %boot%
22+
echo.
23+
24+
echo STEP 2: choose bin generate(0=eagle.flash.bin+eagle.irom0text.bin, 1=user1.bin, 2=user2.bin)
25+
set input=default
26+
set /p input=enter (0/1/2, default 0):
27+
28+
if %input% equ 1 (
29+
if %boot% equ none (
30+
set app=0
31+
echo choose no boot before
32+
echo generate bin: eagle.flash.bin+eagle.irom0text.bin
33+
) else (
34+
set app=1
35+
echo generate bin: user1.bin
36+
)
37+
) else (
38+
if %input% equ 2 (
39+
if %boot% equ none (
40+
set app=0
41+
echo choose no boot before
42+
echo generate bin: eagle.flash.bin+eagle.irom0text.bin
43+
) else (
44+
set app=2
45+
echo generate bin: user2.bin
46+
)
47+
) else (
48+
if %boot% neq none (
49+
set boot=none
50+
echo ignore boot
51+
)
52+
set app=0
53+
echo generate bin: eagle.flash.bin+eagle.irom0text.bin
54+
))
55+
56+
echo.
57+
58+
echo STEP 3: choose spi speed(0=20MHz, 1=26.7MHz, 2=40MHz, 3=80MHz)
59+
set input=default
60+
set /p input=enter (0/1/2/3, default 2):
61+
62+
if %input% equ 0 (
63+
set spi_speed=20
64+
) else (
65+
if %input% equ 1 (
66+
set spi_speed=26.7
67+
) else (
68+
if %input% equ 3 (
69+
set spi_speed=80
70+
) else (
71+
set spi_speed=40
72+
)))
73+
74+
echo spi speed: %spi_speed% MHz
75+
echo.
76+
77+
echo STEP 4: choose spi mode(0=QIO, 1=QOUT, 2=DIO, 3=DOUT)
78+
set input=default
79+
set /p input=enter (0/1/2/3, default 0):
80+
81+
if %input% equ 1 (
82+
set spi_mode=QOUT
83+
) else (
84+
if %input% equ 2 (
85+
set spi_mode=DIO
86+
) else (
87+
if %input% equ 3 (
88+
set spi_mode=DOUT
89+
) else (
90+
set spi_mode=QIO
91+
)))
92+
93+
echo spi mode: %spi_mode%
94+
echo.
95+
96+
echo STEP 5: choose flash size and map
97+
echo 0= 512KB( 256KB+ 256KB)
98+
echo 2=1024KB( 512KB+ 512KB)
99+
echo 3=2048KB( 512KB+ 512KB)
100+
echo 4=4096KB( 512KB+ 512KB)
101+
echo 5=2048KB(1024KB+1024KB)
102+
echo 6=4096KB(1024KB+1024KB)
103+
set input=default
104+
set /p input=enter (0/1/2/3/4/5/6, default 0):
105+
106+
if %input% equ 2 (
107+
set spi_size_map=2
108+
echo spi size: 1024KB
109+
echo spi ota map: 512KB + 512KB
110+
) else (
111+
if %input% equ 3 (
112+
set spi_size_map=3
113+
echo spi size: 2048KB
114+
echo spi ota map: 512KB + 512KB
115+
) else (
116+
if %input% equ 4 (
117+
set spi_size_map=4
118+
echo spi size: 4096KB
119+
echo spi ota map: 512KB + 512KB
120+
) else (
121+
if %input% equ 5 (
122+
set spi_size_map=5
123+
echo spi size: 2048KB
124+
echo spi ota map: 1024KB + 1024KB
125+
) else (
126+
if %input% equ 6 (
127+
set spi_size_map=6
128+
echo spi size: 4096KB
129+
echo spi ota map: 1024KB + 1024KB
130+
) else (
131+
set spi_size_map=0
132+
echo spi size: 512KB
133+
echo spi ota map: 256KB + 256KB
134+
)
135+
)
136+
)
137+
)
138+
)
139+
140+
touch user/user_main.c
141+
142+
echo.
143+
echo start...
144+
echo.
145+
146+
make BOOT=%boot% APP=%app% SPI_SPEED=%spi_speed% SPI_MODE=%spi_mode% SPI_SIZE=%spi_size_map%
147+

0 commit comments

Comments
 (0)