Skip to content

Commit 7785626

Browse files
committed
Merge branch 'feature/add_th25q16_patch_for_master' into 'master'
feat: Add th25q16 patch and remove IoT_Demo See merge request sdk/ESP8266_NONOS_SDK!314
2 parents 5137c86 + 133c2d7 commit 7785626

Some content is hidden

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

69 files changed

+2137
-6921
lines changed

.gitlab-ci.yml

Lines changed: 153 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,32 +27,174 @@ stages:
2727
- echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
2828
- *install_compiler
2929

30-
build_ssc:
30+
# build_ssc:
31+
# <<: *build_template
32+
# artifacts:
33+
# paths:
34+
# - ./SSC/ssc_bin
35+
# expire_in: 6 mos
36+
# script:
37+
# - git clone $GITLAB_SSH_SERVER/yinling/SSC.git
38+
# - cd SSC
39+
# # ssc master branch does not support nonos any more, now checkout to the reserved branch
40+
# - git checkout ${SSC_DEFAULT_BRANCH}
41+
# - chmod +x gen_misc_non_os.sh
42+
# - ./gen_misc_non_os.sh
43+
44+
build_at:
3145
<<: *build_template
3246
artifacts:
3347
paths:
34-
- ./SSC/ssc_bin
48+
- ./bin/upgrade
49+
- ./bin/*.bin
3550
expire_in: 6 mos
3651
script:
37-
- git clone $GITLAB_SSH_SERVER/yinling/SSC.git
38-
- cd SSC
39-
# ssc master branch does not support nonos any more, now checkout to the reserved branch
40-
- git checkout ${SSC_DEFAULT_BRANCH}
41-
- chmod +x gen_misc_non_os.sh
42-
- ./gen_misc_non_os.sh
52+
- cp -rf examples/at at
53+
- cd at
54+
- make COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=5
4355

44-
build_at:
56+
build_at_espconn:
4557
<<: *build_template
4658
artifacts:
4759
paths:
4860
- ./bin/upgrade
4961
- ./bin/*.bin
5062
expire_in: 6 mos
5163
script:
52-
- cp -rf examples/at at
53-
- cd at
64+
- cp -rf examples/at_espconn at_espconn
65+
- cd at_espconn
66+
- make COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=5
67+
68+
build_at_nano:
69+
<<: *build_template
70+
artifacts:
71+
paths:
72+
- ./bin/upgrade
73+
- ./bin/*.bin
74+
expire_in: 6 mos
75+
script:
76+
- cp -rf examples/at_nano at_nano
77+
- cd at_nano
78+
- make COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=5
79+
80+
build_at_sdio:
81+
<<: *build_template
82+
artifacts:
83+
paths:
84+
- ./bin/upgrade
85+
- ./bin/*.bin
86+
expire_in: 6 mos
87+
script:
88+
- cp -rf examples/at_sdio at_sdio
89+
- cd at_sdio
90+
- make COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=5
91+
92+
build_esp_mqtt_proj:
93+
<<: *build_template
94+
artifacts:
95+
paths:
96+
- ./bin/upgrade
97+
- ./bin/*.bin
98+
expire_in: 6 mos
99+
script:
100+
- cp -rf examples/esp_mqtt_proj esp_mqtt_proj
101+
- cd esp_mqtt_proj
102+
- make COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=5
103+
104+
# build_IoT_Demo:
105+
# <<: *build_template
106+
# artifacts:
107+
# paths:
108+
# - ./bin/upgrade
109+
# - ./bin/*.bin
110+
# expire_in: 6 mos
111+
# script:
112+
# - cp -rf examples/IoT_Demo IoT_Demo
113+
# - cd IoT_Demo
114+
# - make COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=5
115+
116+
build_peripheral_test:
117+
<<: *build_template
118+
artifacts:
119+
paths:
120+
- ./bin/upgrade
121+
- ./bin/*.bin
122+
expire_in: 6 mos
123+
script:
124+
- cp -rf examples/peripheral_test peripheral_test
125+
- cd peripheral_test
54126
- make COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=5
55127

128+
build_simple_pair:
129+
<<: *build_template
130+
artifacts:
131+
paths:
132+
- ./bin/upgrade
133+
- ./bin/*.bin
134+
expire_in: 6 mos
135+
script:
136+
- cp -rf examples/simple_pair simple_pair
137+
- cd simple_pair
138+
- make COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=5
139+
140+
build_smart_config:
141+
<<: *build_template
142+
artifacts:
143+
paths:
144+
- ./bin/upgrade
145+
- ./bin/*.bin
146+
expire_in: 6 mos
147+
script:
148+
- cp -rf examples/smart_config smart_config
149+
- cd smart_config
150+
- make COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=5
151+
152+
build_wpa2_enterprise:
153+
<<: *build_template
154+
artifacts:
155+
paths:
156+
- ./bin/upgrade
157+
- ./bin/*.bin
158+
expire_in: 6 mos
159+
script:
160+
- cp -rf examples/wpa2_enterprise wpa2_enterprise
161+
- cd wpa2_enterprise
162+
- make COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=5
163+
164+
build_wps:
165+
<<: *build_template
166+
artifacts:
167+
paths:
168+
- ./bin/upgrade
169+
- ./bin/*.bin
170+
expire_in: 6 mos
171+
script:
172+
- cp -rf examples/wps wps
173+
- cd wps
174+
- make COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=5
175+
176+
build_gen_patch_bin:
177+
<<: *build_template
178+
artifacts:
179+
paths:
180+
- ./bin/*.h
181+
expire_in: 6 mos
182+
script:
183+
- cp -rf examples/gen_patch_bin gen_patch_bin
184+
- cd gen_patch_bin
185+
- python2 gen_patch_bin.py
186+
- cp patch_array.h ../bin/
187+
188+
build_driver_lib:
189+
<<: *build_template
190+
artifacts:
191+
paths:
192+
- ./lib
193+
expire_in: 6 mos
194+
script:
195+
- cd driver_lib
196+
- ./make_lib.sh driver
197+
56198
push_master_to_github:
57199
stage: deploy
58200
only:

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ else
2222
OBJDUMP = xt-objdump
2323
endif
2424

25+
PYTHON?=python2
2526
BOOT?=none
2627
APP?=0
2728
SPI_SPEED?=40
@@ -281,7 +282,7 @@ endif
281282
@echo "!!!"
282283

283284
ifeq ($(app), 0)
284-
@python ../tools/gen_appbin.py $< 0 $(mode) $(freqdiv) $(size_map) $(app)
285+
@$(PYTHON) ../tools/gen_appbin.py $< 0 $(mode) $(freqdiv) $(size_map) $(app)
285286
@mv eagle.app.flash.bin ../bin/eagle.flash.bin
286287
@mv eagle.app.v6.irom0text.bin ../bin/eagle.irom0text.bin
287288
@rm eagle.app.v6.*
@@ -291,10 +292,10 @@ ifeq ($(app), 0)
291292
@echo "eagle.irom0text.bin---->0x10000"
292293
else
293294
ifneq ($(boot), new)
294-
@python ../tools/gen_appbin.py $< 1 $(mode) $(freqdiv) $(size_map) $(app)
295+
@$(PYTHON) ../tools/gen_appbin.py $< 1 $(mode) $(freqdiv) $(size_map) $(app)
295296
@echo "Support boot_v1.1 and +"
296297
else
297-
@python ../tools/gen_appbin.py $< 2 $(mode) $(freqdiv) $(size_map) $(app)
298+
@$(PYTHON) ../tools/gen_appbin.py $< 2 $(mode) $(freqdiv) $(size_map) $(app)
298299

299300
ifeq ($(size_map), 6)
300301
@echo "Support boot_v1.4 and +"

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ phy:
1515
phy : 1156_0
1616

1717
gitlab:
18-
driver : 5a2a54b4
18+
driver : 13cf853c
1919
json : f55d5fee
2020
lwip : 3c984cd8
2121
mbedtls : 82b93fe5

driver_lib/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ LINKFLAGS_eagle.app.v6 = \
5353
-nostdlib \
5454
-T$(LD_FILE) \
5555
-Wl,--no-check-sections \
56-
-u call_user_start \
56+
-u call_user_start1 \
5757
-Wl,-static \
5858
-Wl,--start-group \
5959
-lc \
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#include "osapi.h"
2+
#include "patch_array.h"
3+
#include "mem.h"
4+
#include "eagle_soc.h"
5+
6+
#if 0
7+
typedef int (*__ets_printf_t)(const char *fmt, ...);
8+
#define ROM_PRINTF(_fmt, ...) ((__ets_printf_t)(0x400024cc))(_fmt, ##__VA_ARGS__)
9+
#else
10+
#define ROM_PRINTF(_fmt, ...) ets_printf(_fmt, ##__VA_ARGS__)
11+
#endif
12+
13+
extern void call_user_start(void);
14+
extern char _heap_start;
15+
16+
int patch_apply(void)
17+
{
18+
uint32_t flash_id;
19+
int ret = __INT_MAX__;
20+
21+
WRITE_PERI_REG(0x60000240, 0);
22+
WRITE_PERI_REG(0x60000200, 0x01 << 28);
23+
while(READ_PERI_REG(0x60000200) != 0);
24+
flash_id = READ_PERI_REG(0x60000240) & 0xffffff;
25+
ROM_PRINTF("flash_id=0x%x\r\n", flash_id);
26+
if (flash_id == 0x1560eb) {
27+
ROM_PRINTF("apply...\r\n");
28+
uint32 len = 0;
29+
uint8* data = patch_data + 8;
30+
uint32* addr = 0;
31+
uint8 loop = 0;
32+
33+
ROM_PRINTF("data %p %d...\r\n", data, patch_data[1]);
34+
for (loop = 0; loop < patch_data[1] && (data - patch_data < sizeof(patch_data) - 8); loop++) {
35+
addr = data[0] | (data[1] << 8) | (data[2] << 16) | (data[3]<<24);
36+
len = data[4] | (data[5] << 8) | (data[6] << 16) | (data[7]<<24);
37+
data += 8;
38+
ets_memcpy(addr, data, len);
39+
data += len;
40+
ROM_PRINTF("addr=0x%x, len=%d\r\n",addr, len);
41+
}
42+
int (*apply_patch)(uint8_t *buffer1024);
43+
apply_patch = patch_data[4] | (patch_data[5] << 8) | (patch_data[6] << 16) | (patch_data[7]<<24);
44+
ROM_PRINTF("apply_patch=0x%08x...\r\n", *(uint32*)apply_patch);
45+
ret = apply_patch(&_heap_start);
46+
ROM_PRINTF("apply done...\r\n");
47+
}
48+
return ret;
49+
}
50+
51+
void call_user_start1(void)
52+
{
53+
int32 ret = patch_apply();
54+
ROM_PRINTF("ret=%d\r\n", ret);
55+
call_user_start();
56+
}

examples/IoT_Demo/driver/Makefile

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)