From 448e2f32a4bd3accef1d4f2429e57fa1579f4d51 Mon Sep 17 00:00:00 2001 From: Julian Davison Date: Wed, 4 Jan 2017 19:56:14 +1300 Subject: [PATCH 1/7] WIP: Flash-stored OTA commands --- boards.txt | 44 ++++ bootloaders/eboot/Makefile | 2 +- bootloaders/eboot/eboot.c | 82 ++++++- bootloaders/eboot/eboot.elf | Bin 10352 -> 17150 bytes bootloaders/eboot/eboot_command.c | 211 +++++++++++++++++- bootloaders/eboot/eboot_command.h | 36 ++- cores/esp8266/Esp.cpp | 4 +- cores/esp8266/Updater.cpp | 3 +- cores/esp8266/core_esp8266_eboot_command.c | 203 ++++++++++++++++- cores/esp8266/eboot_command.h | 36 ++- cores/esp8266/umm_malloc/umm_malloc_cfg.h | 2 + .../ESP8266WiFi/src/WiFiClientSecure.cpp | 2 + platform.txt | 37 ++- programmers.txt | 4 + tools/sdk/ld/eagle.app.v6.common.ld | 2 + tools/sdk/ld/eagle.flash.4m.ld | 7 +- 16 files changed, 644 insertions(+), 31 deletions(-) diff --git a/boards.txt b/boards.txt index 818b26ce25..e068ed5268 100644 --- a/boards.txt +++ b/boards.txt @@ -1004,6 +1004,50 @@ nodemcuv2.menu.FlashSize.4M1M.build.spiffs_blocksize=8192 nodemcuv2.menu.FlashSize.4M1M.build.spiffs_pagesize=256 + + + +nodemcuv2.menu.Debug.Disabled=Disabled +nodemcuv2.menu.Debug.Disabled.build.debug_port= +nodemcuv2.menu.Debug.Serial=Serial +nodemcuv2.menu.Debug.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial +nodemcuv2.menu.Debug.Serial1=Serial1 +nodemcuv2.menu.Debug.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 + +nodemcuv2.menu.DebugLevel.None____=None +nodemcuv2.menu.DebugLevel.None____.build.debug_level= +nodemcuv2.menu.DebugLevel.Core____=Core +nodemcuv2.menu.DebugLevel.Core____.build.debug_level=-DDEBUG_ESP_CORE +nodemcuv2.menu.DebugLevel.SSL_____=Core + SSL +nodemcuv2.menu.DebugLevel.SSL_____.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL +nodemcuv2.menu.DebugLevel.SSL_MEM_=Core + SSL + TLS Mem +nodemcuv2.menu.DebugLevel.SSL_MEM_.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL -DDEBUG_TLS_MEM +nodemcuv2.menu.DebugLevel.WiFic___=Core + WiFi +nodemcuv2.menu.DebugLevel.WiFic___.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI +nodemcuv2.menu.DebugLevel.WiFi____=WiFi +nodemcuv2.menu.DebugLevel.WiFi____.build.debug_level=-DDEBUG_ESP_WIFI +nodemcuv2.menu.DebugLevel.HTTPClient=HTTPClient +nodemcuv2.menu.DebugLevel.HTTPClient.build.debug_level=-DDEBUG_ESP_HTTP_CLIENT +nodemcuv2.menu.DebugLevel.HTTPClient2=HTTPClient + SSL +nodemcuv2.menu.DebugLevel.HTTPClient2.build.debug_level=-DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_SSL +nodemcuv2.menu.DebugLevel.HTTPUpdate=HTTPUpdate +nodemcuv2.menu.DebugLevel.HTTPUpdate.build.debug_level=-DDEBUG_ESP_HTTP_UPDATE +nodemcuv2.menu.DebugLevel.HTTPUpdate2=HTTPClient + HTTPUpdate +nodemcuv2.menu.DebugLevel.HTTPUpdate2.build.debug_level=-DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_UPDATE +nodemcuv2.menu.DebugLevel.HTTPUpdate3=HTTPClient + HTTPUpdate + Updater +nodemcuv2.menu.DebugLevel.HTTPUpdate3.build.debug_level=-DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER +nodemcuv2.menu.DebugLevel.HTTPServer=HTTPServer +nodemcuv2.menu.DebugLevel.HTTPServer.build.debug_level=-DDEBUG_ESP_HTTP_SERVER +nodemcuv2.menu.DebugLevel.UPDATER=Updater +nodemcuv2.menu.DebugLevel.UPDATER.build.debug_level=-DDEBUG_ESP_UPDATER +nodemcuv2.menu.DebugLevel.OTA_____=OTA +nodemcuv2.menu.DebugLevel.OTA_____.build.debug_level=-DDEBUG_ESP_OTA +nodemcuv2.menu.DebugLevel.OTA2____=OTA + Updater +nodemcuv2.menu.DebugLevel.OTA2____.build.debug_level=-DDEBUG_ESP_OTA -DDEBUG_ESP_UPDATER +nodemcuv2.menu.DebugLevel.all_____=All +nodemcuv2.menu.DebugLevel.all_____.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_TLS_MEM + + ############################################################## modwifi.name=Olimex MOD-WIFI-ESP8266(-DEV) diff --git a/bootloaders/eboot/Makefile b/bootloaders/eboot/Makefile index e078263caa..6ccf45f532 100644 --- a/bootloaders/eboot/Makefile +++ b/bootloaders/eboot/Makefile @@ -18,7 +18,7 @@ LD := $(XTENSA_TOOLCHAIN)xtensa-lx106-elf-gcc OBJDUMP := $(XTENSA_TOOLCHAIN)xtensa-lx106-elf-objdump -CFLAGS += -std=gnu99 +CFLAGS += -std=gnu99 -DEBOOT_ENABLE_FLASH_STORAGE CFLAGS += -O0 -g -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mno-text-section-literals diff --git a/bootloaders/eboot/eboot.c b/bootloaders/eboot/eboot.c index 69bc692e97..2c6082db3b 100644 --- a/bootloaders/eboot/eboot.c +++ b/bootloaders/eboot/eboot.c @@ -32,15 +32,65 @@ int print_version(const uint32_t flash_addr) return 0; } +int print_flags(const uint32_t flash_addr) +{ + const char* __attribute__ ((aligned (4))) fmtt = "#%08x\n\0\0"; + uint32_t ver, i; + uint32_t fmt[2]; + eboot_flash_command_t cmd; + fmt[0] = ((uint32_t*) fmtt)[0]; + fmt[1] = ((uint32_t*) fmtt)[1]; + ver = commandAddress(); + ets_putc('<'); + ets_printf((const char*) fmt, ver); + ets_putc('\n'); + for (i = 0; i < 8; i++) { + ets_putc('0' + i); + ets_putc(':'); + readBootCommand(i, &cmd); + ets_printf((const char*) fmt, cmd.flags); + } + ets_putc('D'); + ets_putc('o'); + ets_putc('n'); + ets_putc('e'); + ets_putc('!'); + ets_putc('\n'); + return 0; +} + +int find_app_start(const uint32_t flash_addr) +{ + image_header_t image_header; + uint32_t pos = flash_addr; + uint8_t count = 0; + + do { + pos += APP_START_OFFSET; + if (SPIRead(pos, &image_header, sizeof(image_header))) { + return 0; + } + count += 1; + } while ((image_header.magic != 0xe9) && (count < 4)); + return pos; +} + int load_app_from_flash_raw(const uint32_t flash_addr) { image_header_t image_header; - uint32_t pos = flash_addr + APP_START_OFFSET; + uint32_t pos = find_app_start(flash_addr); + const char* __attribute__ ((aligned (4))) fmtt = "l:%08x\n\0"; + uint32_t ver, i; + uint32_t fmt[2]; + fmt[0] = ((uint32_t*) fmtt)[0]; + fmt[1] = ((uint32_t*) fmtt)[1]; - if (SPIRead(pos, &image_header, sizeof(image_header))) { + ets_printf((const char*) fmt, pos); + if (SPIRead(pos, &image_header, sizeof(image_header))) { return 1; } pos += sizeof(image_header); + ets_printf((const char*) fmt, pos); for (uint32_t section_index = 0; @@ -55,6 +105,13 @@ int load_app_from_flash_raw(const uint32_t flash_addr) const uint32_t address = section_header.address; + ets_putc('f'); + ets_printf((const char*) fmt, pos); + ets_putc('t'); + ets_printf((const char*) fmt, address); + ets_putc('s'); + ets_printf((const char*) fmt, section_header.size); + bool load = false; if (address < 0x40000000) { @@ -74,8 +131,14 @@ int load_app_from_flash_raw(const uint32_t flash_addr) continue; } + ets_putc('l'); + ets_putc('o'); + if (SPIRead(pos, (void*)address, section_header.size)) return 3; + ets_putc('a'); + ets_putc('d'); + ets_putc('\n'); pos += section_header.size; } @@ -93,6 +156,18 @@ int copy_raw(const uint32_t src_addr, const uint32_t dst_addr, const uint32_t size) { + const char* __attribute__ ((aligned (4))) fmtt = ":%08x\n\0\0"; + uint32_t fmt[2]; + fmt[0] = ((uint32_t*) fmtt)[0]; + fmt[1] = ((uint32_t*) fmtt)[1]; + + ets_putc('S'); + ets_printf((const char*) fmt, src_addr); + ets_putc('D'); + ets_printf((const char*) fmt, dst_addr); + ets_putc('B'); + ets_printf((const char*) fmt, size); + // require regions to be aligned if (src_addr & 0xfff != 0 || dst_addr & 0xfff != 0) { @@ -131,10 +206,10 @@ void main() struct eboot_command cmd; print_version(0); + print_flags(0); if (eboot_command_read(&cmd) == 0) { // valid command was passed via RTC_MEM - eboot_command_clear(); ets_putc('@'); } else { // no valid command found @@ -150,6 +225,7 @@ void main() ets_wdt_enable(); ets_putc('0'+res); ets_putc('\n'); if (res == 0) { + eboot_command_clear(); cmd.action = ACTION_LOAD_APP; cmd.args[0] = cmd.args[1]; } diff --git a/bootloaders/eboot/eboot.elf b/bootloaders/eboot/eboot.elf index 1ccbe25fc312cfa70690fa91a8737c38c2aa678f..e9e1d67ed8a885ffe302c644cf6d9d4e94906581 100755 GIT binary patch literal 17150 zcmd6O3v^u7dG6k4j$YPS^AM7sSfjCxM+9kPVTf$(=wZvXW5XERfVoi^kEF3JkThau zWaC_4%XP6Acj2x?hNL7>RumvoRJJ^SG&6IS!>SzU;F?6{qMd1z0W>pM!VLpmQo6HS>g^s?Bp-~?MqPF*W>09 zVu=We5)lzT;Z^)sO@&D%>+<&>!awJ47x>Ne3c+8AqnrBQ27bAVJilLvGavZd=dKg& zCl`qJw*kNTG0}bjWiFR%%jJCSxlskj&jGi83p=PY_pE3apA_xu@e^fYD^%?}*DTs6 zqN4rTE05V78=DtH^Y=thY~6z&>bw;^cDmxp_r7*fHpE(E^*_#CJ%3%Bca{8c?x+xl zHhO~x%b=zH^<0B5;)_@fQQU(KZLM|pN9B(wHQitlXt~*3SbomSNWomdi+8UL|m9B@K(rWO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F9Wxa$IzvQV| z$Q>z}BgtZhne;jrGD|l1;v^s~6idkh4g>1kWoE<{z%1lx$1m-h)9LKtVs;A~9vbK` z!0<3mqWOaKSL&PQ!To0c!Cn1B;#{`7e|XohX|6DYBO@kGj)#*ISqxCPXBk*FSV+o2 zEaQw!nb=umQ#e2`<6-EfLUJlMJu$(|^c2pwT{KQQlR}Axib32dPA($c6lfa!k#xyS zXNwekM#o?3!jj%c2bm=STyi>E?gxBa9Op`2E^=22UH|R7DSXxdtjVwZQ6OuJ0D5fVzdIg5?xygR88;x-oC+p_-8x&Esp?Z!kVS(*okwYIIk}m9!znFqWQBKw02`b-V WmX8X$BI&C`CQsTbTq>Q(`~Lw=B=kA} diff --git a/bootloaders/eboot/eboot_command.c b/bootloaders/eboot/eboot_command.c index 648039e48a..b0800b6fe6 100644 --- a/bootloaders/eboot/eboot_command.c +++ b/bootloaders/eboot/eboot_command.c @@ -1,4 +1,5 @@ #include "eboot_command.h" +#include "flash.h" uint32_t crc_update(uint32_t crc, const uint8_t *data, size_t length) { @@ -28,7 +29,147 @@ uint32_t eboot_command_calculate_crc32(const struct eboot_command* cmd) offsetof(struct eboot_command, crc32)); } -int eboot_command_read(struct eboot_command* cmd) +#if defined (EBOOT_ENABLE_FLASH_STORAGE) + +uint32_t eboot_read_flash_index(eboot_index_t *eboot_index) +{ + if (SPIRead(0 + APP_START_OFFSET + sizeof(image_header_t) + sizeof(section_header_t), &eboot_index, sizeof(eboot_index))) { + return 0; + } + + if (eboot_index->magic != EBOOT_INDEX_MAGIC_V1) { + return 0; + } + + return 1; +} + +eboot_flash_command_t *commandAddress(void) { + eboot_index_t eboot_index; + const uint32_t addr = 0 + APP_START_OFFSET + sizeof(image_header_t) + sizeof(section_header_t); + if (SPIRead(addr, (uint32_t *)&eboot_index, sizeof(eboot_index))) { + return NULL; + } + if (eboot_index.magic != EBOOT_INDEX_MAGIC_V1) { + return NULL; + } else { + return eboot_index.commands; + } +} + +bool readBootCommand(int cmd, eboot_flash_command_t *dst) { + eboot_flash_command_t *cmds = commandAddress(); + if (cmd >= EBOOT_COMMAND_MAX_COUNT) { + return 0; + } + ets_putc('r'); + ets_putc('b'); + ets_putc('0' + cmd); + ets_putc('\n'); + uint32_t uint = (uint32_t) cmds; + uint32_t addr = (uint32_t)cmds - 0x40200000; + addr += cmd * sizeof(*dst); + if (SPIRead(addr, (uint32_t *)dst, sizeof(*dst))) { + return 0; + } +} + +bool writeBootCommand(int cmd, eboot_flash_command_t *dst) { + eboot_flash_command_t *cmds = commandAddress(); + if (cmd >= EBOOT_COMMAND_MAX_COUNT) { + return 0; + } + ets_putc('w'); + ets_putc('b'); + ets_putc('0' + cmd); + ets_putc('\n'); + uint32_t uint = (uint32_t) cmds; + uint32_t addr = (uint32_t)cmds - 0x40200000; + addr += cmd * sizeof(*dst); + if (SPIWrite(addr, (uint32_t *)dst, sizeof(*dst))) { + return 0; + } +} + +uint32_t eboot_command_read_from_flash(struct eboot_command *cmd) +{ + + eboot_flash_command_t flash_command; + uint32_t i, *src, *dst = (uint32_t *)cmd; + const uint32_t dw_count = sizeof(struct eboot_command) / sizeof(uint32_t); + // ets_printf("Reading command from flash: %p\n", cmd); + + for (i = 0; i < EBOOT_COMMAND_MAX_COUNT; i++) { + // ets_printf("Read bootCommand %d, flags: %x\n", i, flash_command.flags); + readBootCommand(i, &flash_command); + // ets_printf("Read bootCommand %d, flags: %x\n", i, flash_command.flags); + if (((flash_command.flags & EBOOT_CMD_FLAG_SLOT_FREE) == 0) && + ((flash_command.flags & EBOOT_CMD_FLAG_PENDING) == EBOOT_CMD_FLAG_PENDING)) { + // Not free (meaning there's some data) and pending (so it's yet to be completed) + ets_putc('r'); + ets_putc('c'); + ets_putc('0' + i); + ets_putc('\n'); + src = (uint32_t *)&flash_command.cmd; + for (uint32_t j = 0; j < dw_count; ++j) { + dst[j] = src[j]; + } + // ets_printf("Returning bootCommand %d, flags: %x\n", i, flash_command.flags); + return 1; + } + } + return 0; +} + +uint32_t eboot_command_write_to_flash(struct eboot_command *cmd) +{ + eboot_flash_command_t flash_command; + uint32_t i, *dst, *src = (uint32_t *)cmd; + const uint32_t dw_count = sizeof(struct eboot_command) / sizeof(uint32_t); + + for (i = 0; i < EBOOT_COMMAND_MAX_COUNT; i++) { + readBootCommand(i, &flash_command); + if (((flash_command.flags & EBOOT_CMD_FLAG_SLOT_FREE) == EBOOT_CMD_FLAG_SLOT_FREE) && + ((flash_command.flags & EBOOT_CMD_FLAG_PENDING) == EBOOT_CMD_FLAG_PENDING)) { + ets_putc('w'); + ets_putc('c'); + ets_putc('0' + i); + ets_putc('\n'); + dst = (uint32_t *)&flash_command.cmd; + for (uint32_t j = 0; j < dw_count; ++j) { + dst[j] = src[j]; + } + flash_command.flags &= ~EBOOT_CMD_FLAG_SLOT_FREE; + writeBootCommand(i, &flash_command); + return 1; + } + } + return 0; +} + +uint32_t eboot_command_clear_flash(void) +{ + eboot_flash_command_t flash_command; + uint32_t i; + + for (i = 0; i < EBOOT_COMMAND_MAX_COUNT; i++) { + readBootCommand(i, &flash_command); + if (((flash_command.flags & EBOOT_CMD_FLAG_SLOT_FREE) == 0) && + ((flash_command.flags & EBOOT_CMD_FLAG_PENDING) == EBOOT_CMD_FLAG_PENDING)) { + flash_command.flags &= ~EBOOT_CMD_FLAG_PENDING; + // ets_printf("Clearing bootCommand %d, flags: %x\n", i, flash_command.flags); + ets_wdt_disable(); + writeBootCommand(i, &flash_command); + ets_wdt_enable(); + return 1; + } + } + return 0; +} + +#endif // EBOOT_ENABLE_FLASH_STORAGE + +int eboot_command_read_from_rtc(struct eboot_command *cmd) { const uint32_t dw_count = sizeof(struct eboot_command) / sizeof(uint32_t); uint32_t* dst = (uint32_t *) cmd; @@ -36,12 +177,61 @@ int eboot_command_read(struct eboot_command* cmd) dst[i] = RTC_MEM[i]; } + return 0; +} + +int eboot_command_write_to_rtc(struct eboot_command *cmd) +{ + const uint32_t dw_count = sizeof(struct eboot_command) / sizeof(uint32_t); + const uint32_t* src = (const uint32_t *) cmd; + for (uint32_t i = 0; i < dw_count; ++i) { + RTC_MEM[i] = src[i]; + } +} + +void eboot_command_clear_rtc(void) +{ + RTC_MEM[offsetof(struct eboot_command, magic) / sizeof(uint32_t)] = 0; + RTC_MEM[offsetof(struct eboot_command, crc32) / sizeof(uint32_t)] = 0; +} + +int eboot_command_read(struct eboot_command* cmd) +{ + uint32_t have_command = 0; + uint32_t count = 0; +#if defined (EBOOT_ENABLE_FLASH_STORAGE) + ets_putc('F'); + ets_putc(':'); + have_command = eboot_command_read_from_flash(cmd); + ets_putc('0' + have_command); + ets_putc('\n'); +#endif // EBOOT_ENABLE_FLASH_STORAGE + if (have_command == 0) { + ets_putc('R'); + ets_putc('-'); + eboot_command_read_from_rtc(cmd); + count = cmd->args[28]; + cmd->args[28] = 0; + ets_putc('0' + count); + ets_putc('\n'); + } + uint32_t crc32 = eboot_command_calculate_crc32(cmd); if (cmd->magic & EBOOT_MAGIC_MASK != EBOOT_MAGIC || cmd->crc32 != crc32) { return 1; } + if (count >= 3) { + ets_putc('R'); + ets_putc('>'); + ets_putc('!'); + ets_putc('\n'); + return 1; + } + + cmd->args[28] = count + 1; + eboot_command_write_to_rtc(cmd); return 0; } @@ -49,17 +239,20 @@ void eboot_command_write(struct eboot_command* cmd) { cmd->magic = EBOOT_MAGIC; cmd->crc32 = eboot_command_calculate_crc32(cmd); - - const uint32_t dw_count = sizeof(struct eboot_command) / sizeof(uint32_t); - const uint32_t* src = (const uint32_t *) cmd; - for (uint32_t i = 0; i < dw_count; ++i) { - RTC_MEM[i] = src[i]; - } +#if defined (EBOOT_ENABLE_FLASH_STORAGE) + eboot_command_write_to_flash(cmd); +#endif // EBOOT_ENABLE_FLASH_STORAGE + eboot_command_write_to_rtc(cmd); } void eboot_command_clear() { - RTC_MEM[offsetof(struct eboot_command, magic) / sizeof(uint32_t)] = 0; - RTC_MEM[offsetof(struct eboot_command, crc32) / sizeof(uint32_t)] = 0; + uint32_t cleared = 0; +#if defined (EBOOT_ENABLE_FLASH_STORAGE) + cleared = eboot_command_clear_flash(); +#endif // EBOOT_ENABLE_FLASH_STORAGE + if (cleared > 0) { + eboot_command_clear_rtc(); + } } diff --git a/bootloaders/eboot/eboot_command.h b/bootloaders/eboot/eboot_command.h index ba9c889a2c..dd9b092199 100644 --- a/bootloaders/eboot/eboot_command.h +++ b/bootloaders/eboot/eboot_command.h @@ -22,13 +22,45 @@ enum action_t { #define EBOOT_MAGIC 0xeb001000 #define EBOOT_MAGIC_MASK 0xfffff000 -struct eboot_command { +typedef struct eboot_command { uint32_t magic; enum action_t action; uint32_t args[29]; uint32_t crc32; -}; +} eboot_command_t; + + +#if defined (EBOOT_ENABLE_FLASH_STORAGE) +// Magic for version 1 corresponds to AR01 +#define EBOOT_INDEX_MAGIC_V1 0x31305241 +#define EBOOT_COMMAND_MAX_COUNT 8 + + +#define FLASH_SECTOR_SIZE 0x1000 + + +/* A command is ready to be actioned if it is both + * Not free (SLOT_FREE == 0) AND + * pending (PENDING == 1) +*/ + +// Is the slot available for new command data (1 == Yes; 0 == It's been used, so No) +#define EBOOT_CMD_FLAG_SLOT_FREE (1 << 0) +// Has the command been actioned (1 == No, needs to be actioned; 0 == It's been completed) +#define EBOOT_CMD_FLAG_PENDING (1 << 1) + +typedef struct eboot_flash_command { + uint32_t flags; + eboot_command_t cmd; +} eboot_flash_command_t; + +typedef struct eboot_index { + uint32_t version; + uint32_t magic; + eboot_flash_command_t *commands; +} eboot_index_t; +#endif // EBOOT_ENABLE_FLASH_STORAGE int eboot_command_read(struct eboot_command* cmd); void eboot_command_write(struct eboot_command* cmd); diff --git a/cores/esp8266/Esp.cpp b/cores/esp8266/Esp.cpp index e013fa837e..5cd0cd279f 100644 --- a/cores/esp8266/Esp.cpp +++ b/cores/esp8266/Esp.cpp @@ -446,14 +446,14 @@ uint32_t EspClass::getSketchSize() { return result; } -extern "C" uint32_t _SPIFFS_start; +extern "C" uint32_t _SKETCH_AREA_end; uint32_t EspClass::getFreeSketchSpace() { uint32_t usedSize = getSketchSize(); // round one sector up uint32_t freeSpaceStart = (usedSize + FLASH_SECTOR_SIZE - 1) & (~(FLASH_SECTOR_SIZE - 1)); - uint32_t freeSpaceEnd = (uint32_t)&_SPIFFS_start - 0x40200000; + uint32_t freeSpaceEnd = (uint32_t)&_SKETCH_AREA_end - 0x40200000; #ifdef DEBUG_SERIAL DEBUG_SERIAL.printf("usedSize=%u freeSpaceStart=%u freeSpaceEnd=%u\r\n", usedSize, freeSpaceStart, freeSpaceEnd); diff --git a/cores/esp8266/Updater.cpp b/cores/esp8266/Updater.cpp index 258d899c3a..5e271bfa4f 100644 --- a/cores/esp8266/Updater.cpp +++ b/cores/esp8266/Updater.cpp @@ -11,6 +11,7 @@ extern "C" { #include "user_interface.h" } +extern "C" uint32_t _SKETCH_AREA_end; extern "C" uint32_t _SPIFFS_start; UpdaterClass::UpdaterClass() @@ -76,7 +77,7 @@ bool UpdaterClass::begin(size_t size, int command) { //size of current sketch rounded to a sector uint32_t currentSketchSize = (ESP.getSketchSize() + FLASH_SECTOR_SIZE - 1) & (~(FLASH_SECTOR_SIZE - 1)); //address of the end of the space available for sketch and update - uint32_t updateEndAddress = (uint32_t)&_SPIFFS_start - 0x40200000; + uint32_t updateEndAddress = (uint32_t)&_SKETCH_AREA_end - 0x40200000; //size of the update rounded to a sector uint32_t roundedSize = (size + FLASH_SECTOR_SIZE - 1) & (~(FLASH_SECTOR_SIZE - 1)); //address where we will start writing the update diff --git a/cores/esp8266/core_esp8266_eboot_command.c b/cores/esp8266/core_esp8266_eboot_command.c index ee3ccb4809..d5cadaf54f 100644 --- a/cores/esp8266/core_esp8266_eboot_command.c +++ b/cores/esp8266/core_esp8266_eboot_command.c @@ -21,7 +21,11 @@ #include #include +#include #include "eboot_command.h" +#include "c_types.h" +#include "flash_utils.h" +#include "spi_flash.h" uint32_t crc_update(uint32_t crc, const uint8_t *data, size_t length) { @@ -51,7 +55,157 @@ uint32_t eboot_command_calculate_crc32(const struct eboot_command* cmd) offsetof(struct eboot_command, crc32)); } -int eboot_command_read(struct eboot_command* cmd) +#if defined (EBOOT_ENABLE_FLASH_STORAGE) + +uint32_t eboot_get_flash_block_size(void) { + return 2 * 4 * 1024; +} + +uint32_t eboot_read_flash_index(eboot_index_t *eboot_index) +{ + if (spi_flash_read(0 + APP_START_OFFSET + sizeof(image_header_t) + sizeof(section_header_t), (uint32_t *) &eboot_index, sizeof(eboot_index)) != 0) { + return 0; + } + + if (eboot_index->magic != EBOOT_INDEX_MAGIC_V1) { + return 0; + } + + return 1; +} + +eboot_flash_command_t *commandAddress(void) { + eboot_index_t eboot_index; + const uint32_t addr = 0 + APP_START_OFFSET + sizeof(image_header_t) + sizeof(section_header_t); + ets_printf("commandAddress: %p\n", addr); + if (spi_flash_read(addr, (uint32_t *)&eboot_index, sizeof(eboot_index)) != 0) { + ets_printf("failed to read SPI\n"); + return NULL; + } + if (eboot_index.magic != EBOOT_INDEX_MAGIC_V1) { + ets_printf("failed to find MAGIC value (had %x)\n", eboot_index.magic); + return NULL; + } else { + return eboot_index.commands; + } +} + +bool readBootCommand(int cmd, eboot_flash_command_t *dst) { + eboot_flash_command_t *cmds = commandAddress(); + if (cmds == 0) { + return 0; + } + ets_printf("Reading command %d from flash: %p\n", cmd, cmds); + if (cmd >= EBOOT_COMMAND_MAX_COUNT) { + return 0; + } + uint32_t uint = (uint32_t) cmds; + uint32_t addr = (uint32_t)cmds - 0x40200000; + addr += cmd * sizeof(*dst); + ets_printf("Reading command %d from flash @ %p\n", cmd, addr); + if (spi_flash_read(addr, (uint32_t *)dst, sizeof(*dst))) { + return 0; + } + return 1; +} + +bool writeBootCommand(int cmd, eboot_flash_command_t *dst) { + eboot_flash_command_t *cmds = commandAddress(); + ets_printf("!Writing command %d to flash: %p\n", cmd, cmds); + if (cmd >= EBOOT_COMMAND_MAX_COUNT) { + return 0; + } + uint32_t uint = (uint32_t) cmds; + uint32_t addr = (uint32_t)cmds - 0x40200000; + addr += cmd * sizeof(*dst); + ets_printf("Writing command %d to flash @ %p\n", cmd, addr); + if (spi_flash_write(addr, (uint32_t *)dst, sizeof(*dst))) { + return 0; + } +} + +bool eraseBootCommandBlock(void) { + eboot_flash_command_t *cmds = commandAddress(); + uint32_t addr = (uint32_t)cmds - 0x40200000; + ets_printf("Erasing command block at %p\n", addr); + if (spi_flash_erase_sector(addr / FLASH_SECTOR_SIZE)) { + return 0; + } + return 1; +} + +uint32_t eboot_command_read_from_flash(struct eboot_command *cmd) +{ + eboot_index_t eboot_index; + eboot_flash_command_t *flash_command; + uint32_t i; + const uint32_t dw_count = sizeof(struct eboot_command) / sizeof(uint32_t); + + if (!eboot_read_flash_index(&eboot_index)) { + return 0; + } else { + flash_command = eboot_index.commands; + for (i = 0; i < EBOOT_COMMAND_MAX_COUNT; i++) { + if (((flash_command->flags & EBOOT_CMD_FLAG_SLOT_FREE) == 0) && + ((flash_command->flags & EBOOT_CMD_FLAG_PENDING) == EBOOT_CMD_FLAG_PENDING)) { + // This is a valid command waiting to be actioned, or should be. The CRC check will determine if it's actually valid + uint32_t* dst = (uint32_t *) cmd; + // uint32_t* src = (uint32_t *) flash_command->cmd; + // for (uint32_t i = 0; i < dw_count; ++i) { + // dst[i] = src[i]; + // } + return 1; + } + } + } + return 0; +} + +uint32_t eboot_command_write_to_flash(struct eboot_command *cmd) +{ + eboot_flash_command_t flash_command; + uint32_t i, *dst, *src = (uint32_t *)cmd; + int32_t target_command_slot = -1; + const uint32_t dw_count = sizeof(struct eboot_command) / sizeof(uint32_t); + ets_printf("Writing command to flash: %p\n", cmd); + + for (i = 0; i < EBOOT_COMMAND_MAX_COUNT; i++) { + ets_printf("Read bootCommand %d, flags: %x\n", i, flash_command.flags); + if (readBootCommand(i, &flash_command) == 0) { + ets_printf("Reading bootCommand %d failed!\n", i); + } else { + ets_printf("Read bootCommand %d, flags: %x\n", i, flash_command.flags); + if (((flash_command.flags & EBOOT_CMD_FLAG_SLOT_FREE) == EBOOT_CMD_FLAG_SLOT_FREE) && + ((flash_command.flags & EBOOT_CMD_FLAG_PENDING) == EBOOT_CMD_FLAG_PENDING)) { + target_command_slot = i; + break; + } + } + } + if (target_command_slot == -1) { + // We didn't find a free slot. Assume this is due to the slots being all used, + // so erase the storage page + if (eraseBootCommandBlock() != 1) { + return 0; + } + // Block is now clear, so we can use the first slot + target_command_slot = 0; + // And reinitialise our block to a blank one. + readBootCommand(target_command_slot, &flash_command); + } + dst = (uint32_t *)&flash_command.cmd; + for (uint32_t j = 0; j < dw_count; ++j) { + dst[j] = src[j]; + } + flash_command.flags &= ~EBOOT_CMD_FLAG_SLOT_FREE; + ets_printf("Writing command %d to flash: %p\n", target_command_slot, cmd); + writeBootCommand(target_command_slot, &flash_command); + return 1; +} + +#endif // EBOOT_ENABLE_FLASH_STORAGE + +int eboot_command_read_from_rtc(struct eboot_command *cmd) { const uint32_t dw_count = sizeof(struct eboot_command) / sizeof(uint32_t); uint32_t* dst = (uint32_t *) cmd; @@ -59,8 +213,36 @@ int eboot_command_read(struct eboot_command* cmd) dst[i] = RTC_MEM[i]; } + return 0; +} + +int eboot_command_write_to_rtc(struct eboot_command *cmd) +{ + const uint32_t dw_count = sizeof(struct eboot_command) / sizeof(uint32_t); + const uint32_t* src = (const uint32_t *) cmd; + for (uint32_t i = 0; i < dw_count; ++i) { + RTC_MEM[i] = src[i]; + } +} + +void eboot_command_clear_rtc(void) +{ + RTC_MEM[offsetof(struct eboot_command, magic) / sizeof(uint32_t)] = 0; + RTC_MEM[offsetof(struct eboot_command, crc32) / sizeof(uint32_t)] = 0; +} + +int eboot_command_read(struct eboot_command* cmd) +{ + uint32_t have_command = 0; +#if defined (EBOOT_ENABLE_FLASH_STORAGE) + // have_command = eboot_command_read_from_flash(cmd); +#endif // EBOOT_ENABLE_FLASH_STORAGE + if (have_command == 0) { + eboot_command_read_from_rtc(cmd); + } + uint32_t crc32 = eboot_command_calculate_crc32(cmd); - if ((cmd->magic & EBOOT_MAGIC_MASK) != EBOOT_MAGIC || + if (cmd->magic & EBOOT_MAGIC_MASK != EBOOT_MAGIC || cmd->crc32 != crc32) { return 1; } @@ -70,19 +252,22 @@ int eboot_command_read(struct eboot_command* cmd) void eboot_command_write(struct eboot_command* cmd) { + uint32_t saved = 0; cmd->magic = EBOOT_MAGIC; cmd->crc32 = eboot_command_calculate_crc32(cmd); - - const uint32_t dw_count = sizeof(struct eboot_command) / sizeof(uint32_t); - const uint32_t* src = (const uint32_t *) cmd; - for (uint32_t i = 0; i < dw_count; ++i) { - RTC_MEM[i] = src[i]; + ets_printf("Writing command: %p\n", cmd); +#if defined (EBOOT_ENABLE_FLASH_STORAGE) + saved = eboot_command_write_to_flash(cmd); +#endif // EBOOT_ENABLE_FLASH_STORAGE + if (saved == 0) { + eboot_command_write_to_rtc(cmd); } } void eboot_command_clear() { - RTC_MEM[offsetof(struct eboot_command, magic) / sizeof(uint32_t)] = 0; - RTC_MEM[offsetof(struct eboot_command, crc32) / sizeof(uint32_t)] = 0; +#if defined (EBOOT_ENABLE_FLASH_STORAGE) +#endif // EBOOT_ENABLE_FLASH_STORAGE + eboot_command_clear_rtc(); } diff --git a/cores/esp8266/eboot_command.h b/cores/esp8266/eboot_command.h index 3d854afba3..62e20491f2 100644 --- a/cores/esp8266/eboot_command.h +++ b/cores/esp8266/eboot_command.h @@ -17,13 +17,45 @@ enum action_t { #define EBOOT_MAGIC 0xeb001000 #define EBOOT_MAGIC_MASK 0xfffff000 -struct eboot_command { +typedef struct eboot_command { uint32_t magic; enum action_t action; uint32_t args[29]; uint32_t crc32; -}; +} eboot_command_t; + + +#if defined (EBOOT_ENABLE_FLASH_STORAGE) +// Magic for version 1 corresponds to AR01 +#define EBOOT_INDEX_MAGIC_V1 0x31305241 +#define EBOOT_COMMAND_MAX_COUNT 8 + + +#define FLASH_SECTOR_SIZE 0x1000 + + +/* A command is ready to be actioned if it is both + * Not free (SLOT_FREE == 0) AND + * pending (PENDING == 1) +*/ + +// Is the slot available for new command data (1 == Yes; 0 == It's been used, so No) +#define EBOOT_CMD_FLAG_SLOT_FREE (1 << 0) +// Has the command been actioned (1 == No, needs to be actioned; 0 == It's been completed) +#define EBOOT_CMD_FLAG_PENDING (1 << 1) + +typedef struct eboot_flash_command { + uint32_t flags; + eboot_command_t cmd; +} eboot_flash_command_t; + +typedef struct eboot_index { + uint32_t version; + uint32_t magic; + eboot_flash_command_t *commands; +} eboot_index_t; +#endif // EBOOT_ENABLE_FLASH_STORAGE int eboot_command_read(struct eboot_command* cmd); void eboot_command_write(struct eboot_command* cmd); diff --git a/cores/esp8266/umm_malloc/umm_malloc_cfg.h b/cores/esp8266/umm_malloc/umm_malloc_cfg.h index ace0882b45..21ad26d4cc 100644 --- a/cores/esp8266/umm_malloc/umm_malloc_cfg.h +++ b/cores/esp8266/umm_malloc/umm_malloc_cfg.h @@ -131,6 +131,8 @@ extern char _heap_start; * callback is called: `UMM_HEAP_CORRUPTION_CB()` */ +#define DEBUG_ESP_PORT Serial + #if defined(DEBUG_ESP_PORT) || defined(DEBUG_ESP_CORE) #define UMM_POISON #endif diff --git a/libraries/ESP8266WiFi/src/WiFiClientSecure.cpp b/libraries/ESP8266WiFi/src/WiFiClientSecure.cpp index 7e16e594b2..0dbb9f115b 100644 --- a/libraries/ESP8266WiFi/src/WiFiClientSecure.cpp +++ b/libraries/ESP8266WiFi/src/WiFiClientSecure.cpp @@ -40,6 +40,8 @@ extern "C" #include "include/ClientContext.h" #include "c_types.h" +#define DEBUG_ESP_SSL + #ifdef DEBUG_ESP_SSL #define DEBUG_SSL #endif diff --git a/platform.txt b/platform.txt index ea8094077a..56ae6aaa71 100644 --- a/platform.txt +++ b/platform.txt @@ -53,7 +53,7 @@ compiler.esptool.cmd=esptool compiler.esptool.cmd.windows=esptool.exe # This can be overriden in boards.txt -build.extra_flags=-DESP8266 +build.extra_flags=-DESP8266 -DEBOOT_ENABLE_FLASH_STORAGE # These can be overridden in platform.local.txt compiler.c.extra_flags= @@ -120,3 +120,38 @@ tools.esptool.upload.network_pattern="{network_cmd}" "{runtime.platform.path}/to tools.mkspiffs.cmd=mkspiffs tools.mkspiffs.cmd.windows=mkspiffs.exe tools.mkspiffs.path={runtime.platform.path}/tools/mkspiffs + + +# StrobeLoader settings +# ------------------------------ + +tools.sl.path={runtime.tools.sl.path} +tools.sl.cmd.path=curl +tools.sl.config.path={path}/etc/sl.conf + +tools.sl.upload.params.verbose=-v +tools.sl.upload.params.quiet=-q -q +# tools.sl.upload.verify is needed for backwards compatibility with IDE 1.6.8 or older, IDE 1.6.9 or newer overrides this value +tools.sl.upload.verify= +tools.sl.upload.params.noverify=-V +#tools.sl.upload.pattern="{cmd.path}" -X POST -u julian@davison.org.nz:pleb22 -F new_binary=@"{build.path}/{build.project_name}.bin" -F _method=PUT -F automaton=True https://sl.davison.org.nz/fw/thread/1f2e2d40-b10e-11e6-88fe-5bbac7f802bf/new +# "-C{config.path}" {upload.verbose} {upload.verify} -p{build.mcu} -c{upload.protocol} -P{serial.port} -b{upload.speed} -D "-Uflash:w:{build.path}/{build.project_name}.hex:i" + + +tools.sl.program.params.verbose=-v +tools.sl.program.params.quiet=-s -S +# tools.sl.program.verify is needed for backwards compatibility with IDE 1.6.8 or older, IDE 1.6.9 or newer overrides this value +tools.sl.program.verify= +tools.sl.program.params.noverify=-V +tools.sl.program.pattern="{cmd.path}" -X POST -u julian@davison.org.nz:pleb22 -F new_binary=@"{build.path}/{build.project_name}.bin" -F _method=PUT -F automaton=True https://sl.davison.org.nz/fw/thread/1f2e2d40-b10e-11e6-88fe-5bbac7f802bf/new +#tools.sl.program.pattern="{cmd.path}" "-C{config.path}" {program.verbose} {program.verify} -p{build.mcu} -c{protocol} {program.extra_params} #"-Uflash:w:{build.path}/{build.project_name}.hex:i" +# +#tools.sl.erase.params.verbose=-v +#tools.sl.erase.params.quiet=-q -q +tools.sl.erase.pattern="{cmd.path}" "-C{config.path}" {erase.verbose} -p{build.mcu} -c{protocol} {program.extra_params} -e #-Ulock:w:{bootloader.unlock_bits}:m -Uefuse:w:{bootloader.extended_fuses}:m -Uhfuse:w:{bootloader.high_fuses}:m -Ulfuse:w:{bootloader.low_fuses}:m +# +#tools.sl.bootloader.params.verbose=-v +#tools.sl.bootloader.params.quiet=-q -q +tools.sl.bootloader.pattern="{cmd.path}" "-C{config.path}" {bootloader.verbose} -p{build.mcu} -c{protocol} {program.extra_params} #"-Uflash:w:{runtime.platform.path}/bootloaders/{bootloader.file}:i" -Ulock:w:{bootloader.lock_bits}:m +# +#tools.sl_remote.upload.pattern=/usr/bin/run-sl /tmp/sketch.hex {upload.verbose} -p{build.mcu} diff --git a/programmers.txt b/programmers.txt index e69de29bb2..17e0b5f0a0 100644 --- a/programmers.txt +++ b/programmers.txt @@ -0,0 +1,4 @@ +strobeloader.name=StrobeLoader +#strobeloader.protocol=tcp +strobeloader.program.tool=sl +strobeloader.program.extra_params= diff --git a/tools/sdk/ld/eagle.app.v6.common.ld b/tools/sdk/ld/eagle.app.v6.common.ld index d5d8d7ffe0..d262af5c09 100644 --- a/tools/sdk/ld/eagle.app.v6.common.ld +++ b/tools/sdk/ld/eagle.app.v6.common.ld @@ -154,6 +154,8 @@ SECTIONS { _irom0_text_start = ABSOLUTE(.); *(.ver_number) + LONG(0x31305241) + LONG(_BOOTLOADER_DATA) *.c.o( EXCLUDE_FILE (umm_malloc.c.o) .literal*, \ EXCLUDE_FILE (umm_malloc.c.o) .text*) *.cpp.o(.literal*, .text*) diff --git a/tools/sdk/ld/eagle.flash.4m.ld b/tools/sdk/ld/eagle.flash.4m.ld index 04aa3a8f46..d7063d29a1 100644 --- a/tools/sdk/ld/eagle.flash.4m.ld +++ b/tools/sdk/ld/eagle.flash.4m.ld @@ -11,9 +11,14 @@ MEMORY irom0_0_seg : org = 0x40201010, len = 0xfeff0 } -PROVIDE ( _SPIFFS_start = 0x40300000 ); + +_BOOTLOADER_SPIFFS_OFFSET = DEFINED(eboot_get_flash_block_size) ? 0x2000 : 0; + +PROVIDE ( _SPIFFS_start = 0x40300000 + _BOOTLOADER_SPIFFS_OFFSET ); PROVIDE ( _SPIFFS_end = 0x405FB000 ); PROVIDE ( _SPIFFS_page = 0x100 ); PROVIDE ( _SPIFFS_block = 0x2000 ); +PROVIDE ( _BOOTLOADER_DATA = DEFINED(eboot_get_flash_block_size) ? _SPIFFS_start - _BOOTLOADER_SPIFFS_OFFSET : 0 ); +PROVIDE ( _SKETCH_AREA_end = DEFINED(eboot_get_flash_block_size) ? _BOOTLOADER_DATA : _SPIFFS_start ); INCLUDE "../ld/eagle.app.v6.common.ld" From 535bc783613763b169796fe60b227ae76c2ee71e Mon Sep 17 00:00:00 2001 From: Julian Davison Date: Wed, 4 Jan 2017 20:35:40 +1300 Subject: [PATCH 2/7] Test --- bootloaders/eboot/eboot.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bootloaders/eboot/eboot.c b/bootloaders/eboot/eboot.c index 2c6082db3b..882c923f8f 100644 --- a/bootloaders/eboot/eboot.c +++ b/bootloaders/eboot/eboot.c @@ -72,6 +72,9 @@ int find_app_start(const uint32_t flash_addr) } count += 1; } while ((image_header.magic != 0xe9) && (count < 4)); + if (count >= 4) { + return 0; + } return pos; } From 3a333774869f33f24ea5e6e9a3b971545a2fac86 Mon Sep 17 00:00:00 2001 From: Julian Davison Date: Wed, 18 Jan 2017 18:47:46 +1300 Subject: [PATCH 3/7] Sync with upstream, reimport changes. --- bootloaders/eboot/Makefile | 2 +- bootloaders/eboot/README.md | 48 +++++++++++++++++++ bootloaders/eboot/eboot.c | 72 ++++++++++++++++++---------- bootloaders/eboot/eboot.elf | Bin 17150 -> 15743 bytes bootloaders/eboot/eboot.h | 10 ++++ bootloaders/eboot/eboot.ld | 1 + bootloaders/eboot/eboot_command.c | 43 +++++------------ bootloaders/eboot/eboot_command.h | 1 + cores/esp8266/flash_utils.h | 4 +- tools/sdk/ld/eagle.app.v6.common.ld | 1 + 10 files changed, 123 insertions(+), 59 deletions(-) create mode 100644 bootloaders/eboot/README.md create mode 100644 bootloaders/eboot/eboot.h diff --git a/bootloaders/eboot/Makefile b/bootloaders/eboot/Makefile index 6ccf45f532..e078263caa 100644 --- a/bootloaders/eboot/Makefile +++ b/bootloaders/eboot/Makefile @@ -18,7 +18,7 @@ LD := $(XTENSA_TOOLCHAIN)xtensa-lx106-elf-gcc OBJDUMP := $(XTENSA_TOOLCHAIN)xtensa-lx106-elf-objdump -CFLAGS += -std=gnu99 -DEBOOT_ENABLE_FLASH_STORAGE +CFLAGS += -std=gnu99 CFLAGS += -O0 -g -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mno-text-section-literals diff --git a/bootloaders/eboot/README.md b/bootloaders/eboot/README.md new file mode 100644 index 0000000000..c9d9403fb4 --- /dev/null +++ b/bootloaders/eboot/README.md @@ -0,0 +1,48 @@ +eboot Bootloader +=================== + + +A simple bootloader which can copy an OTA update to main application address in flash and load the application code to IRAM. + +# Contents +- [Startup sequence](#startup-sequence) + + +### Startup sequence ### + +On startup the ESP ROM will [load and start the firmware image](#load-and-start) from flash location 0x0 - eboot. + +##### eboot will ##### +1. print a version string from the current firmware image +2. print a list of the flags for the first 8 flash-command slots +3. [attempt to read a command](#read-eboot-command) + 1. execute command (if found) + 2. on completion of the command, mark it complete +4. [load and start the application](#load-and-start) + + + +### Read eboot command ### + +Historically eboot commands were stored in RTC RAM. In an effort to survive a power-outage mid-update (which will claer the RTC RAM) there is now provision for storing the commands in Flash. If no valid command is found in the flash storage (or flash storage is disabled) eboot will try RTC RAM. + +Commands are considered valid if the checksum is correct. + +```C +typedef struct eboot_command { + uint32_t magic; + enum action_t action; + uint32_t args[29]; + uint32_t crc32; +} eboot_command_t; +``` + + +### Load and start ### + +The firmware images are expected to have ELF headers indicating what location each section should be loaded into - which is relevant for the RAM locations. + +Both the ESP bootloader and eboot will work through the image sections copying the contents of the appropriate ones into their address. + +Finally execution jumps to the entry-point specified in the image header. + diff --git a/bootloaders/eboot/eboot.c b/bootloaders/eboot/eboot.c index 882c923f8f..6fede5bd99 100644 --- a/bootloaders/eboot/eboot.c +++ b/bootloaders/eboot/eboot.c @@ -12,6 +12,7 @@ #include #include "flash.h" #include "eboot_command.h" +#include "eboot.h" #define SWRST do { (*((volatile uint32_t*) 0x60000700)) |= 0x80000000; } while(0); @@ -21,10 +22,10 @@ extern void ets_wdt_disable(void); int print_version(const uint32_t flash_addr) { uint32_t ver; - if (SPIRead(flash_addr + APP_START_OFFSET + sizeof(image_header_t) + sizeof(section_header_t), &ver, sizeof(ver))) { + if (SPIRead(find_app_start(flash_addr) + sizeof(image_header_t) + sizeof(section_header_t), &ver, sizeof(ver))) { return 1; } - const char* __attribute__ ((aligned (4))) fmtt = "v%08x\n\0\0"; + const char* __attribute__ ((aligned (4))) fmtt = "v%08x+\n\0"; uint32_t fmt[2]; fmt[0] = ((uint32_t*) fmtt)[0]; fmt[1] = ((uint32_t*) fmtt)[1]; @@ -32,6 +33,8 @@ int print_version(const uint32_t flash_addr) return 0; } +#ifdef EBOOT_ENABLE_FLASH_STORAGE + int print_flags(const uint32_t flash_addr) { const char* __attribute__ ((aligned (4))) fmtt = "#%08x\n\0\0"; @@ -40,48 +43,44 @@ int print_flags(const uint32_t flash_addr) eboot_flash_command_t cmd; fmt[0] = ((uint32_t*) fmtt)[0]; fmt[1] = ((uint32_t*) fmtt)[1]; - ver = commandAddress(); + ets_putc('<'); ets_printf((const char*) fmt, ver); - ets_putc('\n'); - for (i = 0; i < 8; i++) { + for (i = 0; i < EBOOT_COMMAND_SLOT_COUNT; i++) { ets_putc('0' + i); ets_putc(':'); readBootCommand(i, &cmd); ets_printf((const char*) fmt, cmd.flags); } - ets_putc('D'); - ets_putc('o'); - ets_putc('n'); - ets_putc('e'); - ets_putc('!'); ets_putc('\n'); return 0; } +#endif // EBOOT_ENABLE_FLASH_STORAGE + int find_app_start(const uint32_t flash_addr) { image_header_t image_header; uint32_t pos = flash_addr; - uint8_t count = 0; + uint8_t i; - do { + for (i = 0; i < EBOOT_APP_OFFSET_PAGE_LIMIT; i++) { pos += APP_START_OFFSET; if (SPIRead(pos, &image_header, sizeof(image_header))) { return 0; } - count += 1; - } while ((image_header.magic != 0xe9) && (count < 4)); - if (count >= 4) { - return 0; + if (image_header.magic == 0xe9) { + return pos; + } } - return pos; + return 0; } int load_app_from_flash_raw(const uint32_t flash_addr) { image_header_t image_header; uint32_t pos = find_app_start(flash_addr); +#ifdef EBOOT_VERBOSE_STARTUP const char* __attribute__ ((aligned (4))) fmtt = "l:%08x\n\0"; uint32_t ver, i; uint32_t fmt[2]; @@ -89,11 +88,15 @@ int load_app_from_flash_raw(const uint32_t flash_addr) fmt[1] = ((uint32_t*) fmtt)[1]; ets_printf((const char*) fmt, pos); +#endif // EBOOT_VERBOSE_STARTUP if (SPIRead(pos, &image_header, sizeof(image_header))) { return 1; } pos += sizeof(image_header); + + #ifdef EBOOT_VERBOSE_STARTUP ets_printf((const char*) fmt, pos); + #endif // EBOOT_VERBOSE_STARTUP for (uint32_t section_index = 0; @@ -108,12 +111,14 @@ int load_app_from_flash_raw(const uint32_t flash_addr) const uint32_t address = section_header.address; +#ifdef EBOOT_VERBOSE_STARTUP ets_putc('f'); ets_printf((const char*) fmt, pos); ets_putc('t'); ets_printf((const char*) fmt, address); ets_putc('s'); ets_printf((const char*) fmt, section_header.size); +#endif // EBOOT_VERBOSE_STARTUP bool load = false; @@ -134,14 +139,18 @@ int load_app_from_flash_raw(const uint32_t flash_addr) continue; } +#ifdef EBOOT_VERBOSE_STARTUP ets_putc('l'); ets_putc('o'); +#endif // EBOOT_VERBOSE_STARTUP if (SPIRead(pos, (void*)address, section_header.size)) return 3; +#ifdef EBOOT_VERBOSE_STARTUP ets_putc('a'); ets_putc('d'); ets_putc('\n'); +#endif // EBOOT_VERBOSE_STARTUP pos += section_header.size; } @@ -159,6 +168,8 @@ int copy_raw(const uint32_t src_addr, const uint32_t dst_addr, const uint32_t size) { + uint32_t overwrite_eboot = 0; +#ifdef EBOOT_VERBOSE_STARTUP const char* __attribute__ ((aligned (4))) fmtt = ":%08x\n\0\0"; uint32_t fmt[2]; fmt[0] = ((uint32_t*) fmtt)[0]; @@ -170,6 +181,7 @@ int copy_raw(const uint32_t src_addr, ets_printf((const char*) fmt, dst_addr); ets_putc('B'); ets_printf((const char*) fmt, size); +#endif // EBOOT_VERBOSE_STARTUP // require regions to be aligned if (src_addr & 0xfff != 0 || @@ -184,14 +196,16 @@ int copy_raw(const uint32_t src_addr, uint32_t daddr = dst_addr; while (left) { - if (SPIEraseSector(daddr/buffer_size)) { - return 2; - } - if (SPIRead(saddr, buffer, buffer_size)) { - return 3; - } - if (SPIWrite(daddr, buffer, buffer_size)) { - return 4; + if ((daddr >= FLASH_SECTOR_SIZE) || (overwrite_eboot == 1)) { + if (SPIEraseSector(daddr/buffer_size)) { + return 2; + } + if (SPIRead(saddr, buffer, buffer_size)) { + return 3; + } + if (SPIWrite(daddr, buffer, buffer_size)) { + return 4; + } } saddr += buffer_size; daddr += buffer_size; @@ -209,7 +223,9 @@ void main() struct eboot_command cmd; print_version(0); +#ifdef EBOOT_VERBOSE_STARTUP print_flags(0); +#endif // EBOOT_VERBOSE_STARTUP if (eboot_command_read(&cmd) == 0) { // valid command was passed via RTC_MEM @@ -245,5 +261,9 @@ void main() SWRST; } - while(true){} + while(true) { +#ifdef EBOOT_VERBOSE_STARTUP + ets_putc('.'); +#endif // EBOOT_VERBOSE_STARTUP + } } diff --git a/bootloaders/eboot/eboot.elf b/bootloaders/eboot/eboot.elf index e9e1d67ed8a885ffe302c644cf6d9d4e94906581..6a08dc16c2ae8eb88958d2db8bbc0542aa5bbb9d 100755 GIT binary patch literal 15743 zcmd5@4Rlo1oxktROC}*h<|7b3-AsnBiIjXnbwFu8AQUP(5m2$FeN2)GM3PK8GZD2E zEJt0tQf*LMPaBuCYt?P-sg{0i*KWZAwUsT@!}zkA=Ed6S^+ zp53!&=bU->|8@WO|Nr0r{lEL}o7vg6c9mfmLVry0K|$={-vyeNpv~6f;t^tr2#X>S z6#+3>@}Jio#d#KXMa*s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*TTW_A-?wzb-J1G?SBEFy-X&{{bSA BT|NK+ diff --git a/bootloaders/eboot/eboot.h b/bootloaders/eboot/eboot.h new file mode 100644 index 0000000000..b0d9b2201c --- /dev/null +++ b/bootloaders/eboot/eboot.h @@ -0,0 +1,10 @@ +#ifndef EBOOT_CONFIG_H +#define EBOOT_CONFIG_H + +#define EBOOT_ENABLE_FLASH_STORAGE +#define EBOOT_COMMAND_SLOT_COUNT 8 +#define EBOOT_APP_OFFSET_PAGE_LIMIT 4 +//#define EBOOT_VERBOSE_STARTUP + + +#endif \ No newline at end of file diff --git a/bootloaders/eboot/eboot.ld b/bootloaders/eboot/eboot.ld index 303ae8a56c..4b90f38037 100644 --- a/bootloaders/eboot/eboot.ld +++ b/bootloaders/eboot/eboot.ld @@ -167,6 +167,7 @@ SECTIONS .irom0.text : ALIGN(4) { _irom0_text_start = ABSOLUTE(.); + LONG(0x31305241) *(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text) _irom0_text_end = ABSOLUTE(.); } >irom0_0_seg :irom0_0_phdr diff --git a/bootloaders/eboot/eboot_command.c b/bootloaders/eboot/eboot_command.c index b0800b6fe6..7c53fa1548 100644 --- a/bootloaders/eboot/eboot_command.c +++ b/bootloaders/eboot/eboot_command.c @@ -31,22 +31,11 @@ uint32_t eboot_command_calculate_crc32(const struct eboot_command* cmd) #if defined (EBOOT_ENABLE_FLASH_STORAGE) -uint32_t eboot_read_flash_index(eboot_index_t *eboot_index) -{ - if (SPIRead(0 + APP_START_OFFSET + sizeof(image_header_t) + sizeof(section_header_t), &eboot_index, sizeof(eboot_index))) { - return 0; - } - - if (eboot_index->magic != EBOOT_INDEX_MAGIC_V1) { - return 0; - } - - return 1; -} +extern int find_app_start(const uint32_t flash_addr); eboot_flash_command_t *commandAddress(void) { eboot_index_t eboot_index; - const uint32_t addr = 0 + APP_START_OFFSET + sizeof(image_header_t) + sizeof(section_header_t); + const uint32_t addr = find_app_start(0) + sizeof(image_header_t) + sizeof(section_header_t); if (SPIRead(addr, (uint32_t *)&eboot_index, sizeof(eboot_index))) { return NULL; } @@ -62,10 +51,12 @@ bool readBootCommand(int cmd, eboot_flash_command_t *dst) { if (cmd >= EBOOT_COMMAND_MAX_COUNT) { return 0; } +#ifdef EBOOT_DEBUG_FLASH ets_putc('r'); ets_putc('b'); ets_putc('0' + cmd); ets_putc('\n'); +#endif // EBOOT_DEBUG_FLASH uint32_t uint = (uint32_t) cmds; uint32_t addr = (uint32_t)cmds - 0x40200000; addr += cmd * sizeof(*dst); @@ -79,10 +70,12 @@ bool writeBootCommand(int cmd, eboot_flash_command_t *dst) { if (cmd >= EBOOT_COMMAND_MAX_COUNT) { return 0; } +#ifdef EBOOT_DEBUG_FLASH ets_putc('w'); ets_putc('b'); ets_putc('0' + cmd); ets_putc('\n'); +#endif // EBOOT_DEBUG_FLASH uint32_t uint = (uint32_t) cmds; uint32_t addr = (uint32_t)cmds - 0x40200000; addr += cmd * sizeof(*dst); @@ -106,10 +99,12 @@ uint32_t eboot_command_read_from_flash(struct eboot_command *cmd) if (((flash_command.flags & EBOOT_CMD_FLAG_SLOT_FREE) == 0) && ((flash_command.flags & EBOOT_CMD_FLAG_PENDING) == EBOOT_CMD_FLAG_PENDING)) { // Not free (meaning there's some data) and pending (so it's yet to be completed) +#ifdef EBOOT_DEBUG_FLASH ets_putc('r'); ets_putc('c'); ets_putc('0' + i); ets_putc('\n'); +#endif // EBOOT_DEBUG_FLASH src = (uint32_t *)&flash_command.cmd; for (uint32_t j = 0; j < dw_count; ++j) { dst[j] = src[j]; @@ -131,10 +126,12 @@ uint32_t eboot_command_write_to_flash(struct eboot_command *cmd) readBootCommand(i, &flash_command); if (((flash_command.flags & EBOOT_CMD_FLAG_SLOT_FREE) == EBOOT_CMD_FLAG_SLOT_FREE) && ((flash_command.flags & EBOOT_CMD_FLAG_PENDING) == EBOOT_CMD_FLAG_PENDING)) { +#ifdef EBOOT_DEBUG_FLASH ets_putc('w'); ets_putc('c'); ets_putc('0' + i); ets_putc('\n'); +#endif // EBOOT_DEBUG_FLASH dst = (uint32_t *)&flash_command.cmd; for (uint32_t j = 0; j < dw_count; ++j) { dst[j] = src[j]; @@ -157,10 +154,9 @@ uint32_t eboot_command_clear_flash(void) if (((flash_command.flags & EBOOT_CMD_FLAG_SLOT_FREE) == 0) && ((flash_command.flags & EBOOT_CMD_FLAG_PENDING) == EBOOT_CMD_FLAG_PENDING)) { flash_command.flags &= ~EBOOT_CMD_FLAG_PENDING; - // ets_printf("Clearing bootCommand %d, flags: %x\n", i, flash_command.flags); - ets_wdt_disable(); + ets_wdt_disable(); writeBootCommand(i, &flash_command); - ets_wdt_enable(); + ets_wdt_enable(); return 1; } } @@ -198,7 +194,6 @@ void eboot_command_clear_rtc(void) int eboot_command_read(struct eboot_command* cmd) { uint32_t have_command = 0; - uint32_t count = 0; #if defined (EBOOT_ENABLE_FLASH_STORAGE) ets_putc('F'); ets_putc(':'); @@ -208,11 +203,7 @@ int eboot_command_read(struct eboot_command* cmd) #endif // EBOOT_ENABLE_FLASH_STORAGE if (have_command == 0) { ets_putc('R'); - ets_putc('-'); eboot_command_read_from_rtc(cmd); - count = cmd->args[28]; - cmd->args[28] = 0; - ets_putc('0' + count); ets_putc('\n'); } @@ -222,16 +213,6 @@ int eboot_command_read(struct eboot_command* cmd) return 1; } - if (count >= 3) { - ets_putc('R'); - ets_putc('>'); - ets_putc('!'); - ets_putc('\n'); - return 1; - } - - cmd->args[28] = count + 1; - eboot_command_write_to_rtc(cmd); return 0; } diff --git a/bootloaders/eboot/eboot_command.h b/bootloaders/eboot/eboot_command.h index dd9b092199..46ae3f7e12 100644 --- a/bootloaders/eboot/eboot_command.h +++ b/bootloaders/eboot/eboot_command.h @@ -11,6 +11,7 @@ #include #include #include +#include "eboot.h" #define RTC_MEM ((volatile uint32_t*)0x60001200) diff --git a/cores/esp8266/flash_utils.h b/cores/esp8266/flash_utils.h index 67dc6ebadd..63afd763d2 100644 --- a/cores/esp8266/flash_utils.h +++ b/cores/esp8266/flash_utils.h @@ -31,9 +31,11 @@ int SPIRead(uint32_t addr, void *dest, size_t size); int SPIWrite(uint32_t addr, void *src, size_t size); int SPIEraseAreaEx(const uint32_t start, const uint32_t size); +extern uint32_t _ESP8266_AR_APP_START; + #define FLASH_SECTOR_SIZE 0x1000 #define FLASH_BLOCK_SIZE 0x10000 -#define APP_START_OFFSET 0x1000 +#define APP_START_OFFSET (&_ESP8266_AR_APP_START - 0x40200000) typedef struct { unsigned char magic; diff --git a/tools/sdk/ld/eagle.app.v6.common.ld b/tools/sdk/ld/eagle.app.v6.common.ld index dc7253dc5e..402acd0250 100644 --- a/tools/sdk/ld/eagle.app.v6.common.ld +++ b/tools/sdk/ld/eagle.app.v6.common.ld @@ -153,6 +153,7 @@ SECTIONS .irom0.text : ALIGN(4) { _irom0_text_start = ABSOLUTE(.); + _ESP8266_AR_APP_START = ABSOLUTE(.); *(.ver_number) LONG(0x31305241) LONG(_BOOTLOADER_DATA) From 2762d256fe3b6a6b1e200fa3797b778fd68c6573 Mon Sep 17 00:00:00 2001 From: Julian Davison Date: Thu, 19 Jan 2017 20:28:27 +1300 Subject: [PATCH 4/7] Tweak of platform.txt to specify SPIFFS start based on settings from boards.txt --- cores/esp8266/flash_utils.h | 2 +- platform.txt | 4 ++-- tools/sdk/ld/eagle.flash.4m.ld | 2 +- tools/sdk/ld/eagle.flash.4m1m.ld | 6 +++++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/cores/esp8266/flash_utils.h b/cores/esp8266/flash_utils.h index 63afd763d2..d6eccfa031 100644 --- a/cores/esp8266/flash_utils.h +++ b/cores/esp8266/flash_utils.h @@ -35,7 +35,7 @@ extern uint32_t _ESP8266_AR_APP_START; #define FLASH_SECTOR_SIZE 0x1000 #define FLASH_BLOCK_SIZE 0x10000 -#define APP_START_OFFSET (&_ESP8266_AR_APP_START - 0x40200000) +#define APP_START_OFFSET ((uint32_t) (&_ESP8266_AR_APP_START) - 0x40200000) typedef struct { unsigned char magic; diff --git a/platform.txt b/platform.txt index 56ae6aaa71..79ab590ba9 100644 --- a/platform.txt +++ b/platform.txt @@ -31,7 +31,7 @@ compiler.c.flags=-c {compiler.warning_flags} -Os -g -Wpointer-arith -Wno-implici compiler.S.cmd=xtensa-lx106-elf-gcc compiler.S.flags=-c -g -x assembler-with-cpp -MMD -mlongcalls -compiler.c.elf.flags=-g {compiler.warning_flags} -Os -nostdlib -Wl,--no-check-sections -u call_user_start -u _printf_float -u _scanf_float -Wl,-static "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" "-L{compiler.libc.path}/lib" "-T{build.flash_ld}" -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,register_chipv6_phy +compiler.c.elf.flags=-g {compiler.warning_flags} -Os -nostdlib -Wl,--no-check-sections -u call_user_start -u _printf_float -u _scanf_float -Wl,-static "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" "-L{compiler.libc.path}/lib" -Wl,--defsym=_SPIFFS_start_offset={build.spiffs_start} "-T{build.flash_ld}" -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,register_chipv6_phy compiler.c.elf.cmd=xtensa-lx106-elf-gcc compiler.c.elf.libs=-lhal -lphy -lpp -lnet80211 {build.lwip_lib} -lwpa -lcrypto -lmain -lwps -laxtls -lespnow -lsmartconfig -lmesh -lwpa2 -lstdc++ -lm -lc -lgcc @@ -83,7 +83,7 @@ recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.fla recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/arduino.ar" "{object_file}" ## Combine gc-sections, archives, and objects -recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" -Wl,--start-group {object_files} "{build.path}/arduino.ar" {compiler.c.elf.libs} -Wl,--end-group "-L{build.path}" +recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" -Wl,--start-group {object_files} "{build.path}/arduino.ar" {compiler.c.elf.libs} -Wl,--end-group "-L{build.path}" ## Create eeprom recipe.objcopy.eep.pattern= diff --git a/tools/sdk/ld/eagle.flash.4m.ld b/tools/sdk/ld/eagle.flash.4m.ld index d7063d29a1..38cc784146 100644 --- a/tools/sdk/ld/eagle.flash.4m.ld +++ b/tools/sdk/ld/eagle.flash.4m.ld @@ -14,7 +14,7 @@ MEMORY _BOOTLOADER_SPIFFS_OFFSET = DEFINED(eboot_get_flash_block_size) ? 0x2000 : 0; -PROVIDE ( _SPIFFS_start = 0x40300000 + _BOOTLOADER_SPIFFS_OFFSET ); +PROVIDE ( _SPIFFS_start = 0x40200000 + _BOOTLOADER_SPIFFS_OFFSET + _SPIFFS_start_offset ); PROVIDE ( _SPIFFS_end = 0x405FB000 ); PROVIDE ( _SPIFFS_page = 0x100 ); PROVIDE ( _SPIFFS_block = 0x2000 ); diff --git a/tools/sdk/ld/eagle.flash.4m1m.ld b/tools/sdk/ld/eagle.flash.4m1m.ld index 8746031c32..78eddaa1a1 100644 --- a/tools/sdk/ld/eagle.flash.4m1m.ld +++ b/tools/sdk/ld/eagle.flash.4m1m.ld @@ -12,9 +12,13 @@ MEMORY irom0_0_seg : org = 0x40201010, len = 0xfeff0 } -PROVIDE ( _SPIFFS_start = 0x40500000 ); +_BOOTLOADER_SPIFFS_OFFSET = DEFINED(eboot_get_flash_block_size) ? 0x2000 : 0; + +PROVIDE ( _SPIFFS_start = 0x40200000 + _BOOTLOADER_SPIFFS_OFFSET + _SPIFFS_start_offset ); PROVIDE ( _SPIFFS_end = 0x405FB000 ); PROVIDE ( _SPIFFS_page = 0x100 ); PROVIDE ( _SPIFFS_block = 0x2000 ); +PROVIDE ( _BOOTLOADER_DATA = DEFINED(eboot_get_flash_block_size) ? _SPIFFS_start - _BOOTLOADER_SPIFFS_OFFSET : 0 ); +PROVIDE ( _SKETCH_AREA_end = DEFINED(eboot_get_flash_block_size) ? _BOOTLOADER_DATA : _SPIFFS_start ); INCLUDE "../ld/eagle.app.v6.common.ld" From c752acc73156e366e598e0d7fc5a376d251b2c87 Mon Sep 17 00:00:00 2001 From: Julian Davison Date: Tue, 13 Jun 2017 21:11:46 +1200 Subject: [PATCH 5/7] Comment out my modified compiler.c.elf.flags line in platform.txt after merge-from-upstream --- platform.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.txt b/platform.txt index 1664046f7a..43650d1ffc 100644 --- a/platform.txt +++ b/platform.txt @@ -32,7 +32,7 @@ compiler.S.cmd=xtensa-lx106-elf-gcc compiler.S.flags=-c -g -x assembler-with-cpp -MMD -mlongcalls compiler.c.elf.flags=-g {compiler.warning_flags} -Os -nostdlib -Wl,--no-check-sections -u call_user_start -u _printf_float -u _scanf_float -Wl,-static "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" "-L{compiler.libc.path}/lib" "-T{build.flash_ld}" -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,spi_flash_read -compiler.c.elf.flags=-g {compiler.warning_flags} -Os -nostdlib -Wl,--no-check-sections -u call_user_start -u _printf_float -u _scanf_float -Wl,-static "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" "-L{compiler.libc.path}/lib" -Wl,--defsym=_SPIFFS_start_offset={build.spiffs_start} "-T{build.flash_ld}" -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,register_chipv6_phy +#compiler.c.elf.flags=-g {compiler.warning_flags} -Os -nostdlib -Wl,--no-check-sections -u call_user_start -u _printf_float -u _scanf_float -Wl,-static "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" "-L{compiler.libc.path}/lib" -Wl,--defsym=_SPIFFS_start_offset={build.spiffs_start} "-T{build.flash_ld}" -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,register_chipv6_phy compiler.c.elf.cmd=xtensa-lx106-elf-gcc compiler.c.elf.libs=-lhal -lphy -lpp -lnet80211 {build.lwip_lib} -lwpa -lcrypto -lmain -lwps -laxtls -lespnow -lsmartconfig -lmesh -lwpa2 -lstdc++ -lm -lc -lgcc From b97eec3ed1f301ef794d326cce06527f25a06b66 Mon Sep 17 00:00:00 2001 From: Julian Davison Date: Thu, 12 Oct 2017 14:42:49 +1300 Subject: [PATCH 6/7] commit of draft parseBoards.py --- parseBoards.py | 381 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 381 insertions(+) create mode 100644 parseBoards.py diff --git a/parseBoards.py b/parseBoards.py new file mode 100644 index 0000000000..6b25c72714 --- /dev/null +++ b/parseBoards.py @@ -0,0 +1,381 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# generateBoards.py — generate boards.txt and various make files for ESP Arduino +# +# Copyright © 2017 Julian Davison +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# + +from __future__ import print_function +import sys +import os +import argparse +import subprocess +import tempfile +import shutil +import pprint + +menu = {} + +nonDevicesList = {'menu': 'Menu items', + } + +platformSuffixes = ['linux', 'windows', 'macosx'] + +# Pull out the 'menu' subtree (at the top level) to define the custom menus +# 'boardIds' == remaining top-level keys +# iterate over boardIds to pull out board specific config + +# platform suffixes stripped in IDE on load + # key = processPlatformSuffix(key, ".linux", OSUtils.isLinux()); + # key = processPlatformSuffix(key, ".windows", OSUtils.isWindows()); + # key = processPlatformSuffix(key, ".macosx", OSUtils.isMacOS()); + +# FInd top-level custom menus, and then hiff the 'menu' branch of boards.txt + # // Create custom menus for this platform + # PreferencesMap menus = boardsPreferences.get("menu"); + # if (menus != null) + # customMenus = menus.topLevelMap(); + # boardsPreferences.remove("menu"); + + + +devicesList = { + 'generic': {'name': 'Generic ESP8266 Module', + }, + 'esp8285': {'name': 'Generic ESP8285 Module', + }, + 'espduino': {'name': 'ESPDuino (ESP-13 Module)', + }, + 'huzzah': {'name': 'Adafruit HUZZAH ESP8266', + }, + 'espresso_lite_v1': {'name': 'ESPresso Lite 1.0', + }, + 'espresso_lite_v2': {'name': 'ESPresso Lite 2.0', + }, + 'phoenix_v1': {'name': 'Phoenix 1.0', + }, + 'phoenix_v2': {'name': 'Phoenix 2.0', + }, + 'nodemcu': {'name': 'NodeMCU 0.9 (ESP-12 Module)', + }, + 'nodemcuv2': {'name': 'NodeMCU 1.0 (ESP-12E Module)', + }, + 'modwifi': {'name': 'Olimex MOD-WIFI-ESP8266(-DEV)', + }, + 'thing': {'name': 'SparkFun ESP8266 Thing', + }, + 'thingdev': {'name': 'SparkFun ESP8266 Thing Dev', + }, + 'esp210': {'name': 'SweetPea ESP-210', + }, + 'd1_mini': {'name': 'WeMos D1 R2 & mini', + }, + 'd1': {'name': 'WeMos D1(Retired)', + }, + 'espino': {'name': 'ESPino (ESP-12 Module)', + }, + 'espinotee': {'name': 'ThaiEasyElec''s ESPino', + }, + 'wifinfo': {'name': 'WifInfo', + }, + 'coredev': {'name': 'Core Development Module', + }, +} + +with open('boards.txt') as f: + for line in f: + line = line.rstrip("\n") + # SKip blank lines + if (line == ''): + continue + # Skip comment lines + if (line[0] == '#'): + continue + + (key, value) = line.split('=', 1) + components = key.split('.') + # print(components) + # print(value) + + device = '' #None + item = menu + for k in components: + if (k in devicesList.keys()): + device = k + continue + if (k not in item.keys()): + item[k] = {} + item = item[k] + + if (value is None): + value = '%None%' + if (value in item.keys()): + item[value].append(device) + else: + item[value] = [device] + + +menu = {} +devceMenu = {} +customMenus = {} + +settings = {} +genericSettings = {} + +with open('boards.txt') as f: + for line in f: + line = line.rstrip("\n") + # SKip blank lines + if (line == ''): + continue + # Skip comment lines + if (line[0] == '#'): + continue + + (key, value) = line.split('=', 1) + (device, config_line) = key.split('.', 1) + # print(components) + # print(value) + # print('Line: ' + line) + # print('Key: ' + key) + # print('Value: ' + value) + # print('Device: ' + device) + # print('Config: ' + config_line) + + item = menu + # device = '' #None + if (device in nonDevicesList.keys()): + # config_line = device + '.' + config_line + # device = 'None' + item = customMenus + else: + device = "'{device}'".format(device = device) + # print('Device: ' + device) + # print('Config: ' + config_line) + + + + if (config_line not in item.keys()): + item[config_line] = {value: [device]} + if (value not in item[config_line]): + item[config_line][value] = [device] + if (device not in item[config_line][value]): + item[config_line][value].append(device) + if (device == '\'generic\''): + if (config_line not in genericSettings.keys()): + genericSettings[config_line] = value + else: + if ((config_line not in genericSettings.keys()) or + (genericSettings[config_line] != value)): + if (device not in settings.keys()): + settings[device] = {} + settings[device][config_line] = value + + +pp = pprint.PrettyPrinter(indent=1) +# pp.pprint(menu) + +# print(menu) + +def build(data, prefix): + if (type(data) == type([])): + return data + for k in data.keys(): + if (prefix != ''): + devices = build(data[k], prefix + '.' + k) + else: + devices = build(data[k], k) + if (devices is not None): + for device in devices: + print("{device}.{prefix}={k}".format(device = device, prefix = prefix, k = k)) + return None + +# build(menu, '') + +def myPprint(data, prefix_len): + if (type(data) == type([])): + return data + firstIteration = True + for k in sorted(data): + if (firstIteration): + firstIteration = False + else: + print(" " * prefix_len, end='') + # print(prefix_len, end=';') + start = "{{'{k}': ".format(k = k) + print(start, end='') + # print(" " * (len(start) + prefix_len), end='') + # print(len(start), end=':') + returnVal = myPprint(data[k], prefix_len + len(start)) + if (returnVal is not None): + # print(returnVal) + print("['", end='') + print("', '".join(returnVal), end='') + print("']") + # print(prefix_len, end='') + return None + +def myPprint2(data): + indent = 1 + print("{", end='') + firstIteration = True + for config_line in sorted(data.iterkeys()): + if (firstIteration): + firstIteration = False + else: + print(" ", end='') + outputStr = "'{k}': {{".format(k = config_line) + print(outputStr, end='') + indent = len(outputStr) + entries = 0 + for value in data[config_line]: + entries += 1 + if (entries > 1): + print() + print(" " * indent, end='') + print("'{v}': [".format(v = value.replace("'", "\\'")), end='') + print(", ".join(data[config_line][value]), end='') + # for device in data[config_line][value]: + # print("'{d}', ".format(d = device), end='') + print("],", end='') + if (entries > 1): + print(" " * indent, end='') + print("},") + print("}") + +def myPprint3(data): + indent = 1 + print("{", end='') + firstIteration = True + for config_line in sorted(data.iterkeys()): + if (firstIteration): + firstIteration = False + else: + print(" ", end='') + outputStr = "'{k}': {{".format(k = config_line) + print(outputStr, end='') + indent = len(outputStr) + entries = 0 + for value in data[config_line]: + entries += 1 + if (entries > 1): + print() + print(" " * indent, end='') + print("'{v}': [".format(v = value.replace("'", "\\'")), end='') + print(", ".join(data[config_line][value]), end='') + # for device in data[config_line][value]: + # print("'{d}', ".format(d = device), end='') + print("],", end='') + if (entries > 1): + print(" " * indent, end='') + print("},") + print("}") + +# myPprint(menu, 0) +print("Menu") +myPprint2(menu) +print("customMenus") +myPprint2(customMenus) +print("genericSettings") +pp.pprint(genericSettings) +pp.pprint(settings) + +{'build': {'board': {'ESP8266_ESP01': ['generic', 'esp8285', 'coredev'], + 'ESP8266_ESP12': ['huzzah', 'espino'], + 'ESP8266_ESP13': ['espduino', 'espinotee'], + 'ESP8266_ESP210': ['esp210'], + 'ESP8266_ESPRESSO_LITE_V1': ['espresso_lite_v1'], + 'ESP8266_ESPRESSO_LITE_V2': ['espresso_lite_v2'], + 'ESP8266_NODEMCU': ['nodemcu', 'nodemcuv2'], + 'ESP8266_PHOENIX_V1': ['phoenix_v1'], + 'ESP8266_PHOENIX_V2': ['phoenix_v2'], + 'ESP8266_THING': ['thing'], + 'ESP8266_THING_DEV': ['thingdev'], + 'ESP8266_WEMOS_D1MINI': ['d1_mini', 'd1'], + 'MOD_WIFI_ESP8266': ['modwifi'], + 'WIFINFO': ['wifinfo']}, + 'core': {'esp8266': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}, + 'debug_level': {'': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'coredev'], + 'Wifinfo': ['wifinfo']}, + 'debug_port': {'': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'coredev'], + 'Serial1': ['wifinfo']}, + 'f_cpu': {'80000000L': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'coredev']}, + 'flash_freq': {'40': ['esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee']}, + 'flash_ld': {'eagle.flash.2m.ld': ['modwifi'], + 'eagle.flash.512k64.ld': ['thing', 'thingdev']}, + 'flash_mode': {'dio': ['espduino', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'thingdev', 'd1_mini', 'd1'], 'dout': ['esp8285'], 'qio': ['generic', 'huzzah', 'nodemcu', 'modwifi', 'thing', 'esp210', 'espino', 'espinotee', 'coredev']}, + 'flash_size': {'2M': ['modwifi'], '4M': ['espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee'], '512K': ['thing', 'thingdev']}, + 'lwip_flags': {'': ['coredev']}, + 'lwip_lib': {'-llwip': ['coredev']}, + 'mcu': {'esp8266': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}, + 'spiffs_blocksize': {'4096': ['thing'], '8192': ['modwifi']}, + 'spiffs_end': {'0x1FB000': ['modwifi'], '0x7B000': ['thing']}, + 'spiffs_pagesize': {'256': ['generic', 'esp8285', 'modwifi', 'thing', 'espino', 'wifinfo', 'coredev']}, + 'spiffs_start': {'0x100000': ['modwifi'], '0x6B000': ['thing']}, + 'variant': {'ESPDuino': ['espduino'], 'adafruit': ['huzzah'], 'd1': ['d1'], 'd1_mini': ['d1_mini'], 'espino': ['espino'], 'espinotee': ['espinotee'], 'espresso_lite_v1': ['espresso_lite_v1'], 'espresso_lite_v2': ['espresso_lite_v2'], 'generic': ['generic', 'esp8285', 'modwifi', 'esp210', 'coredev'], 'nodemcu': ['nodemcu', 'nodemcuv2'], 'phoenix_v1': ['phoenix_v1'], 'phoenix_v2': ['phoenix_v2'], 'thing': ['thing', 'thingdev'], 'wifinfo': ['wifinfo']}}, + 'menu': {'CpuFrequency': {'160': {'160 MHz': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev'], 'build': {'f_cpu': {'160000000L': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}}}, '80': {'80 MHz': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev'], 'build': {'f_cpu': {'80000000L': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}}}, 'CPU Frequency': [None]}, + 'Debug': {'Debug port': [None], 'Disabled': {'Disabled': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'wifinfo', 'coredev'], 'build': {'debug_port': {'': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'wifinfo', 'coredev']}}}, 'Serial': {'Serial': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'wifinfo', 'coredev'], 'build': {'debug_port': {'-DDEBUG_ESP_PORT=Serial': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'wifinfo', 'coredev']}}}, 'Serial1': {'Serial1': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'wifinfo', 'coredev'], 'build': {'debug_port': {'-DDEBUG_ESP_PORT=Serial1': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'wifinfo', 'coredev']}}}}, + 'DebugLevel': {'Core____': {'Core': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev'], 'build': {'debug_level': {'-DDEBUG_ESP_CORE': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev']}}}, + 'Debug Level': [None], + 'HTTPClient': {'HTTPClient': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev'], 'build': {'debug_level': {'-DDEBUG_ESP_HTTP_CLIENT': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev']}}}, + 'HTTPClient2': {'HTTPClient + SSL': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev'], 'build': {'debug_level': {'-DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_SSL': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev']}}}, + 'HTTPServer': {'HTTPServer': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev'], 'build': {'debug_level': {'-DDEBUG_ESP_HTTP_SERVER': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev']}}}, + 'HTTPUpdate': {'HTTPUpdate': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev'], 'build': {'debug_level': {'-DDEBUG_ESP_HTTP_UPDATE': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev']}}}, + 'HTTPUpdate2': {'HTTPClient + HTTPUpdate': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev'], 'build': {'debug_level': {'-DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_UPDATE': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev']}}}, + 'HTTPUpdate3': {'HTTPClient + HTTPUpdate + Updater': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev'], 'build': {'debug_level': {'-DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev']}}}, + 'None': {'None': ['wifinfo'], 'build': {'debug_level': {'': ['wifinfo']}}}, + 'None____': {'None': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev'], 'build': {'debug_level': {'': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev']}}}, + 'OTA2____': {'OTA + Updater': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev'], 'build': {'debug_level': {'-DDEBUG_ESP_OTA -DDEBUG_ESP_UPDATER': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev']}}}, + 'OTA_____': {'OTA': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev'], 'build': {'debug_level': {'-DDEBUG_ESP_OTA': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev']}}}, + 'SSL_MEM_': {'Core + SSL + TLS Mem': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev'], 'build': {'debug_level': {'-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL -DDEBUG_TLS_MEM': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev']}}}, + 'SSL_____': {'Core + SSL': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev'], 'build': {'debug_level': {'-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev']}}}, + 'UPDATER': {'Updater': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev'], 'build': {'debug_level': {'-DDEBUG_ESP_UPDATER': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev']}}}, + 'WiFi____': {'WiFi': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev'], 'build': {'debug_level': {'-DDEBUG_ESP_WIFI': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev']}}}, + 'WiFic___': {'Core + WiFi': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev'], 'build': {'debug_level': {'-DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev']}}}, + 'Wifinfo': {'Wifinfo': ['wifinfo'], 'build': {'debug_level': {'-DDEBUG_ESP_WIFINFO': ['wifinfo']}}}, + 'all_____': {'All': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev'], 'build': {'debug_level': {'-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_TLS_MEM': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev']}}}}, + 'ESPModule': {'ESP07192': {'ESP07 (1M/192K SPIFFS)': ['wifinfo'], 'build': {'board': {'ESP8266_ESP07': ['wifinfo']}, 'flash_ld': {'eagle.flash.1m192.ld': ['wifinfo']}, 'flash_size': {'1M': ['wifinfo']}, 'spiffs_blocksize': {'4096': ['wifinfo']}, 'spiffs_end': {'0xFB000': ['wifinfo']}, 'spiffs_start': {'0xCB000': ['wifinfo']}}, 'upload': {'maximum_size': {'827376': ['wifinfo']}}}, 'ESP12': {'ESP12 (4M/1M SPIFFS)': ['wifinfo'], 'build': {'board': {'ESP8266_ESP12': ['wifinfo']}, 'flash_ld': {'eagle.flash.4m1m.ld': ['wifinfo']}, 'flash_size': {'4M': ['wifinfo']}, 'spiffs_blocksize': {'8192': ['wifinfo']}, 'spiffs_end': {'0x3FB000': ['wifinfo']}, 'spiffs_pagesize': {'256': ['wifinfo']}, 'spiffs_start': {'0x300000': ['wifinfo']}}, 'upload': {'maximum_size': {'1044464': ['wifinfo']}}}, 'Module': [None]}, + 'FlashFreq': {'40': {'40MHz': ['generic', 'wifinfo', 'coredev'], 'build': {'flash_freq': {'40': ['generic', 'wifinfo', 'coredev']}}}, '80': {'80MHz': ['generic', 'wifinfo', 'coredev'], 'build': {'flash_freq': {'80': ['generic', 'wifinfo', 'coredev']}}}, 'Flash Frequency': [None]}, + 'FlashMode': {'Flash Mode': [None], 'dio': {'DIO': ['generic', 'espino', 'wifinfo', 'coredev'], 'build': {'flash_mode': {'dio': ['generic', 'espino', 'wifinfo', 'coredev']}}}, 'dout': {'DOUT': ['generic', 'coredev'], 'build': {'flash_mode': {'dout': ['generic', 'coredev']}}}, 'qio': {'QIO': ['generic', 'espino', 'wifinfo', 'coredev'], 'build': {'flash_mode': {'qio': ['generic', 'espino', 'wifinfo', 'coredev']}}}, 'qout': {'QOUT': ['generic', 'coredev'], 'build': {'flash_mode': {'qout': ['generic', 'coredev']}}}}, + 'FlashSize': {'16M15M': {'16M (15M SPIFFS)': ['coredev'], 'build': {'flash_ld': {'eagle.flash.16m.ld': ['coredev']}, 'flash_size': {'16M': ['coredev']}, 'spiffs_blocksize': {'8192': ['coredev']}, 'spiffs_end': {'0x17FB000': ['coredev']}, 'spiffs_pagesize': {'256': ['coredev']}, 'spiffs_start': {'0x100000': ['coredev']}}, 'upload': {'maximum_size': {'1044464': ['coredev']}}}, + '1M128': {'1M (128K SPIFFS)': ['generic', 'esp8285', 'coredev'], 'build': {'flash_ld': {'eagle.flash.1m128.ld': ['generic', 'esp8285', 'coredev']}, 'flash_size': {'1M': ['generic', 'esp8285', 'coredev']}, 'spiffs_blocksize': {'4096': ['generic', 'esp8285', 'coredev']}, 'spiffs_end': {'0xFB000': ['generic', 'esp8285', 'coredev']}, 'spiffs_start': {'0xDB000': ['generic', 'esp8285', 'coredev']}}, 'upload': {'maximum_size': {'892912': ['generic', 'esp8285', 'coredev']}}}, + '1M144': {'1M (144K SPIFFS)': ['generic', 'esp8285', 'coredev'], 'build': {'flash_ld': {'eagle.flash.1m144.ld': ['generic', 'esp8285', 'coredev']}, 'flash_size': {'1M': ['generic', 'esp8285', 'coredev']}, 'spiffs_blocksize': {'4096': ['generic', 'esp8285', 'coredev']}, 'spiffs_end': {'0xFB000': ['generic', 'esp8285', 'coredev']}, 'spiffs_start': {'0xD7000': ['generic', 'esp8285', 'coredev']}}, 'upload': {'maximum_size': {'876528': ['generic', 'esp8285', 'coredev']}}}, + '1M160': {'1M (160K SPIFFS)': ['generic', 'esp8285', 'coredev'], 'build': {'flash_ld': {'eagle.flash.1m160.ld': ['generic', 'esp8285', 'coredev']}, 'flash_size': {'1M': ['generic', 'esp8285', 'coredev']}, 'spiffs_blocksize': {'4096': ['generic', 'esp8285', 'coredev']}, 'spiffs_end': {'0xFB000': ['generic', 'esp8285', 'coredev']}, 'spiffs_start': {'0xD3000': ['generic', 'esp8285', 'coredev']}}, 'upload': {'maximum_size': {'860144': ['generic', 'esp8285', 'coredev']}}}, + '1M192': {'1M (192K SPIFFS)': ['generic', 'esp8285', 'coredev'], 'build': {'flash_ld': {'eagle.flash.1m192.ld': ['generic', 'esp8285', 'coredev']}, 'flash_size': {'1M': ['generic', 'esp8285', 'coredev']}, 'spiffs_blocksize': {'4096': ['generic', 'esp8285', 'coredev']}, 'spiffs_end': {'0xFB000': ['generic', 'esp8285', 'coredev']}, 'spiffs_start': {'0xCB000': ['generic', 'esp8285', 'coredev']}}, 'upload': {'maximum_size': {'827376': ['generic', 'esp8285', 'coredev']}}}, + '1M256': {'1M (256K SPIFFS)': ['generic', 'esp8285', 'coredev'], 'build': {'flash_ld': {'eagle.flash.1m256.ld': ['generic', 'esp8285', 'coredev']}, 'flash_size': {'1M': ['generic', 'esp8285', 'coredev']}, 'spiffs_blocksize': {'4096': ['generic', 'esp8285', 'coredev']}, 'spiffs_end': {'0xFB000': ['generic', 'esp8285', 'coredev']}, 'spiffs_start': {'0xBB000': ['generic', 'esp8285', 'coredev']}}, 'upload': {'maximum_size': {'761840': ['generic', 'esp8285', 'coredev']}}}, + '1M512': {'1M (512K SPIFFS)': ['generic', 'esp8285', 'coredev'], 'build': {'flash_ld': {'eagle.flash.1m512.ld': ['generic', 'esp8285', 'coredev']}, 'flash_size': {'1M': ['generic', 'esp8285', 'coredev']}, 'spiffs_blocksize': {'8192': ['generic', 'esp8285', 'coredev']}, 'spiffs_end': {'0xFB000': ['generic', 'esp8285', 'coredev']}, 'spiffs_start': {'0x7B000': ['generic', 'esp8285', 'coredev']}}, 'upload': {'maximum_size': {'499696': ['generic', 'esp8285', 'coredev']}}}, + '1M64': {'1M (64K SPIFFS)': ['generic', 'esp8285', 'coredev'], 'build': {'flash_ld': {'eagle.flash.1m64.ld': ['generic', 'esp8285', 'coredev']}, 'flash_size': {'1M': ['generic', 'esp8285', 'coredev']}, 'spiffs_blocksize': {'4096': ['generic', 'esp8285', 'coredev']}, 'spiffs_end': {'0xFB000': ['generic', 'esp8285', 'coredev']}, 'spiffs_start': {'0xEB000': ['generic', 'esp8285', 'coredev']}}, 'upload': {'maximum_size': {'958448': ['generic', 'esp8285', 'coredev']}}}, + '2M': {'2M (1M SPIFFS)': ['generic', 'coredev'], 'build': {'flash_ld': {'eagle.flash.2m.ld': ['generic', 'coredev']}, 'flash_size': {'2M': ['generic', 'coredev']}, 'spiffs_blocksize': {'8192': ['generic', 'coredev']}, 'spiffs_end': {'0x1FB000': ['generic', 'coredev']}, 'spiffs_start': {'0x100000': ['generic', 'coredev']}}, 'upload': {'maximum_size': {'1044464': ['generic', 'coredev']}}}, + '4M1M': {'4M (1M SPIFFS)': ['generic', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'coredev'], 'build': {'flash_ld': {'eagle.flash.4m1m.ld': ['generic', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'coredev']}, 'flash_size': {'4M': ['generic', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'coredev']}, 'spiffs_blocksize': {'8192': ['generic', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'coredev']}, 'spiffs_end': {'0x3FB000': ['generic', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'coredev']}, 'spiffs_pagesize': {'256': ['generic', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'coredev']}, 'spiffs_start': {'0x300000': ['generic', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'coredev']}}, 'upload': {'maximum_size': {'1044464': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'espino', 'coredev']}}}, + '4M3M': {'4M (3M SPIFFS)': ['generic', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'coredev'], 'build': {'flash_ld': {'eagle.flash.4m.ld': ['generic', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'coredev']}, 'flash_size': {'4M': ['generic', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'coredev']}, 'spiffs_blocksize': {'8192': ['generic', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'coredev']}, 'spiffs_end': {'0x3FB000': ['generic', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'coredev']}, 'spiffs_pagesize': {'256': ['espduino', 'huzzah', 'nodemcu', 'nodemcuv2', 'esp210', 'd1_mini', 'd1', 'espinotee', 'coredev']}, 'spiffs_start': {'0x100000': ['generic', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'coredev']}}, 'upload': {'maximum_size': {'1044464': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'espino', 'coredev']}}}, + '512K0': {'512K (no SPIFFS)': ['generic', 'coredev'], 'build': {'flash_ld': {'eagle.flash.512k0.ld': ['generic', 'coredev']}, 'flash_size': {'512K': ['generic', 'coredev']}}, 'upload': {'maximum_size': {'499696': ['generic', 'coredev']}}}, + '512K128': {'512K (128K SPIFFS)': ['generic', 'coredev'], 'build': {'flash_ld': {'eagle.flash.512k128.ld': ['generic', 'coredev']}, 'flash_size': {'512K': ['generic', 'coredev']}, 'spiffs_blocksize': {'4096': ['generic', 'coredev']}, 'spiffs_end': {'0x7B000': ['generic', 'coredev']}, 'spiffs_start': {'0x5B000': ['generic', 'coredev']}}, 'upload': {'maximum_size': {'368624': ['generic', 'coredev']}}}, + '512K64': {'512K (64K SPIFFS)': ['generic', 'coredev'], 'build': {'flash_ld': {'eagle.flash.512k64.ld': ['generic', 'coredev']}, 'flash_size': {'512K': ['generic', 'coredev']}, 'spiffs_blocksize': {'4096': ['generic', 'coredev']}, 'spiffs_end': {'0x7B000': ['generic', 'coredev']}, 'spiffs_start': {'0x6B000': ['generic', 'coredev']}}, 'upload': {'maximum_size': {'434160': ['generic', 'coredev']}}}, + '8M7M': {'8M (7M SPIFFS)': ['coredev'], 'build': {'flash_ld': {'eagle.flash.8m.ld': ['coredev']}, 'flash_size': {'8M': ['coredev']}, 'spiffs_blocksize': {'8192': ['coredev']}, 'spiffs_end': {'0x7FB000': ['coredev']}, 'spiffs_pagesize': {'256': ['coredev']}, 'spiffs_start': {'0x100000': ['coredev']}}, 'upload': {'maximum_size': {'1044464': ['coredev']}}}, + 'Flash Size': [None]}, + 'LwIPVariant': {'Espressif': {'Espressif (xcc)': ['coredev'], 'build': {'lwip_flags': {'-DLWIP_MAYBE_XCC': ['coredev']}, 'lwip_lib': {'-llwip': ['coredev']}}}, 'OpenSource': {'Open Source (gcc)': ['coredev'], 'build': {'lwip_flags': {'-DLWIP_OPEN_SRC': ['coredev']}, 'lwip_lib': {'-llwip_src': ['coredev']}}, 'recipe': {'hooks': {'sketch': {'prebuild': {'1': {'pattern': {'make -C "{runtime.platform.path}/tools/sdk/lwip/src" install TOOLS_PATH="{runtime.tools.xtensa-lx106-elf-gcc.path}/bin/xtensa-lx106-elf-"': ['coredev']}}}}}}}, 'Prebuilt': {'Prebuilt Source (gcc)': ['coredev'], 'build': {'lwip_flags': {'-DLWIP_OPEN_SRC': ['coredev']}, 'lwip_lib': {'-llwip_gcc': ['coredev']}}}, 'lwIP Variant': [None]}, + 'ResetMethod': {'Reset Method': [None], 'ck': {'ck': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'espino', 'coredev'], 'upload': {'resetmethod': {'ck': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'espino', 'coredev']}}}, 'nodemcu': ['nodemcu', 'nodemcu', 'nodemcu', 'nodemcu', 'nodemcu', 'nodemcu', 'nodemcu'], 'upload': {'resetmethod': {'nodemcu': ['nodemcu', 'nodemcu', 'nodemcu', 'nodemcu', 'nodemcu', 'nodemcu', 'nodemcu']}}}, + 'UploadSpeed': {'115200': {'115200': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev'], 'upload': {'speed': {'115200': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}}}, + '230400': {'linux': {'230400': ['generic', 'esp8285', 'espduino', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}, 'macosx': {'230400': ['generic', 'esp8285', 'espduino', 'espduino', 'espresso_lite_v1', 'espresso_lite_v1', 'espresso_lite_v2', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v1', 'phoenix_v2', 'phoenix_v2', 'nodemcu', 'nodemcu', 'nodemcuv2', 'nodemcuv2', 'modwifi', 'modwifi', 'thing', 'thingdev', 'esp210', 'esp210', 'd1_mini', 'd1_mini', 'd1', 'd1', 'espino', 'espinotee', 'espinotee', 'wifinfo', 'coredev']}, 'upload': {'speed': {'230400': ['generic', 'esp8285', 'espduino', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}}}, + '256000': {'256000': ['huzzah'], 'upload': {'speed': {'256000': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}}, 'windows': {'256000': ['generic', 'esp8285', 'espduino', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}}, + '460800': {'linux': {'460800': ['generic', 'esp8285', 'espduino', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}, 'macosx': {'460800': ['generic', 'esp8285', 'espduino', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}, 'upload': {'speed': {'460800': ['generic', 'esp8285', 'espduino', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}}}, + '512000': {'upload': {'speed': {'512000': ['generic', 'esp8285', 'espduino', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}}, 'windows': {'512000': ['generic', 'esp8285', 'espduino', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}}, + '57600': {'57600': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev'], 'upload': {'speed': {'57600': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}}}, + '921600': {'921600': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev'], 'upload': {'speed': {'921600': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}}}, + '9600': {'9600': ['generic', 'esp8285', 'espduino', 'huzzah', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev'], 'upload': {'speed': {'9600': ['generic', 'esp8285', 'espduino', 'huzzah', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}}}, + 'Upload Speed': [None]}}, + 'name': {'Adafruit HUZZAH ESP8266': ['huzzah'], 'Core Development Module': ['coredev'], 'ESPDuino (ESP-13 Module)': ['espduino'], 'ESPino (ESP-12 Module)': ['espino'], 'ESPresso Lite 1.0': ['espresso_lite_v1'], 'ESPresso Lite 2.0': ['espresso_lite_v2'], 'Generic ESP8266 Module': ['generic'], 'Generic ESP8285 Module': ['esp8285'], 'NodeMCU 0.9 (ESP-12 Module)': ['nodemcu'], 'NodeMCU 1.0 (ESP-12E Module)': ['nodemcuv2'], 'Olimex MOD-WIFI-ESP8266(-DEV)': ['modwifi'], 'Phoenix 1.0': ['phoenix_v1'], 'Phoenix 2.0': ['phoenix_v2'], 'SparkFun ESP8266 Thing': ['thing'], 'SparkFun ESP8266 Thing Dev': ['thingdev'], 'SweetPea ESP-210': ['esp210'], "ThaiEasyElec's ESPino": ['espinotee'], 'WeMos D1 R2 & mini': ['d1_mini'], 'WeMos D1(Retired)': ['d1'], 'WifInfo': ['wifinfo']}, + 'serial': {'disableDTR': {'true': ['generic', 'esp8285', 'espduino', 'huzzah', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}, 'disableRTS': {'true': ['generic', 'esp8285', 'espduino', 'huzzah', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}}, + 'upload': {'maximum_data_size': {'81920': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}, 'maximum_size': {'1044464': ['espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee'], '434160': ['generic', 'esp8285', 'thing', 'thingdev', 'wifinfo', 'coredev']}, 'resetmethod': {'ck': ['generic', 'esp8285', 'espduino', 'modwifi', 'thing', 'esp210', 'espino', 'coredev'], 'nodemcu': ['huzzah', 'nodemcu', 'nodemcuv2', 'thingdev', 'd1_mini', 'd1', 'espinotee', 'wifinfo']}, 'speed': {'115200': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'esp210', 'espino', 'espinotee', 'wifinfo', 'coredev'], '460800': ['d1_mini', 'd1'], '921600': ['thing', 'thingdev']}, 'tool': {'esptool': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}, 'wait_for_upload_port': {'true': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}}} From 421ba9004559aa236796bc7ed2b73fde34234fe6 Mon Sep 17 00:00:00 2001 From: Julian Davison Date: Thu, 12 Oct 2017 15:09:43 +1300 Subject: [PATCH 7/7] Quick tidy up of parseBoards.py discarding unused parts --- parseBoards.py | 151 ------------------------------------------------- 1 file changed, 151 deletions(-) diff --git a/parseBoards.py b/parseBoards.py index 6b25c72714..b24b480f19 100644 --- a/parseBoards.py +++ b/parseBoards.py @@ -26,8 +26,6 @@ import shutil import pprint -menu = {} - nonDevicesList = {'menu': 'Menu items', } @@ -94,39 +92,6 @@ }, } -with open('boards.txt') as f: - for line in f: - line = line.rstrip("\n") - # SKip blank lines - if (line == ''): - continue - # Skip comment lines - if (line[0] == '#'): - continue - - (key, value) = line.split('=', 1) - components = key.split('.') - # print(components) - # print(value) - - device = '' #None - item = menu - for k in components: - if (k in devicesList.keys()): - device = k - continue - if (k not in item.keys()): - item[k] = {} - item = item[k] - - if (value is None): - value = '%None%' - if (value in item.keys()): - item[value].append(device) - else: - item[value] = [device] - - menu = {} devceMenu = {} customMenus = {} @@ -255,34 +220,6 @@ def myPprint2(data): print("},") print("}") -def myPprint3(data): - indent = 1 - print("{", end='') - firstIteration = True - for config_line in sorted(data.iterkeys()): - if (firstIteration): - firstIteration = False - else: - print(" ", end='') - outputStr = "'{k}': {{".format(k = config_line) - print(outputStr, end='') - indent = len(outputStr) - entries = 0 - for value in data[config_line]: - entries += 1 - if (entries > 1): - print() - print(" " * indent, end='') - print("'{v}': [".format(v = value.replace("'", "\\'")), end='') - print(", ".join(data[config_line][value]), end='') - # for device in data[config_line][value]: - # print("'{d}', ".format(d = device), end='') - print("],", end='') - if (entries > 1): - print(" " * indent, end='') - print("},") - print("}") - # myPprint(menu, 0) print("Menu") myPprint2(menu) @@ -291,91 +228,3 @@ def myPprint3(data): print("genericSettings") pp.pprint(genericSettings) pp.pprint(settings) - -{'build': {'board': {'ESP8266_ESP01': ['generic', 'esp8285', 'coredev'], - 'ESP8266_ESP12': ['huzzah', 'espino'], - 'ESP8266_ESP13': ['espduino', 'espinotee'], - 'ESP8266_ESP210': ['esp210'], - 'ESP8266_ESPRESSO_LITE_V1': ['espresso_lite_v1'], - 'ESP8266_ESPRESSO_LITE_V2': ['espresso_lite_v2'], - 'ESP8266_NODEMCU': ['nodemcu', 'nodemcuv2'], - 'ESP8266_PHOENIX_V1': ['phoenix_v1'], - 'ESP8266_PHOENIX_V2': ['phoenix_v2'], - 'ESP8266_THING': ['thing'], - 'ESP8266_THING_DEV': ['thingdev'], - 'ESP8266_WEMOS_D1MINI': ['d1_mini', 'd1'], - 'MOD_WIFI_ESP8266': ['modwifi'], - 'WIFINFO': ['wifinfo']}, - 'core': {'esp8266': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}, - 'debug_level': {'': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'coredev'], - 'Wifinfo': ['wifinfo']}, - 'debug_port': {'': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'coredev'], - 'Serial1': ['wifinfo']}, - 'f_cpu': {'80000000L': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'coredev']}, - 'flash_freq': {'40': ['esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee']}, - 'flash_ld': {'eagle.flash.2m.ld': ['modwifi'], - 'eagle.flash.512k64.ld': ['thing', 'thingdev']}, - 'flash_mode': {'dio': ['espduino', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'thingdev', 'd1_mini', 'd1'], 'dout': ['esp8285'], 'qio': ['generic', 'huzzah', 'nodemcu', 'modwifi', 'thing', 'esp210', 'espino', 'espinotee', 'coredev']}, - 'flash_size': {'2M': ['modwifi'], '4M': ['espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee'], '512K': ['thing', 'thingdev']}, - 'lwip_flags': {'': ['coredev']}, - 'lwip_lib': {'-llwip': ['coredev']}, - 'mcu': {'esp8266': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}, - 'spiffs_blocksize': {'4096': ['thing'], '8192': ['modwifi']}, - 'spiffs_end': {'0x1FB000': ['modwifi'], '0x7B000': ['thing']}, - 'spiffs_pagesize': {'256': ['generic', 'esp8285', 'modwifi', 'thing', 'espino', 'wifinfo', 'coredev']}, - 'spiffs_start': {'0x100000': ['modwifi'], '0x6B000': ['thing']}, - 'variant': {'ESPDuino': ['espduino'], 'adafruit': ['huzzah'], 'd1': ['d1'], 'd1_mini': ['d1_mini'], 'espino': ['espino'], 'espinotee': ['espinotee'], 'espresso_lite_v1': ['espresso_lite_v1'], 'espresso_lite_v2': ['espresso_lite_v2'], 'generic': ['generic', 'esp8285', 'modwifi', 'esp210', 'coredev'], 'nodemcu': ['nodemcu', 'nodemcuv2'], 'phoenix_v1': ['phoenix_v1'], 'phoenix_v2': ['phoenix_v2'], 'thing': ['thing', 'thingdev'], 'wifinfo': ['wifinfo']}}, - 'menu': {'CpuFrequency': {'160': {'160 MHz': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev'], 'build': {'f_cpu': {'160000000L': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}}}, '80': {'80 MHz': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev'], 'build': {'f_cpu': {'80000000L': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}}}, 'CPU Frequency': [None]}, - 'Debug': {'Debug port': [None], 'Disabled': {'Disabled': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'wifinfo', 'coredev'], 'build': {'debug_port': {'': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'wifinfo', 'coredev']}}}, 'Serial': {'Serial': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'wifinfo', 'coredev'], 'build': {'debug_port': {'-DDEBUG_ESP_PORT=Serial': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'wifinfo', 'coredev']}}}, 'Serial1': {'Serial1': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'wifinfo', 'coredev'], 'build': {'debug_port': {'-DDEBUG_ESP_PORT=Serial1': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'wifinfo', 'coredev']}}}}, - 'DebugLevel': {'Core____': {'Core': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev'], 'build': {'debug_level': {'-DDEBUG_ESP_CORE': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev']}}}, - 'Debug Level': [None], - 'HTTPClient': {'HTTPClient': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev'], 'build': {'debug_level': {'-DDEBUG_ESP_HTTP_CLIENT': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev']}}}, - 'HTTPClient2': {'HTTPClient + SSL': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev'], 'build': {'debug_level': {'-DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_SSL': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev']}}}, - 'HTTPServer': {'HTTPServer': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev'], 'build': {'debug_level': {'-DDEBUG_ESP_HTTP_SERVER': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev']}}}, - 'HTTPUpdate': {'HTTPUpdate': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev'], 'build': {'debug_level': {'-DDEBUG_ESP_HTTP_UPDATE': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev']}}}, - 'HTTPUpdate2': {'HTTPClient + HTTPUpdate': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev'], 'build': {'debug_level': {'-DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_UPDATE': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev']}}}, - 'HTTPUpdate3': {'HTTPClient + HTTPUpdate + Updater': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev'], 'build': {'debug_level': {'-DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev']}}}, - 'None': {'None': ['wifinfo'], 'build': {'debug_level': {'': ['wifinfo']}}}, - 'None____': {'None': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev'], 'build': {'debug_level': {'': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev']}}}, - 'OTA2____': {'OTA + Updater': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev'], 'build': {'debug_level': {'-DDEBUG_ESP_OTA -DDEBUG_ESP_UPDATER': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev']}}}, - 'OTA_____': {'OTA': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev'], 'build': {'debug_level': {'-DDEBUG_ESP_OTA': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev']}}}, - 'SSL_MEM_': {'Core + SSL + TLS Mem': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev'], 'build': {'debug_level': {'-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL -DDEBUG_TLS_MEM': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev']}}}, - 'SSL_____': {'Core + SSL': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev'], 'build': {'debug_level': {'-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev']}}}, - 'UPDATER': {'Updater': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev'], 'build': {'debug_level': {'-DDEBUG_ESP_UPDATER': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev']}}}, - 'WiFi____': {'WiFi': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev'], 'build': {'debug_level': {'-DDEBUG_ESP_WIFI': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev']}}}, - 'WiFic___': {'Core + WiFi': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev'], 'build': {'debug_level': {'-DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev']}}}, - 'Wifinfo': {'Wifinfo': ['wifinfo'], 'build': {'debug_level': {'-DDEBUG_ESP_WIFINFO': ['wifinfo']}}}, - 'all_____': {'All': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev'], 'build': {'debug_level': {'-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_TLS_MEM': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcuv2', 'coredev']}}}}, - 'ESPModule': {'ESP07192': {'ESP07 (1M/192K SPIFFS)': ['wifinfo'], 'build': {'board': {'ESP8266_ESP07': ['wifinfo']}, 'flash_ld': {'eagle.flash.1m192.ld': ['wifinfo']}, 'flash_size': {'1M': ['wifinfo']}, 'spiffs_blocksize': {'4096': ['wifinfo']}, 'spiffs_end': {'0xFB000': ['wifinfo']}, 'spiffs_start': {'0xCB000': ['wifinfo']}}, 'upload': {'maximum_size': {'827376': ['wifinfo']}}}, 'ESP12': {'ESP12 (4M/1M SPIFFS)': ['wifinfo'], 'build': {'board': {'ESP8266_ESP12': ['wifinfo']}, 'flash_ld': {'eagle.flash.4m1m.ld': ['wifinfo']}, 'flash_size': {'4M': ['wifinfo']}, 'spiffs_blocksize': {'8192': ['wifinfo']}, 'spiffs_end': {'0x3FB000': ['wifinfo']}, 'spiffs_pagesize': {'256': ['wifinfo']}, 'spiffs_start': {'0x300000': ['wifinfo']}}, 'upload': {'maximum_size': {'1044464': ['wifinfo']}}}, 'Module': [None]}, - 'FlashFreq': {'40': {'40MHz': ['generic', 'wifinfo', 'coredev'], 'build': {'flash_freq': {'40': ['generic', 'wifinfo', 'coredev']}}}, '80': {'80MHz': ['generic', 'wifinfo', 'coredev'], 'build': {'flash_freq': {'80': ['generic', 'wifinfo', 'coredev']}}}, 'Flash Frequency': [None]}, - 'FlashMode': {'Flash Mode': [None], 'dio': {'DIO': ['generic', 'espino', 'wifinfo', 'coredev'], 'build': {'flash_mode': {'dio': ['generic', 'espino', 'wifinfo', 'coredev']}}}, 'dout': {'DOUT': ['generic', 'coredev'], 'build': {'flash_mode': {'dout': ['generic', 'coredev']}}}, 'qio': {'QIO': ['generic', 'espino', 'wifinfo', 'coredev'], 'build': {'flash_mode': {'qio': ['generic', 'espino', 'wifinfo', 'coredev']}}}, 'qout': {'QOUT': ['generic', 'coredev'], 'build': {'flash_mode': {'qout': ['generic', 'coredev']}}}}, - 'FlashSize': {'16M15M': {'16M (15M SPIFFS)': ['coredev'], 'build': {'flash_ld': {'eagle.flash.16m.ld': ['coredev']}, 'flash_size': {'16M': ['coredev']}, 'spiffs_blocksize': {'8192': ['coredev']}, 'spiffs_end': {'0x17FB000': ['coredev']}, 'spiffs_pagesize': {'256': ['coredev']}, 'spiffs_start': {'0x100000': ['coredev']}}, 'upload': {'maximum_size': {'1044464': ['coredev']}}}, - '1M128': {'1M (128K SPIFFS)': ['generic', 'esp8285', 'coredev'], 'build': {'flash_ld': {'eagle.flash.1m128.ld': ['generic', 'esp8285', 'coredev']}, 'flash_size': {'1M': ['generic', 'esp8285', 'coredev']}, 'spiffs_blocksize': {'4096': ['generic', 'esp8285', 'coredev']}, 'spiffs_end': {'0xFB000': ['generic', 'esp8285', 'coredev']}, 'spiffs_start': {'0xDB000': ['generic', 'esp8285', 'coredev']}}, 'upload': {'maximum_size': {'892912': ['generic', 'esp8285', 'coredev']}}}, - '1M144': {'1M (144K SPIFFS)': ['generic', 'esp8285', 'coredev'], 'build': {'flash_ld': {'eagle.flash.1m144.ld': ['generic', 'esp8285', 'coredev']}, 'flash_size': {'1M': ['generic', 'esp8285', 'coredev']}, 'spiffs_blocksize': {'4096': ['generic', 'esp8285', 'coredev']}, 'spiffs_end': {'0xFB000': ['generic', 'esp8285', 'coredev']}, 'spiffs_start': {'0xD7000': ['generic', 'esp8285', 'coredev']}}, 'upload': {'maximum_size': {'876528': ['generic', 'esp8285', 'coredev']}}}, - '1M160': {'1M (160K SPIFFS)': ['generic', 'esp8285', 'coredev'], 'build': {'flash_ld': {'eagle.flash.1m160.ld': ['generic', 'esp8285', 'coredev']}, 'flash_size': {'1M': ['generic', 'esp8285', 'coredev']}, 'spiffs_blocksize': {'4096': ['generic', 'esp8285', 'coredev']}, 'spiffs_end': {'0xFB000': ['generic', 'esp8285', 'coredev']}, 'spiffs_start': {'0xD3000': ['generic', 'esp8285', 'coredev']}}, 'upload': {'maximum_size': {'860144': ['generic', 'esp8285', 'coredev']}}}, - '1M192': {'1M (192K SPIFFS)': ['generic', 'esp8285', 'coredev'], 'build': {'flash_ld': {'eagle.flash.1m192.ld': ['generic', 'esp8285', 'coredev']}, 'flash_size': {'1M': ['generic', 'esp8285', 'coredev']}, 'spiffs_blocksize': {'4096': ['generic', 'esp8285', 'coredev']}, 'spiffs_end': {'0xFB000': ['generic', 'esp8285', 'coredev']}, 'spiffs_start': {'0xCB000': ['generic', 'esp8285', 'coredev']}}, 'upload': {'maximum_size': {'827376': ['generic', 'esp8285', 'coredev']}}}, - '1M256': {'1M (256K SPIFFS)': ['generic', 'esp8285', 'coredev'], 'build': {'flash_ld': {'eagle.flash.1m256.ld': ['generic', 'esp8285', 'coredev']}, 'flash_size': {'1M': ['generic', 'esp8285', 'coredev']}, 'spiffs_blocksize': {'4096': ['generic', 'esp8285', 'coredev']}, 'spiffs_end': {'0xFB000': ['generic', 'esp8285', 'coredev']}, 'spiffs_start': {'0xBB000': ['generic', 'esp8285', 'coredev']}}, 'upload': {'maximum_size': {'761840': ['generic', 'esp8285', 'coredev']}}}, - '1M512': {'1M (512K SPIFFS)': ['generic', 'esp8285', 'coredev'], 'build': {'flash_ld': {'eagle.flash.1m512.ld': ['generic', 'esp8285', 'coredev']}, 'flash_size': {'1M': ['generic', 'esp8285', 'coredev']}, 'spiffs_blocksize': {'8192': ['generic', 'esp8285', 'coredev']}, 'spiffs_end': {'0xFB000': ['generic', 'esp8285', 'coredev']}, 'spiffs_start': {'0x7B000': ['generic', 'esp8285', 'coredev']}}, 'upload': {'maximum_size': {'499696': ['generic', 'esp8285', 'coredev']}}}, - '1M64': {'1M (64K SPIFFS)': ['generic', 'esp8285', 'coredev'], 'build': {'flash_ld': {'eagle.flash.1m64.ld': ['generic', 'esp8285', 'coredev']}, 'flash_size': {'1M': ['generic', 'esp8285', 'coredev']}, 'spiffs_blocksize': {'4096': ['generic', 'esp8285', 'coredev']}, 'spiffs_end': {'0xFB000': ['generic', 'esp8285', 'coredev']}, 'spiffs_start': {'0xEB000': ['generic', 'esp8285', 'coredev']}}, 'upload': {'maximum_size': {'958448': ['generic', 'esp8285', 'coredev']}}}, - '2M': {'2M (1M SPIFFS)': ['generic', 'coredev'], 'build': {'flash_ld': {'eagle.flash.2m.ld': ['generic', 'coredev']}, 'flash_size': {'2M': ['generic', 'coredev']}, 'spiffs_blocksize': {'8192': ['generic', 'coredev']}, 'spiffs_end': {'0x1FB000': ['generic', 'coredev']}, 'spiffs_start': {'0x100000': ['generic', 'coredev']}}, 'upload': {'maximum_size': {'1044464': ['generic', 'coredev']}}}, - '4M1M': {'4M (1M SPIFFS)': ['generic', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'coredev'], 'build': {'flash_ld': {'eagle.flash.4m1m.ld': ['generic', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'coredev']}, 'flash_size': {'4M': ['generic', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'coredev']}, 'spiffs_blocksize': {'8192': ['generic', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'coredev']}, 'spiffs_end': {'0x3FB000': ['generic', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'coredev']}, 'spiffs_pagesize': {'256': ['generic', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'coredev']}, 'spiffs_start': {'0x300000': ['generic', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'coredev']}}, 'upload': {'maximum_size': {'1044464': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'espino', 'coredev']}}}, - '4M3M': {'4M (3M SPIFFS)': ['generic', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'coredev'], 'build': {'flash_ld': {'eagle.flash.4m.ld': ['generic', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'coredev']}, 'flash_size': {'4M': ['generic', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'coredev']}, 'spiffs_blocksize': {'8192': ['generic', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'coredev']}, 'spiffs_end': {'0x3FB000': ['generic', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'coredev']}, 'spiffs_pagesize': {'256': ['espduino', 'huzzah', 'nodemcu', 'nodemcuv2', 'esp210', 'd1_mini', 'd1', 'espinotee', 'coredev']}, 'spiffs_start': {'0x100000': ['generic', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'coredev']}}, 'upload': {'maximum_size': {'1044464': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'espino', 'coredev']}}}, - '512K0': {'512K (no SPIFFS)': ['generic', 'coredev'], 'build': {'flash_ld': {'eagle.flash.512k0.ld': ['generic', 'coredev']}, 'flash_size': {'512K': ['generic', 'coredev']}}, 'upload': {'maximum_size': {'499696': ['generic', 'coredev']}}}, - '512K128': {'512K (128K SPIFFS)': ['generic', 'coredev'], 'build': {'flash_ld': {'eagle.flash.512k128.ld': ['generic', 'coredev']}, 'flash_size': {'512K': ['generic', 'coredev']}, 'spiffs_blocksize': {'4096': ['generic', 'coredev']}, 'spiffs_end': {'0x7B000': ['generic', 'coredev']}, 'spiffs_start': {'0x5B000': ['generic', 'coredev']}}, 'upload': {'maximum_size': {'368624': ['generic', 'coredev']}}}, - '512K64': {'512K (64K SPIFFS)': ['generic', 'coredev'], 'build': {'flash_ld': {'eagle.flash.512k64.ld': ['generic', 'coredev']}, 'flash_size': {'512K': ['generic', 'coredev']}, 'spiffs_blocksize': {'4096': ['generic', 'coredev']}, 'spiffs_end': {'0x7B000': ['generic', 'coredev']}, 'spiffs_start': {'0x6B000': ['generic', 'coredev']}}, 'upload': {'maximum_size': {'434160': ['generic', 'coredev']}}}, - '8M7M': {'8M (7M SPIFFS)': ['coredev'], 'build': {'flash_ld': {'eagle.flash.8m.ld': ['coredev']}, 'flash_size': {'8M': ['coredev']}, 'spiffs_blocksize': {'8192': ['coredev']}, 'spiffs_end': {'0x7FB000': ['coredev']}, 'spiffs_pagesize': {'256': ['coredev']}, 'spiffs_start': {'0x100000': ['coredev']}}, 'upload': {'maximum_size': {'1044464': ['coredev']}}}, - 'Flash Size': [None]}, - 'LwIPVariant': {'Espressif': {'Espressif (xcc)': ['coredev'], 'build': {'lwip_flags': {'-DLWIP_MAYBE_XCC': ['coredev']}, 'lwip_lib': {'-llwip': ['coredev']}}}, 'OpenSource': {'Open Source (gcc)': ['coredev'], 'build': {'lwip_flags': {'-DLWIP_OPEN_SRC': ['coredev']}, 'lwip_lib': {'-llwip_src': ['coredev']}}, 'recipe': {'hooks': {'sketch': {'prebuild': {'1': {'pattern': {'make -C "{runtime.platform.path}/tools/sdk/lwip/src" install TOOLS_PATH="{runtime.tools.xtensa-lx106-elf-gcc.path}/bin/xtensa-lx106-elf-"': ['coredev']}}}}}}}, 'Prebuilt': {'Prebuilt Source (gcc)': ['coredev'], 'build': {'lwip_flags': {'-DLWIP_OPEN_SRC': ['coredev']}, 'lwip_lib': {'-llwip_gcc': ['coredev']}}}, 'lwIP Variant': [None]}, - 'ResetMethod': {'Reset Method': [None], 'ck': {'ck': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'espino', 'coredev'], 'upload': {'resetmethod': {'ck': ['generic', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'espino', 'coredev']}}}, 'nodemcu': ['nodemcu', 'nodemcu', 'nodemcu', 'nodemcu', 'nodemcu', 'nodemcu', 'nodemcu'], 'upload': {'resetmethod': {'nodemcu': ['nodemcu', 'nodemcu', 'nodemcu', 'nodemcu', 'nodemcu', 'nodemcu', 'nodemcu']}}}, - 'UploadSpeed': {'115200': {'115200': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev'], 'upload': {'speed': {'115200': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}}}, - '230400': {'linux': {'230400': ['generic', 'esp8285', 'espduino', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}, 'macosx': {'230400': ['generic', 'esp8285', 'espduino', 'espduino', 'espresso_lite_v1', 'espresso_lite_v1', 'espresso_lite_v2', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v1', 'phoenix_v2', 'phoenix_v2', 'nodemcu', 'nodemcu', 'nodemcuv2', 'nodemcuv2', 'modwifi', 'modwifi', 'thing', 'thingdev', 'esp210', 'esp210', 'd1_mini', 'd1_mini', 'd1', 'd1', 'espino', 'espinotee', 'espinotee', 'wifinfo', 'coredev']}, 'upload': {'speed': {'230400': ['generic', 'esp8285', 'espduino', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}}}, - '256000': {'256000': ['huzzah'], 'upload': {'speed': {'256000': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}}, 'windows': {'256000': ['generic', 'esp8285', 'espduino', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}}, - '460800': {'linux': {'460800': ['generic', 'esp8285', 'espduino', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}, 'macosx': {'460800': ['generic', 'esp8285', 'espduino', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}, 'upload': {'speed': {'460800': ['generic', 'esp8285', 'espduino', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}}}, - '512000': {'upload': {'speed': {'512000': ['generic', 'esp8285', 'espduino', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}}, 'windows': {'512000': ['generic', 'esp8285', 'espduino', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}}, - '57600': {'57600': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev'], 'upload': {'speed': {'57600': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}}}, - '921600': {'921600': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev'], 'upload': {'speed': {'921600': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}}}, - '9600': {'9600': ['generic', 'esp8285', 'espduino', 'huzzah', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev'], 'upload': {'speed': {'9600': ['generic', 'esp8285', 'espduino', 'huzzah', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}}}, - 'Upload Speed': [None]}}, - 'name': {'Adafruit HUZZAH ESP8266': ['huzzah'], 'Core Development Module': ['coredev'], 'ESPDuino (ESP-13 Module)': ['espduino'], 'ESPino (ESP-12 Module)': ['espino'], 'ESPresso Lite 1.0': ['espresso_lite_v1'], 'ESPresso Lite 2.0': ['espresso_lite_v2'], 'Generic ESP8266 Module': ['generic'], 'Generic ESP8285 Module': ['esp8285'], 'NodeMCU 0.9 (ESP-12 Module)': ['nodemcu'], 'NodeMCU 1.0 (ESP-12E Module)': ['nodemcuv2'], 'Olimex MOD-WIFI-ESP8266(-DEV)': ['modwifi'], 'Phoenix 1.0': ['phoenix_v1'], 'Phoenix 2.0': ['phoenix_v2'], 'SparkFun ESP8266 Thing': ['thing'], 'SparkFun ESP8266 Thing Dev': ['thingdev'], 'SweetPea ESP-210': ['esp210'], "ThaiEasyElec's ESPino": ['espinotee'], 'WeMos D1 R2 & mini': ['d1_mini'], 'WeMos D1(Retired)': ['d1'], 'WifInfo': ['wifinfo']}, - 'serial': {'disableDTR': {'true': ['generic', 'esp8285', 'espduino', 'huzzah', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}, 'disableRTS': {'true': ['generic', 'esp8285', 'espduino', 'huzzah', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}}, - 'upload': {'maximum_data_size': {'81920': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}, 'maximum_size': {'1044464': ['espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee'], '434160': ['generic', 'esp8285', 'thing', 'thingdev', 'wifinfo', 'coredev']}, 'resetmethod': {'ck': ['generic', 'esp8285', 'espduino', 'modwifi', 'thing', 'esp210', 'espino', 'coredev'], 'nodemcu': ['huzzah', 'nodemcu', 'nodemcuv2', 'thingdev', 'd1_mini', 'd1', 'espinotee', 'wifinfo']}, 'speed': {'115200': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'esp210', 'espino', 'espinotee', 'wifinfo', 'coredev'], '460800': ['d1_mini', 'd1'], '921600': ['thing', 'thingdev']}, 'tool': {'esptool': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}, 'wait_for_upload_port': {'true': ['generic', 'esp8285', 'espduino', 'huzzah', 'espresso_lite_v1', 'espresso_lite_v2', 'phoenix_v1', 'phoenix_v2', 'nodemcu', 'nodemcuv2', 'modwifi', 'thing', 'thingdev', 'esp210', 'd1_mini', 'd1', 'espino', 'espinotee', 'wifinfo', 'coredev']}}}