Skip to content

Commit 5208391

Browse files
committed
Merge branch 'release/v2.6.0'
2 parents 87dfd8b + 78f1667 commit 5208391

File tree

3 files changed

+50
-31
lines changed

3 files changed

+50
-31
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Espressif 8266: development platform for [PlatformIO](http://platformio.org)
22

3-
![alt text](https://github.com/platformio/platform-espressif8266/workflows/Examples/badge.svg "Espressif 8266 development platform")
3+
[![Build Status](https://github.com/platformio/platform-espressif8266/workflows/Examples/badge.svg)](https://github.com/platformio/platform-espressif8266/actions)
44

55
Espressif Systems is a privately held fabless semiconductor company. They provide wireless communications and Wi-Fi chips which are widely used in mobile devices and the Internet of Things applications.
66

builder/main.py

Lines changed: 39 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,12 @@ def _parse_ld_sizes(ldscript_path):
6060

6161
appsize_re = re.compile(
6262
r"irom0_0_seg\s*:.+len\s*=\s*(0x[\da-f]+)", flags=re.I)
63-
spiffs_re = re.compile(
64-
r"PROVIDE\s*\(\s*_SPIFFS_(\w+)\s*=\s*(0x[\da-f]+)\s*\)", flags=re.I)
63+
filesystem_re = re.compile(
64+
r"PROVIDE\s*\(\s*_%s_(\w+)\s*=\s*(0x[\da-f]+)\s*\)" % "FS"
65+
if "arduino" in env.subst("$PIOFRAMEWORK")
66+
else "SPIFFS",
67+
flags=re.I,
68+
)
6569
with open(ldscript_path) as fp:
6670
for line in fp.readlines():
6771
line = line.strip()
@@ -71,9 +75,9 @@ def _parse_ld_sizes(ldscript_path):
7175
if match:
7276
result['app_size'] = _parse_size(match.group(1))
7377
continue
74-
match = spiffs_re.search(line)
78+
match = filesystem_re.search(line)
7579
if match:
76-
result['spiffs_%s' % match.group(1)] = _parse_size(
80+
result['fs_%s' % match.group(1)] = _parse_size(
7781
match.group(2))
7882
return result
7983

@@ -85,19 +89,19 @@ def _get_flash_size(env):
8589
return "%dM" % (ldsizes['flash_size'] / 1048576)
8690

8791

88-
def fetch_spiffs_size(env):
92+
def fetch_fs_size(env):
8993
ldsizes = _parse_ld_sizes(env.GetActualLDScript())
9094
for key in ldsizes:
91-
if key.startswith("spiffs_"):
95+
if key.startswith("fs_"):
9296
env[key.upper()] = ldsizes[key]
9397

9498
assert all([
9599
k in env
96-
for k in ["SPIFFS_START", "SPIFFS_END", "SPIFFS_PAGE", "SPIFFS_BLOCK"]
100+
for k in ["FS_START", "FS_END", "FS_PAGE", "FS_BLOCK"]
97101
])
98102

99103
# esptool flash starts from 0
100-
for k in ("SPIFFS_START", "SPIFFS_END"):
104+
for k in ("FS_START", "FS_END"):
101105
_value = 0
102106
if env[k] < 0x40300000:
103107
_value = env[k] & 0xFFFFF
@@ -111,8 +115,8 @@ def fetch_spiffs_size(env):
111115
env[k] = _value
112116

113117

114-
def __fetch_spiffs_size(target, source, env):
115-
fetch_spiffs_size(env)
118+
def __fetch_fs_size(target, source, env):
119+
fetch_fs_size(env)
116120
return (target, source)
117121

118122

@@ -140,6 +144,8 @@ def get_esptoolpy_reset_flags(resetmethod):
140144
env = DefaultEnvironment()
141145
env.SConscript("compat.py", exports="env")
142146
platform = env.PioPlatform()
147+
board = env.BoardConfig()
148+
filesystem = board.get("build.filesystem", "spiffs")
143149

144150
env.Replace(
145151
__get_flash_size=_get_flash_size,
@@ -157,10 +163,16 @@ def get_esptoolpy_reset_flags(resetmethod):
157163
ARFLAGS=["rc"],
158164

159165
#
160-
# Misc
166+
# Filesystem
161167
#
162168

163-
MKSPIFFSTOOL="mkspiffs",
169+
MKFSTOOL="mk%s" % filesystem,
170+
ESP8266_FS_IMAGE_NAME=env.get("ESP8266_FS_IMAGE_NAME", env.get(
171+
"SPIFFSNAME", filesystem)),
172+
173+
#
174+
# Misc
175+
#
164176

165177
SIZEPROGREGEXP=r"^(?:\.irom0\.text|\.text|\.text1|\.data|\.rodata|)\s+([0-9]+).*",
166178
SIZEDATAREGEXP=r"^(?:\.data|\.rodata|\.bss)\s+([0-9]+).*",
@@ -195,14 +207,14 @@ def get_esptoolpy_reset_flags(resetmethod):
195207
BUILDERS=dict(
196208
DataToBin=Builder(
197209
action=env.VerboseAction(" ".join([
198-
'"$MKSPIFFSTOOL"',
210+
'"$MKFSTOOL"',
199211
"-c", "$SOURCES",
200-
"-p", "$SPIFFS_PAGE",
201-
"-b", "$SPIFFS_BLOCK",
202-
"-s", "${SPIFFS_END - SPIFFS_START}",
212+
"-p", "$FS_PAGE",
213+
"-b", "$FS_BLOCK",
214+
"-s", "${FS_END - FS_START}",
203215
"$TARGET"
204-
]), "Building SPIFFS image from '$SOURCES' directory to $TARGET"),
205-
emitter=__fetch_spiffs_size,
216+
]), "Building file system image from '$SOURCES' directory to $TARGET"),
217+
emitter=__fetch_fs_size,
206218
source_factory=env.Dir,
207219
suffix=".bin"
208220
)
@@ -211,22 +223,25 @@ def get_esptoolpy_reset_flags(resetmethod):
211223

212224

213225
#
214-
# Target: Build executable and linkable firmware or SPIFFS image
226+
# Target: Build executable and linkable firmware or file system image
215227
#
216228

217229
target_elf = None
218230
if "nobuild" in COMMAND_LINE_TARGETS:
219231
target_elf = join("$BUILD_DIR", "${PROGNAME}.elf")
220232
if set(["uploadfs", "uploadfsota"]) & set(COMMAND_LINE_TARGETS):
221-
fetch_spiffs_size(env)
222-
target_firm = join("$BUILD_DIR", "%s.bin" % env.get("SPIFFSNAME", "spiffs"))
233+
fetch_fs_size(env)
234+
target_firm = join("$BUILD_DIR", "${ESP8266_FS_IMAGE_NAME}.bin")
223235
else:
224236
target_firm = join("$BUILD_DIR", "${PROGNAME}.bin")
225237
else:
226238
target_elf = env.BuildProgram()
227239
if set(["buildfs", "uploadfs", "uploadfsota"]) & set(COMMAND_LINE_TARGETS):
240+
if filesystem not in ("littlefs", "spiffs"):
241+
sys.stderr.write("Filesystem %s is not supported!\n" % filesystem)
242+
env.Exit(1)
228243
target_firm = env.DataToBin(
229-
join("$BUILD_DIR", env.get("SPIFFSNAME", "spiffs")), "$PROJECTDATA_DIR")
244+
join("$BUILD_DIR", "${ESP8266_FS_IMAGE_NAME}"), "$PROJECTDATA_DIR")
230245
AlwaysBuild(target_firm)
231246
else:
232247
target_firm = env.ElfToBin(
@@ -260,7 +275,7 @@ def get_esptoolpy_reset_flags(resetmethod):
260275
)
261276

262277
#
263-
# Target: Upload firmware or SPIFFS image
278+
# Target: Upload firmware or filesystem image
264279
#
265280

266281
upload_protocol = env.subst("$UPLOAD_PROTOCOL")
@@ -318,7 +333,7 @@ def get_esptoolpy_reset_flags(resetmethod):
318333
"--port", '"$UPLOAD_PORT"',
319334
"--baud", "$UPLOAD_SPEED",
320335
"write_flash",
321-
"$SPIFFS_START"
336+
"$FS_START"
322337
],
323338
UPLOADCMD='"$PYTHONEXE" "$UPLOADER" $UPLOADERFLAGS $SOURCE',
324339
)

platform.json

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
"name": "espressif8266",
33
"title": "Espressif 8266",
44
"description": "Espressif Systems is a privately held fabless semiconductor company. They provide wireless communications and Wi-Fi chips which are widely used in mobile devices and the Internet of Things applications.",
5-
"url": "https://espressif.com/",
6-
"homepage": "http://platformio.org/platforms/espressif8266",
5+
"homepage": "https://espressif.com/",
76
"license": "Apache-2.0",
87
"engines": {
98
"platformio": "<5"
@@ -12,7 +11,7 @@
1211
"type": "git",
1312
"url": "https://github.com/platformio/platform-espressif8266.git"
1413
},
15-
"version": "2.5.3",
14+
"version": "2.6.0",
1615
"packageRepositories": [
1716
"https://dl.bintray.com/platformio/dl-packages/manifest.json",
1817
"http://dl.platformio.org/packages/manifest.json",
@@ -33,14 +32,14 @@
3332
"package": "framework-esp8266-rtos-sdk",
3433
"script": "builder/frameworks/esp8266-rtos-sdk.py",
3534
"description": "ESP8266 SDK based on FreeRTOS, a truly free professional grade RTOS for microcontrollers",
36-
"url": "https://github.com/espressif/ESP8266_RTOS_SDK",
35+
"homepage": "https://github.com/espressif/ESP8266_RTOS_SDK",
3736
"title": "ESP8266 RTOS SDK"
3837
},
3938
"esp8266-nonos-sdk": {
4039
"package": "framework-esp8266-nonos-sdk",
4140
"script": "builder/frameworks/esp8266-nonos-sdk.py",
4241
"description": "The non-OS SDK provides a set of application programming interfaces (APIs) for core ESP8266 functionalities such as data reception/transmission over Wi-Fi, TCP/IP stack functions, hardware interface functions and basic system management functions",
43-
"url": "https://github.com/espressif/ESP8266_NONOS_SDK",
42+
"homepage": "https://github.com/espressif/ESP8266_NONOS_SDK",
4443
"title": "ESP8266 Non-OS SDK"
4544
}
4645
},
@@ -52,7 +51,7 @@
5251
"framework-arduinoespressif8266": {
5352
"type": "framework",
5453
"optional": true,
55-
"version": "~3.20701.0"
54+
"version": "~3.20702.0"
5655
},
5756
"framework-esp8266-rtos-sdk": {
5857
"type": "framework",
@@ -81,6 +80,11 @@
8180
"type": "uploader",
8281
"optional": true,
8382
"version": "~1.200.0"
83+
},
84+
"tool-mklittlefs": {
85+
"type": "uploader",
86+
"optional": true,
87+
"version": "~1.203.0"
8488
}
8589
}
8690
}

0 commit comments

Comments
 (0)