Skip to content

Commit ec75c85

Browse files
author
Espressif Systems
committed
update version to 0.9.9, have a try.
1 parent 97a5314 commit ec75c85

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+2231
-55413
lines changed

Makefile

+170-7
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,131 @@ ifndef PDIR
44

55
endif
66

7-
AR = xt-ar
8-
CC = xt-xcc
9-
NM = xt-nm
10-
CPP = xt-cpp
11-
OBJCOPY = xt-objcopy
12-
#MAKE = xt-make
7+
ifeq ($(COMPILE), gcc)
8+
AR = xtensa-lx106-elf-ar
9+
CC = xtensa-lx106-elf-gcc
10+
NM = xtensa-lx106-elf-nm
11+
CPP = xtensa-lx106-elf-cpp
12+
OBJCOPY = xtensa-lx106-elf-objcopy
13+
OBJDUMP = xtensa-lx106-elf-objdump
14+
else
15+
AR = xt-ar
16+
CC = xt-xcc
17+
NM = xt-nm
18+
CPP = xt-cpp
19+
OBJCOPY = xt-objcopy
20+
OBJDUMP = xt-objdump
21+
endif
22+
23+
BOOT?=none
24+
APP?=0
25+
SPI_SPEED?=40
26+
SPI_MODE?=QIO
27+
SPI_SIZE?=512
28+
29+
ifeq ($(BOOT), new)
30+
boot = new
31+
else
32+
ifeq ($(BOOT), old)
33+
boot = old
34+
else
35+
boot = none
36+
endif
37+
endif
38+
39+
ifeq ($(APP), 1)
40+
app = 1
41+
else
42+
ifeq ($(APP), 2)
43+
app = 2
44+
else
45+
app = 0
46+
endif
47+
endif
48+
49+
ifeq ($(SPI_SPEED), 26.7)
50+
freqdiv = 1
51+
else
52+
ifeq ($(SPI_SPEED), 20)
53+
freqdiv = 2
54+
else
55+
ifeq ($(SPI_SPEED), 80)
56+
freqdiv = 15
57+
else
58+
freqdiv = 0
59+
endif
60+
endif
61+
endif
62+
63+
64+
ifeq ($(SPI_MODE), QOUT)
65+
mode = 1
66+
else
67+
ifeq ($(SPI_MODE), DIO)
68+
mode = 2
69+
else
70+
ifeq ($(SPI_MODE), DOUT)
71+
mode = 3
72+
else
73+
mode = 0
74+
endif
75+
endif
76+
endif
77+
78+
# flash larger than 1024KB only use 1024KB to storage user1.bin and user2.bin
79+
ifeq ($(SPI_SIZE), 256)
80+
size = 1
81+
flash = 256
82+
else
83+
ifeq ($(SPI_SIZE), 1024)
84+
size = 2
85+
flash = 1024
86+
else
87+
ifeq ($(SPI_SIZE), 2048)
88+
size = 3
89+
flash = 1024
90+
else
91+
ifeq ($(SPI_SIZE), 4096)
92+
size = 4
93+
flash = 1024
94+
else
95+
size = 0
96+
flash = 512
97+
endif
98+
endif
99+
endif
100+
endif
101+
102+
ifeq ($(flash), 512)
103+
ifeq ($(app), 1)
104+
addr = 0x01000
105+
else
106+
ifeq ($(app), 2)
107+
addr = 0x41000
108+
endif
109+
endif
110+
else
111+
ifeq ($(flash), 1024)
112+
ifeq ($(app), 1)
113+
addr = 0x01000
114+
else
115+
ifeq ($(app), 2)
116+
addr = 0x81000
117+
endif
118+
endif
119+
endif
120+
endif
121+
122+
LD_FILE = $(LDDIR)/eagle.app.v6.ld
123+
124+
ifneq ($(boot), none)
125+
ifneq ($(app),0)
126+
LD_FILE = $(LDDIR)/eagle.app.v6.$(boot).$(flash).app$(app).ld
127+
BIN_NAME = user$(app).$(flash).$(boot)
128+
endif
129+
else
130+
app = 0
131+
endif
13132

14133
CSRCS ?= $(wildcard *.c)
15134
ASRCs ?= $(wildcard *.s)
@@ -82,7 +201,51 @@ endef
82201

83202
$(BINODIR)/%.bin: $(IMAGEODIR)/%.out
84203
@mkdir -p $(BINODIR)
85-
$(OBJCOPY) -O binary $< $@
204+
205+
ifeq ($(APP), 0)
206+
@$(RM) -r ../bin/eagle.S ../bin/eagle.dump
207+
@$(OBJDUMP) -x -s $< > ../bin/eagle.dump
208+
@$(OBJDUMP) -S $< > ../bin/eagle.S
209+
else
210+
@$(RM) -r ../bin/upgrade/$(BIN_NAME).S ../bin/upgrade/$(BIN_NAME).dump
211+
@$(OBJDUMP) -x -s $< > ../bin/upgrade/$(BIN_NAME).dump
212+
@$(OBJDUMP) -S $< > ../bin/upgrade/$(BIN_NAME).S
213+
endif
214+
215+
@$(OBJCOPY) --only-section .text -O binary $< eagle.app.v6.text.bin
216+
@$(OBJCOPY) --only-section .data -O binary $< eagle.app.v6.data.bin
217+
@$(OBJCOPY) --only-section .rodata -O binary $< eagle.app.v6.rodata.bin
218+
@$(OBJCOPY) --only-section .irom0.text -O binary $< eagle.app.v6.irom0text.bin
219+
220+
@echo ""
221+
@echo "!!!"
222+
223+
ifeq ($(app), 0)
224+
@python ../tools/gen_appbin.py $< 0 $(mode) $(freqdiv) $(size)
225+
@mv eagle.app.flash.bin ../bin/eagle.flash.bin
226+
@mv eagle.app.v6.irom0text.bin ../bin/eagle.irom0text.bin
227+
@rm eagle.app.v6.*
228+
@echo "No boot needed."
229+
@echo "Generate eagle.flash.bin and eagle.irom0text.bin successully in folder bin."
230+
@echo "eagle.flash.bin-------->0x00000"
231+
@echo "eagle.irom0text.bin---->0x40000"
232+
else
233+
ifeq ($(boot), new)
234+
@python ../tools/gen_appbin.py $< 2 $(mode) $(freqdiv) $(size)
235+
@echo "Support boot_v1.2 and +"
236+
else
237+
@python ../tools/gen_appbin.py $< 1 $(mode) $(freqdiv) $(size)
238+
@echo "Support boot_v1.1 and +"
239+
endif
240+
241+
@mv eagle.app.flash.bin ../bin/upgrade/$(BIN_NAME).bin
242+
@rm eagle.app.v6.*
243+
@echo "Generate $(BIN_NAME).bin successully in folder bin/upgrade."
244+
@echo "boot.bin------------>0x00000"
245+
@echo "$(BIN_NAME).bin--->$(addr)"
246+
endif
247+
248+
@echo "!!!"
86249

87250
#############################################################
88251
# Rules base

app/Makefile

-19
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,6 @@ ifeq ($(FLAVOR),release)
4545
TARGET_LDFLAGS += -g -O0
4646
endif
4747

48-
LD_FILE = $(LDDIR)/eagle.app.v6.ld
49-
50-
ifeq ($(APP), 1)
51-
LD_FILE = $(LDDIR)/eagle.app.v6.app1.ld
52-
endif
53-
54-
ifeq ($(APP), 2)
55-
LD_FILE = $(LDDIR)/eagle.app.v6.app2.ld
56-
endif
57-
5848
COMPONENTS_eagle.app.v6 = \
5949
user/libuser.a
6050

@@ -124,15 +114,6 @@ INCLUDES := $(INCLUDES) -I $(PDIR)include
124114
PDIR := ../$(PDIR)
125115
sinclude $(PDIR)Makefile
126116

127-
#########################################################################
128-
#
129-
# generate bin file
130-
#
131-
132-
$(BINODIR)/%.bin: $(IMAGEODIR)/%.out
133-
@mkdir -p $(BINODIR)
134-
$(OBJCOPY) -O binary $< $@
135-
136117
.PHONY: FORCE
137118
FORCE:
138119

app/gen_misc.bat

+112-18
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,121 @@
11
@echo off
2-
set BACKPATH=%PATH%
3-
set PATH=%BACKPATH%;%CD%\..\tools
4-
@echo on
52

6-
del /F ..\bin\eagle.app.v6.flash.bin ..\bin\eagle.app.v6.irom0text.bin ..\bin\eagle.app.v6.dump ..\bin\eagle.app.v6.S
3+
echo Please follow below steps(1-5) to generate specific bin(s):
4+
echo STEP 1: choose boot version(0=boot_v1.1, 1=boot_v1.2+, 2=none)
5+
set input=default
6+
set /p input=enter(0/1/2, default 2):
77

8-
cd .output\eagle\debug\image
8+
if %input% equ 0 (
9+
set boot=old
10+
) else (
11+
if %input% equ 1 (
12+
set boot=new
13+
) else (
14+
set boot=none
15+
)
16+
)
917

10-
xt-objdump -x -s eagle.app.v6.out > ..\..\..\..\..\bin\eagle.app.v6.dump
11-
xt-objdump -S eagle.app.v6.out > ..\..\..\..\..\bin\eagle.app.v6.S
18+
echo boot mode: %boot%
19+
echo.
1220

13-
xt-objcopy --only-section .text -O binary eagle.app.v6.out eagle.app.v6.text.bin
14-
xt-objcopy --only-section .data -O binary eagle.app.v6.out eagle.app.v6.data.bin
15-
xt-objcopy --only-section .rodata -O binary eagle.app.v6.out eagle.app.v6.rodata.bin
16-
xt-objcopy --only-section .irom0.text -O binary eagle.app.v6.out eagle.app.v6.irom0text.bin
21+
echo STEP 2: choose bin generate(0=eagle.flash.bin+eagle.irom0text.bin, 1=user1.bin, 2=user2.bin)
22+
set input=default
23+
set /p input=enter (0/1/2, default 0):
1724

18-
gen_appbin.py eagle.app.v6.out v6
25+
if %input% equ 1 (
26+
if %boot% equ none (
27+
set app=0
28+
echo choose no boot before
29+
echo generate bin: eagle.flash.bin+eagle.irom0text.bin
30+
) else (
31+
set app=1
32+
echo generate bin: user1.bin
33+
)
34+
) else (
35+
if %input% equ 2 (
36+
if %boot% equ none (
37+
set app=0
38+
echo choose no boot before
39+
echo generate bin: eagle.flash.bin+eagle.irom0text.bin
40+
) else (
41+
set app=2
42+
echo generate bin: user2.bin
43+
)
44+
) else (
45+
if %boot% neq none (
46+
set boot=none
47+
echo ignore boot
48+
)
49+
set app=0
50+
echo generate bin: eagle.flash.bin+eagle.irom0text.bin
51+
))
1952

20-
xcopy /y eagle.app.v6.irom0text.bin ..\..\..\..\..\bin\
21-
xcopy /y eagle.app.v6.flash.bin ..\..\..\..\..\bin\
53+
echo.
2254

23-
cd ..\..\..\..\
55+
echo STEP 3: choose spi speed(0=20MHz, 1=26.7MHz, 2=40MHz, 3=80MHz)
56+
set input=default
57+
set /p input=enter (0/1/2/3, default 2):
58+
59+
if %input% equ 0 (
60+
set spi_speed=20
61+
) else (
62+
if %input% equ 1 (
63+
set spi_speed=26.7
64+
) else (
65+
if %input% equ 3 (
66+
set spi_speed=80
67+
) else (
68+
set spi_speed=40
69+
)))
70+
71+
echo spi speed: %spi_speed% MHz
72+
echo.
73+
74+
echo STEP 4: choose spi mode(0=QIO, 1=QOUT, 2=DIO, 3=DOUT)
75+
set input=default
76+
set /p input=enter (0/1/2/3, default 0):
77+
78+
if %input% equ 1 (
79+
set spi_mode=QOUT
80+
) else (
81+
if %input% equ 2 (
82+
set spi_mode=DIO
83+
) else (
84+
if %input% equ 3 (
85+
set spi_mode=DOUT
86+
) else (
87+
set spi_mode=QIO
88+
)))
89+
90+
echo spi mode: %spi_mode%
91+
echo.
92+
93+
echo STEP 5: choose spi size(0=256KB, 1=512KB, 2=1024KB, 3=2048KB, 4=4096KB)
94+
set input=default
95+
set /p input=enter (0/1/2/3/4, default 1):
96+
97+
if %input% equ 0 (
98+
set spi_size=256
99+
) else (
100+
if %input% equ 2 (
101+
set spi_size=1024
102+
) else (
103+
if %input% equ 3 (
104+
set spi_size=2048
105+
) else (
106+
if %input% equ 4 (
107+
set spi_size=4096
108+
) else (
109+
set spi_size=512
110+
))))
111+
112+
echo spi size: %spi_size% KB
113+
114+
touch user/user_main.c
115+
116+
echo.
117+
echo start...
118+
echo.
119+
120+
make BOOT=%boot% APP=%app% SPI_SPEED=%spi_speed% SPI_MODE=%spi_mode% SPI_SIZE=%spi_size%
24121

25-
@echo off
26-
set PATH=%BACKPATH%
27-
@echo on

0 commit comments

Comments
 (0)