Skip to content

Commit fdd3346

Browse files
committed
spi_flash: add support for 8MB & 16MB flash size
1. update support for 8MB & 16MB flash size 2. update compile ENV to generate image in 8MB & 16MB flash size map 3. update function "user_rf_cal_sector" in example code
1 parent b16e28c commit fdd3346

File tree

16 files changed

+203
-32
lines changed

16 files changed

+203
-32
lines changed

Makefile

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,26 @@ else
116116
addr = 0x101000
117117
endif
118118
else
119-
size_map = 0
120-
flash = 512
121-
ifeq ($(app), 2)
122-
addr = 0x41000
119+
ifeq ($(SPI_SIZE_MAP), 8)
120+
size_map = 8
121+
flash = 8192
122+
ifeq ($(app), 2)
123+
addr = 0x101000
124+
endif
125+
else
126+
ifeq ($(SPI_SIZE_MAP), 9)
127+
size_map = 9
128+
flash = 16384
129+
ifeq ($(app), 2)
130+
addr = 0x101000
131+
endif
132+
else
133+
size_map = 0
134+
flash = 512
135+
ifeq ($(app), 2)
136+
addr = 0x41000
137+
endif
138+
endif
123139
endif
124140
endif
125141
endif
@@ -132,7 +148,7 @@ LD_FILE = $(LDDIR)/eagle.app.v6.ld
132148

133149
ifneq ($(boot), none)
134150
ifneq ($(app),0)
135-
ifeq ($(size_map), 6)
151+
ifneq ($(findstring $(size_map), 6 8 9),)
136152
LD_FILE = $(LDDIR)/eagle.app.v6.$(boot).2048.ld
137153
else
138154
ifeq ($(size_map), 5)
@@ -151,11 +167,11 @@ ifneq ($(app),0)
151167
LD_FILE = $(LDDIR)/eagle.app.v6.$(boot).512.app$(app).ld
152168
endif
153169
endif
154-
endif
155-
endif
156-
endif
157-
endif
158-
BIN_NAME = user$(app).$(flash).$(boot).$(size_map)
170+
endif
171+
endif
172+
endif
173+
endif
174+
BIN_NAME = user$(app).$(flash).$(boot).$(size_map)
159175
endif
160176
else
161177
app = 0

examples/openssl_demo/gen_misc.sh

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
#!/bin/bash
22

3+
:<<!
4+
******NOTICE******
5+
MUST set SDK_PATH & BIN_PATH firstly!!!
6+
example:
7+
export SDK_PATH=~/esp_iot_sdk_freertos
8+
export BIN_PATH=~/esp8266_bin
9+
!
10+
11+
export SDK_PATH=$SDK_PATH
12+
export BIN_PATH=$BIN_PATH
13+
314
echo "gen_misc.sh version 20150911"
415
echo ""
516

@@ -122,7 +133,10 @@ echo " 3=2048KB( 512KB+ 512KB)"
122133
echo " 4=4096KB( 512KB+ 512KB)"
123134
echo " 5=2048KB(1024KB+1024KB)"
124135
echo " 6=4096KB(1024KB+1024KB)"
125-
echo "enter (0/2/3/4/5/6, default 0):"
136+
echo " 7=4096KB(2048KB+2048KB) not support ,just for compatible with nodeMCU board"
137+
echo " 8=8192KB(1024KB+1024KB)"
138+
echo " 9=16384KB(1024KB+1024KB)"
139+
echo "enter (0/2/3/4/5/6/7/8/9, default 0):"
126140
read input
127141

128142
if [ -z "$input" ]; then
@@ -149,6 +163,18 @@ elif [ $input == 6 ]; then
149163
spi_size_map=6
150164
echo "spi size: 4096KB"
151165
echo "spi ota map: 1024KB + 1024KB"
166+
elif [ $input == 7 ]; then
167+
spi_size_map=7
168+
echo"not support ,just for compatible with nodeMCU board"
169+
exit
170+
elif [ $input == 8 ]; then
171+
spi_size_map=8
172+
echo "spi size: 8192KB"
173+
echo "spi ota map: 1024KB + 1024KB"
174+
elif [ $input == 9 ]; then
175+
spi_size_map=9
176+
echo "spi size: 16384KB"
177+
echo "spi ota map: 1024KB + 1024KB"
152178
else
153179
spi_size_map=0
154180
echo "spi size: 512KB"

examples/openssl_demo/user/user_main.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,12 @@ uint32 user_rf_cal_sector_set(void)
6060
case FLASH_SIZE_32M_MAP_1024_1024:
6161
rf_cal_sec = 1024 - 5;
6262
break;
63-
63+
case FLASH_SIZE_64M_MAP_1024_1024:
64+
rf_cal_sec = 2048 - 5;
65+
break;
66+
case FLASH_SIZE_128M_MAP_1024_1024:
67+
rf_cal_sec = 4096 - 5;
68+
break;
6469
default:
6570
rf_cal_sec = 0;
6671
break;

examples/project_template/gen_misc.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,10 @@ echo " 3=2048KB( 512KB+ 512KB)"
133133
echo " 4=4096KB( 512KB+ 512KB)"
134134
echo " 5=2048KB(1024KB+1024KB)"
135135
echo " 6=4096KB(1024KB+1024KB)"
136-
echo "enter (0/2/3/4/5/6, default 0):"
136+
echo " 7=4096KB(2048KB+2048KB) not support ,just for compatible with nodeMCU board"
137+
echo " 8=8192KB(1024KB+1024KB)"
138+
echo " 9=16384KB(1024KB+1024KB)"
139+
echo "enter (0/2/3/4/5/6/7/8/9, default 0):"
137140
read input
138141

139142
if [ -z "$input" ]; then
@@ -160,6 +163,18 @@ elif [ $input == 6 ]; then
160163
spi_size_map=6
161164
echo "spi size: 4096KB"
162165
echo "spi ota map: 1024KB + 1024KB"
166+
elif [ $input == 7 ]; then
167+
spi_size_map=7
168+
echo"not support ,just for compatible with nodeMCU board"
169+
exit
170+
elif [ $input == 8 ]; then
171+
spi_size_map=8
172+
echo "spi size: 8192KB"
173+
echo "spi ota map: 1024KB + 1024KB"
174+
elif [ $input == 9 ]; then
175+
spi_size_map=9
176+
echo "spi size: 16384KB"
177+
echo "spi ota map: 1024KB + 1024KB"
163178
else
164179
spi_size_map=0
165180
echo "spi size: 512KB"

examples/project_template/user/user_main.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,19 @@ uint32 user_rf_cal_sector_set(void)
5959
case FLASH_SIZE_32M_MAP_1024_1024:
6060
rf_cal_sec = 1024 - 5;
6161
break;
62-
62+
case FLASH_SIZE_64M_MAP_1024_1024:
63+
rf_cal_sec = 2048 - 5;
64+
break;
65+
case FLASH_SIZE_128M_MAP_1024_1024:
66+
rf_cal_sec = 4096 - 5;
67+
break;
6368
default:
6469
rf_cal_sec = 0;
6570
break;
6671
}
6772

6873
return rf_cal_sec;
6974
}
70-
7175
/******************************************************************************
7276
* FunctionName : user_init
7377
* Description : entry of user application, init user function here

examples/smart_config/gen_misc.sh

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ export SDK_PATH=~/esp_iot_sdk_freertos
88
export BIN_PATH=~/esp8266_bin
99
!
1010

11-
export SDK_PATH=
12-
export BIN_PATH=
11+
export SDK_PATH=$SDK_PATH
12+
export BIN_PATH=$BIN_PATH
1313

1414
echo "gen_misc.sh version 20150911"
1515
echo ""
@@ -133,7 +133,10 @@ echo " 3=2048KB( 512KB+ 512KB)"
133133
echo " 4=4096KB( 512KB+ 512KB)"
134134
echo " 5=2048KB(1024KB+1024KB)"
135135
echo " 6=4096KB(1024KB+1024KB)"
136-
echo "enter (0/2/3/4/5/6, default 0):"
136+
echo " 7=4096KB(2048KB+2048KB) not support ,just for compatible with nodeMCU board"
137+
echo " 8=8192KB(1024KB+1024KB)"
138+
echo " 9=16384KB(1024KB+1024KB)"
139+
echo "enter (0/2/3/4/5/6/7/8/9, default 0):"
137140
read input
138141

139142
if [ -z "$input" ]; then
@@ -160,6 +163,18 @@ elif [ $input == 6 ]; then
160163
spi_size_map=6
161164
echo "spi size: 4096KB"
162165
echo "spi ota map: 1024KB + 1024KB"
166+
elif [ $input == 7 ]; then
167+
spi_size_map=7
168+
echo"not support ,just for compatible with nodeMCU board"
169+
exit
170+
elif [ $input == 8 ]; then
171+
spi_size_map=8
172+
echo "spi size: 8192KB"
173+
echo "spi ota map: 1024KB + 1024KB"
174+
elif [ $input == 9 ]; then
175+
spi_size_map=9
176+
echo "spi size: 16384KB"
177+
echo "spi ota map: 1024KB + 1024KB"
163178
else
164179
spi_size_map=0
165180
echo "spi size: 512KB"

examples/smart_config/user/user_main.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,12 @@ uint32 user_rf_cal_sector_set(void)
239239
case FLASH_SIZE_32M_MAP_1024_1024:
240240
rf_cal_sec = 1024 - 5;
241241
break;
242-
242+
case FLASH_SIZE_64M_MAP_1024_1024:
243+
rf_cal_sec = 2048 - 5;
244+
break;
245+
case FLASH_SIZE_128M_MAP_1024_1024:
246+
rf_cal_sec = 4096 - 5;
247+
break;
243248
default:
244249
rf_cal_sec = 0;
245250
break;

examples/spiffs_test/gen_misc.sh

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ export SDK_PATH=~/esp_iot_sdk_freertos
88
export BIN_PATH=~/esp8266_bin
99
!
1010

11-
export SDK_PATH=
12-
export BIN_PATH=
11+
export SDK_PATH=$SDK_PATH
12+
export BIN_PATH=$BIN_PATH
1313

1414
echo "gen_misc.sh version 20150911"
1515
echo ""
@@ -133,7 +133,10 @@ echo " 3=2048KB( 512KB+ 512KB)"
133133
echo " 4=4096KB( 512KB+ 512KB)"
134134
echo " 5=2048KB(1024KB+1024KB)"
135135
echo " 6=4096KB(1024KB+1024KB)"
136-
echo "enter (0/2/3/4/5/6, default 0):"
136+
echo " 7=4096KB(2048KB+2048KB) not support ,just for compatible with nodeMCU board"
137+
echo " 8=8192KB(1024KB+1024KB)"
138+
echo " 9=16384KB(1024KB+1024KB)"
139+
echo "enter (0/2/3/4/5/6/7/8/9, default 0):"
137140
read input
138141

139142
if [ -z "$input" ]; then
@@ -160,6 +163,18 @@ elif [ $input == 6 ]; then
160163
spi_size_map=6
161164
echo "spi size: 4096KB"
162165
echo "spi ota map: 1024KB + 1024KB"
166+
elif [ $input == 7 ]; then
167+
spi_size_map=7
168+
echo"not support ,just for compatible with nodeMCU board"
169+
exit
170+
elif [ $input == 8 ]; then
171+
spi_size_map=8
172+
echo "spi size: 8192KB"
173+
echo "spi ota map: 1024KB + 1024KB"
174+
elif [ $input == 9 ]; then
175+
spi_size_map=9
176+
echo "spi size: 16384KB"
177+
echo "spi ota map: 1024KB + 1024KB"
163178
else
164179
spi_size_map=0
165180
echo "spi size: 512KB"

examples/spiffs_test/user/test_main.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,12 @@ uint32 user_rf_cal_sector_set(void)
8484
case FLASH_SIZE_32M_MAP_1024_1024:
8585
rf_cal_sec = 1024 - 5;
8686
break;
87-
87+
case FLASH_SIZE_64M_MAP_1024_1024:
88+
rf_cal_sec = 2048 - 5;
89+
break;
90+
case FLASH_SIZE_128M_MAP_1024_1024:
91+
rf_cal_sec = 4096 - 5;
92+
break;
8893
default:
8994
rf_cal_sec = 0;
9095
break;

examples/websocket_demo/gen_misc.sh

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ export SDK_PATH=~/esp_iot_sdk_freertos
88
export BIN_PATH=~/esp8266_bin
99
!
1010

11-
export SDK_PATH=
12-
export BIN_PATH=
11+
export SDK_PATH=$SDK_PATH
12+
export BIN_PATH=$BIN_PATH
1313

1414
echo "gen_misc.sh version 20150911"
1515
echo ""
@@ -133,7 +133,10 @@ echo " 3=2048KB( 512KB+ 512KB)"
133133
echo " 4=4096KB( 512KB+ 512KB)"
134134
echo " 5=2048KB(1024KB+1024KB)"
135135
echo " 6=4096KB(1024KB+1024KB)"
136-
echo "enter (0/2/3/4/5/6, default 0):"
136+
echo " 7=4096KB(2048KB+2048KB) not support ,just for compatible with nodeMCU board"
137+
echo " 8=8192KB(1024KB+1024KB)"
138+
echo " 9=16384KB(1024KB+1024KB)"
139+
echo "enter (0/2/3/4/5/6/7/8/9, default 0):"
137140
read input
138141

139142
if [ -z "$input" ]; then
@@ -160,6 +163,18 @@ elif [ $input == 6 ]; then
160163
spi_size_map=6
161164
echo "spi size: 4096KB"
162165
echo "spi ota map: 1024KB + 1024KB"
166+
elif [ $input == 7 ]; then
167+
spi_size_map=7
168+
echo"not support ,just for compatible with nodeMCU board"
169+
exit
170+
elif [ $input == 8 ]; then
171+
spi_size_map=8
172+
echo "spi size: 8192KB"
173+
echo "spi ota map: 1024KB + 1024KB"
174+
elif [ $input == 9 ]; then
175+
spi_size_map=9
176+
echo "spi size: 16384KB"
177+
echo "spi ota map: 1024KB + 1024KB"
163178
else
164179
spi_size_map=0
165180
echo "spi size: 512KB"

examples/websocket_demo/user/user_main.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,12 @@ uint32 user_rf_cal_sector_set(void)
6161
case FLASH_SIZE_32M_MAP_1024_1024:
6262
rf_cal_sec = 1024 - 5;
6363
break;
64-
64+
case FLASH_SIZE_64M_MAP_1024_1024:
65+
rf_cal_sec = 2048 - 5;
66+
break;
67+
case FLASH_SIZE_128M_MAP_1024_1024:
68+
rf_cal_sec = 4096 - 5;
69+
break;
6570
default:
6671
rf_cal_sec = 0;
6772
break;

examples/wifi_station_machine_demo/gen_misc.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,10 @@ echo " 3=2048KB( 512KB+ 512KB)"
133133
echo " 4=4096KB( 512KB+ 512KB)"
134134
echo " 5=2048KB(1024KB+1024KB)"
135135
echo " 6=4096KB(1024KB+1024KB)"
136-
echo "enter (0/2/3/4/5/6, default 0):"
136+
echo " 7=4096KB(2048KB+2048KB) not support ,just for compatible with nodeMCU board"
137+
echo " 8=8192KB(1024KB+1024KB)"
138+
echo " 9=16384KB(1024KB+1024KB)"
139+
echo "enter (0/2/3/4/5/6/7/8/9, default 0):"
137140
read input
138141

139142
if [ -z "$input" ]; then
@@ -160,6 +163,18 @@ elif [ $input == 6 ]; then
160163
spi_size_map=6
161164
echo "spi size: 4096KB"
162165
echo "spi ota map: 1024KB + 1024KB"
166+
elif [ $input == 7 ]; then
167+
spi_size_map=7
168+
echo"not support ,just for compatible with nodeMCU board"
169+
exit
170+
elif [ $input == 8 ]; then
171+
spi_size_map=8
172+
echo "spi size: 8192KB"
173+
echo "spi ota map: 1024KB + 1024KB"
174+
elif [ $input == 9 ]; then
175+
spi_size_map=9
176+
echo "spi size: 16384KB"
177+
echo "spi ota map: 1024KB + 1024KB"
163178
else
164179
spi_size_map=0
165180
echo "spi size: 512KB"

examples/wifi_station_machine_demo/user/user_main.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,12 @@ uint32 user_rf_cal_sector_set(void)
6262
case FLASH_SIZE_32M_MAP_1024_1024:
6363
rf_cal_sec = 1024 - 5;
6464
break;
65-
65+
case FLASH_SIZE_64M_MAP_1024_1024:
66+
rf_cal_sec = 2048 - 5;
67+
break;
68+
case FLASH_SIZE_128M_MAP_1024_1024:
69+
rf_cal_sec = 4096 - 5;
70+
break;
6671
default:
6772
rf_cal_sec = 0;
6873
break;

0 commit comments

Comments
 (0)