Better handling of LD scripts for SPIFFS uploading // Issue #382

This commit is contained in:
Ivan Kravets
2015-12-29 00:21:24 +02:00
parent 5ea7ec470a
commit 11986354d9
2 changed files with 14 additions and 2 deletions

View File

@ -14,7 +14,7 @@
import sys
VERSION = (2, 7, "0.dev5")
VERSION = (2, 7, "0.dev6")
__version__ = ".".join([str(s) for s in VERSION])
__title__ = "platformio"

View File

@ -116,7 +116,7 @@ env.Replace(
],
UPLOADERFSFLAGS=[
"$UPLOADERFLAGS",
"-ca", "${int(SPIFFS_START, 16) & 0xFFFFFF}"
"-ca", "$SPIFFS_START"
],
UPLOADEROTAFLAGS=[
"--debug",
@ -184,6 +184,18 @@ def _fetch_spiffs_size(target, source, env):
assert all([k in env for k in ["SPIFFS_START", "SPIFFS_END", "SPIFFS_PAGE",
"SPIFFS_BLOCK"]])
# esptool flash starts from 0
for k in ("SPIFFS_START", "SPIFFS_END"):
_value = 0
if int(env[k], 16) < 0x40300000:
_value = int(env[k], 16) & 0xFFFFF
else:
_value = int(env[k], 16) & 0xFFFFFF
_value -= 0x200000 # esptool offset
env[k] = hex(_value)
return (target, source)