Skip to content

Commit ab839a2

Browse files
committed
Fix issue with broken examples for NONOS SDK and RTOS SDK // Resolve platformio#62 Resolve platformio#133
1 parent 3166836 commit ab839a2

File tree

6 files changed

+37
-27
lines changed

6 files changed

+37
-27
lines changed

builder/frameworks/esp8266-nonos-sdk.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,22 @@
9999
"airkiss", "at", "c", "crypto", "driver", "espnow", "gcc", "json", "lwip",
100100
"main", "mbedtls", "mesh", "net80211", "phy", "pp", "pwm", "smartconfig",
101101
"ssl", "upgrade", "wpa", "wpa2", "wps"
102+
],
103+
104+
FLASH_EXTRA_IMAGES=[
105+
("0x00000", join("$BUILD_DIR", "eagle.flash.bin")),
106+
("0x10000", join("$BUILD_DIR", "eagle.irom0text.bin")),
107+
("0x1fc000" if env.BoardConfig().get(
108+
"upload.maximum_size", 0) < 4194304 else "0x3fc000",
109+
join(FRAMEWORK_DIR, "bin", "esp_init_data_default.bin"))
102110
]
103111
)
104112

105113
# copy CCFLAGS to ASFLAGS (-x assembler-with-cpp mode)
106114
env.Append(ASFLAGS=env.get("CCFLAGS", [])[:])
107115

108116
env.Replace(
109-
LDSCRIPT_PATH=[join(FRAMEWORK_DIR, "ld", "eagle.app.v6.ld")],
110-
UPLOAD_ADDRESS="0x10000"
117+
LDSCRIPT_PATH=join(FRAMEWORK_DIR, "ld", "eagle.app.v6.ld")
111118
)
112119

113120
#

builder/frameworks/esp8266-rtos-sdk.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,22 @@
9999
"cirom", "crypto", "driver", "espconn", "espnow", "freertos", "gcc",
100100
"json", "hal", "lwip", "main", "mesh", "mirom", "net80211", "nopoll",
101101
"phy", "pp", "pwm", "smartconfig", "spiffs", "ssl", "wpa", "wps"
102+
],
103+
104+
FLASH_EXTRA_IMAGES=[
105+
("0x00000", join("$BUILD_DIR", "eagle.flash.bin")),
106+
("0x10000", join("$BUILD_DIR", "eagle.irom0text.bin")),
107+
("0x1fc000" if env.BoardConfig().get(
108+
"upload.maximum_size", 0) < 4194304 else "0x3fc000",
109+
join(FRAMEWORK_DIR, "bin", "esp_init_data_default.bin"))
102110
]
103111
)
104112

105113
# copy CCFLAGS to ASFLAGS (-x assembler-with-cpp mode)
106114
env.Append(ASFLAGS=env.get("CCFLAGS", [])[:])
107115

108116
env.Replace(
109-
LDSCRIPT_PATH=[join(FRAMEWORK_DIR, "ld", "eagle.app.v6.ld")],
110-
UPLOAD_ADDRESS="0x20000"
117+
LDSCRIPT_PATH=join(FRAMEWORK_DIR, "ld", "eagle.app.v6.ld"),
111118
)
112119

113120
#

builder/main.py

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,6 @@ def _update_max_upload_size(env):
142142

143143
ARFLAGS=["rc"],
144144

145-
#
146-
# Packages
147-
#
148-
149-
FRAMEWORK_ARDUINOESP8266_DIR=platform.get_package_dir(
150-
"framework-arduinoespressif8266"),
151-
SDK_ESP8266_DIR=platform.get_package_dir("sdk-esp8266"),
152-
153145
#
154146
# Misc
155147
#
@@ -215,9 +207,10 @@ def _update_max_upload_size(env):
215207
ElfToBin=Builder(
216208
action=env.VerboseAction(" ".join([
217209
'"$OBJCOPY"',
218-
"-eo",
219-
'"%s"' % join("$FRAMEWORK_ARDUINOESP8266_DIR",
220-
"bootloaders", "eboot", "eboot.elf"),
210+
"-eo", '"%s"' % join(
211+
platform.get_package_dir(
212+
"framework-arduinoespressif8266"),
213+
"bootloaders", "eboot", "eboot.elf"),
221214
"-bo", "$TARGET",
222215
"-bm", "$BOARD_FLASH_MODE",
223216
"-bf", "${__get_board_f_flash(__env__)}",
@@ -366,14 +359,9 @@ def _update_max_upload_size(env):
366359
UPLOADCMD='$UPLOADER $UPLOADERFLAGS -cf $SOURCE',
367360
)
368361
if env.subst("$PIOFRAMEWORK") not in ("arduino", "simba"): # SDK
369-
env.Append(
370-
UPLOADERFLAGS=[
371-
"-ca", "0x00000",
372-
"-cf", "${SOURCES[0]}",
373-
"-ca", "$UPLOAD_ADDRESS",
374-
"-cf", "${SOURCES[1]}"
375-
]
376-
)
362+
for image in env.get("FLASH_EXTRA_IMAGES", []):
363+
env.Append(
364+
UPLOADERFLAGS=["-ca", image[0], "-cf", env.subst(image[1])])
377365
env.Replace(UPLOADCMD="$UPLOADER $UPLOADERFLAGS")
378366
elif "uploadfs" in COMMAND_LINE_TARGETS:
379367
env.Append(UPLOADERFLAGS=["-ca", "${hex(SPIFFS_START)}"])

examples/esp8266-nonos-sdk-blink/platformio.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
; Please visit documentation for the other options and examples
99
; http://docs.platformio.org/page/projectconf.html
1010

11+
[env:nodemcuv2]
12+
platform = espressif8266
13+
board = nodemcuv2
14+
framework = esp8266-nonos-sdk
15+
monitor_speed = 74880
16+
1117
[env:esp12e]
1218
platform = espressif8266
1319
board = esp12e

examples/esp8266-rtos-sdk-blink/platformio.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
;
88
; Please visit documentation for the other options and examples
99
; http://docs.platformio.org/page/projectconf.html
10+
11+
[env:nodemcuv2]
12+
platform = espressif8266
13+
framework = esp8266-rtos-sdk
14+
board = nodemcuv2
15+
1016
[env:esp_wroom_02]
1117
platform = espressif8266
1218
framework = esp8266-rtos-sdk

platform.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,6 @@
7676
"type": "uploader",
7777
"optional": true,
7878
"version": "~1.200.0"
79-
},
80-
"sdk-esp8266": {
81-
"optional": true,
82-
"version": "~1.10502.0"
8379
}
8480
}
8581
}

0 commit comments

Comments
 (0)