From 4f2ca7dba5d4dfffabb748ef413569dfa5ede3c4 Mon Sep 17 00:00:00 2001 From: atanisoft Date: Fri, 23 Nov 2018 03:00:34 -0800 Subject: [PATCH 01/27] Force forward slash for paths for openocd-esp32, new board D-duino-32 (#139) * Force forward slash for paths for openocd-esp32 fixes #136 * adding D-duino-32 board type. This board has a built in OLED and non-standard SCL/SDA pins. --- boards/d-duino-32.json | 49 ++++++++++++++++++++++++++++++++++++++++++ builder/main.py | 6 +++--- 2 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 boards/d-duino-32.json diff --git a/boards/d-duino-32.json b/boards/d-duino-32.json new file mode 100644 index 0000000..bcf7d6b --- /dev/null +++ b/boards/d-duino-32.json @@ -0,0 +1,49 @@ +{ + "build": { + "core": "esp32", + "extra_flags": "-DARDUINO_D_DUINO_32", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "ldscript": "esp32_out.ld", + "mcu": "esp32", + "variant": "d-duino-32" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "debug": { + "openocd_board": "esp-wroom-32.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "D-duino-32", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "protocol": "esptool", + "protocols": [ + "esptool", + "esp-prog", + "jlink", + "olimex-arm-usb-tiny-h", + "olimex-arm-usb-ocd-h", + "olimex-arm-usb-ocd", + "olimex-jtag-tiny", + "iot-bus-jtag", + "tumpa", + "minimodule" + ], + "require_upload_port": true, + "speed": 921600 + }, + "url": "https://www.tindie.com/products/lspoplove/dstike-d-duino-32-v3/", + "vendor": "DSTIKE" + } + \ No newline at end of file diff --git a/builder/main.py b/builder/main.py index 45fa449..b2d0156 100644 --- a/builder/main.py +++ b/builder/main.py @@ -304,17 +304,17 @@ if upload_protocol == "esptool": elif upload_protocol in debug_tools: openocd_dir = platform.get_package_dir("tool-openocd-esp32") or "" - uploader_flags = ["-s", openocd_dir] + uploader_flags = ["-s", openocd_dir.replace('\\', '/')] uploader_flags.extend( debug_tools.get(upload_protocol).get("server").get("arguments", [])) uploader_flags.extend(["-c", 'program_esp32 "{{$SOURCE}}" 0x10000 verify']) for image in env.get("FLASH_EXTRA_IMAGES", []): uploader_flags.extend( - ["-c", 'program_esp32 "%s" %s verify' % (image[1], image[0])]) + ["-c", 'program_esp32 "%s" %s verify' % (image[1].replace('\\', '/'), image[0].replace('\\', '/'))]) uploader_flags.extend(["-c", "reset run; shutdown"]) for i, item in enumerate(uploader_flags): if "$PACKAGE_DIR" in item: - uploader_flags[i] = item.replace("$PACKAGE_DIR", openocd_dir) + uploader_flags[i] = item.replace("$PACKAGE_DIR", openocd_dir.replace('\\', '/')) env.Replace( UPLOADER="openocd", From 28bc32b23dbe2bb846df7cb3d8c87bb1b2be8e19 Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Sat, 24 Nov 2018 13:35:07 +0100 Subject: [PATCH 02/27] Add new boards: Pycom LoPy & LoPy4 (#134) * Create lopy4.json * Create lopy.json * Update lopy.json * Update lopy4.json * Update lopy.json * Update lopy4.json * Update lopy4.json * Update lopy.json * Update heltec_wifi_lora_32.json added debug field * Update heltec_wifi_lora_32.json added debug protocols --- boards/heltec_wifi_lora_32.json | 11 +++++++- boards/lopy.json | 45 +++++++++++++++++++++++++++++++++ boards/lopy4.json | 45 +++++++++++++++++++++++++++++++++ 3 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 boards/lopy.json create mode 100644 boards/lopy4.json diff --git a/boards/heltec_wifi_lora_32.json b/boards/heltec_wifi_lora_32.json index ee48d15..e5c559b 100644 --- a/boards/heltec_wifi_lora_32.json +++ b/boards/heltec_wifi_lora_32.json @@ -15,6 +15,9 @@ "ethernet", "can" ], + "debug": { + "openocd_board": "esp-wroom-32.cfg" + }, "frameworks": [ "arduino", "espidf" @@ -26,7 +29,13 @@ "maximum_size": 4194304, "protocol": "esptool", "protocols": [ - "esptool" + "esptool", + "esp-prog", + "olimex-arm-usb-tiny-h", + "olimex-arm-usb-ocd-h", + "olimex-arm-usb-ocd", + "olimex-jtag-tiny", + "minimodule" ], "require_upload_port": true, "speed": 921600 diff --git a/boards/lopy.json b/boards/lopy.json new file mode 100644 index 0000000..64084c0 --- /dev/null +++ b/boards/lopy.json @@ -0,0 +1,45 @@ + + "build": { + "core": "esp32", + "extra_flags": "-DARDUINO_LoPy", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "ldscript": "esp32_out.ld", + "mcu": "esp32", + "variant": "lopy" + }, + "connectivity": [ + "wifi", + "bluetooth", + "can", + "ethernet" + ], + "debug": { + "openocd_board": "esp-wroom-32.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "Pycom LoPy", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "protocol": "esptool", + "protocols": [ + "esptool", + "esp-prog", + "olimex-arm-usb-tiny-h", + "olimex-arm-usb-ocd-h", + "olimex-arm-usb-ocd", + "olimex-jtag-tiny", + "minimodule" + ], + "require_upload_port": true, + "speed": 921600 + }, + "url": "https://pycom.io/", + "vendor": "Pycom Ltd." +} diff --git a/boards/lopy4.json b/boards/lopy4.json new file mode 100644 index 0000000..573c0a4 --- /dev/null +++ b/boards/lopy4.json @@ -0,0 +1,45 @@ +{ + "build": { + "core": "esp32", + "extra_flags": "-DARDUINO_LoPy4", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "ldscript": "esp32_out.ld", + "mcu": "esp32", + "variant": "lopy4" + }, + "connectivity": [ + "wifi", + "bluetooth", + "can", + "ethernet" + ], + "debug": { + "openocd_board": "esp-wroom-32.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "Pycom LoPy4", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 1310720, + "maximum_size": 4194304, + "protocol": "esptool", + "protocols": [ + "esptool", + "esp-prog", + "olimex-arm-usb-tiny-h", + "olimex-arm-usb-ocd-h", + "olimex-arm-usb-ocd", + "olimex-jtag-tiny", + "minimodule" + ], + "require_upload_port": true, + "speed": 921600 + }, + "url": "https://pycom.io/", + "vendor": "Pycom Ltd." +} From 2817577da4f712887e431275258ec43f0992dd56 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 24 Nov 2018 15:10:10 +0200 Subject: [PATCH 03/27] Automatically generate known debug tools and upload protocols --- boards/alksesp32.json | 12 ----- boards/d-duino-32.json | 83 +++++++++++++------------------ boards/esp-wrover-kit.json | 11 +--- boards/esp32-evb.json | 12 ----- boards/esp32-gateway.json | 12 ----- boards/esp32-pro.json | 3 -- boards/esp320.json | 3 -- boards/esp32dev.json | 12 ----- boards/esp32doit-devkit-v1.json | 12 ----- boards/esp32thing.json | 12 ----- boards/esp32vn-iot-uno.json | 12 ----- boards/espea32.json | 3 -- boards/espectro32.json | 12 ----- boards/espino32.json | 12 ----- boards/featheresp32.json | 12 ----- boards/firebeetle32.json | 12 ----- boards/heltec_wifi_kit_32.json | 3 -- boards/heltec_wifi_lora_32.json | 9 ---- boards/hornbill32dev.json | 12 ----- boards/hornbill32minima.json | 12 ----- boards/intorobot.json | 3 -- boards/iotbusio.json | 12 ----- boards/iotbusproteus.json | 12 ----- boards/lolin32.json | 12 ----- boards/lolin_d32.json | 12 ----- boards/lolin_d32_pro.json | 12 ----- boards/lopy.json | 11 +--- boards/lopy4.json | 9 ---- boards/m5stack-core-esp32.json | 3 -- boards/m5stack-fire.json | 3 -- boards/mhetesp32devkit.json | 12 ----- boards/mhetesp32minikit.json | 12 ----- boards/microduino-core-esp32.json | 3 -- boards/nano32.json | 3 -- boards/nina_w10.json | 3 -- boards/node32s.json | 12 ----- boards/nodemcu-32s.json | 12 ----- boards/odroid_esp32.json | 3 -- boards/onehorse32dev.json | 3 -- boards/pico32.json | 3 -- boards/pocket_32.json | 12 ----- boards/quantum.json | 3 -- boards/ttgo-lora32-v1.json | 12 ----- boards/wemosbat.json | 12 ----- boards/widora-air.json | 3 -- boards/xinabox_cw02.json | 12 ----- platform.py | 18 ++++++- 47 files changed, 54 insertions(+), 444 deletions(-) diff --git a/boards/alksesp32.json b/boards/alksesp32.json index 437dd59..6fd1401 100644 --- a/boards/alksesp32.json +++ b/boards/alksesp32.json @@ -27,18 +27,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool", - "esp-prog", - "jlink", - "olimex-arm-usb-tiny-h", - "olimex-arm-usb-ocd-h", - "olimex-arm-usb-ocd", - "olimex-jtag-tiny", - "iot-bus-jtag", - "tumpa", - "minimodule" - ], "require_upload_port": true, "speed": 115200 }, diff --git a/boards/d-duino-32.json b/boards/d-duino-32.json index bcf7d6b..03adcb7 100644 --- a/boards/d-duino-32.json +++ b/boards/d-duino-32.json @@ -1,49 +1,36 @@ { - "build": { - "core": "esp32", - "extra_flags": "-DARDUINO_D_DUINO_32", - "f_cpu": "240000000L", - "f_flash": "40000000L", - "flash_mode": "dio", - "ldscript": "esp32_out.ld", - "mcu": "esp32", - "variant": "d-duino-32" - }, - "connectivity": [ - "wifi", - "bluetooth", - "ethernet", - "can" - ], - "debug": { - "openocd_board": "esp-wroom-32.cfg" - }, - "frameworks": [ - "arduino", - "espidf" - ], - "name": "D-duino-32", - "upload": { - "flash_size": "4MB", - "maximum_ram_size": 327680, - "maximum_size": 4194304, - "protocol": "esptool", - "protocols": [ - "esptool", - "esp-prog", - "jlink", - "olimex-arm-usb-tiny-h", - "olimex-arm-usb-ocd-h", - "olimex-arm-usb-ocd", - "olimex-jtag-tiny", - "iot-bus-jtag", - "tumpa", - "minimodule" - ], - "require_upload_port": true, - "speed": 921600 - }, - "url": "https://www.tindie.com/products/lspoplove/dstike-d-duino-32-v3/", - "vendor": "DSTIKE" - } - \ No newline at end of file + "build": { + "core": "esp32", + "extra_flags": "-DARDUINO_D_DUINO_32", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "ldscript": "esp32_out.ld", + "mcu": "esp32", + "variant": "d-duino-32" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "debug": { + "openocd_board": "esp-wroom-32.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "D-duino-32", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "protocol": "esptool", + "require_upload_port": true, + "speed": 921600 + }, + "url": "https://www.tindie.com/products/lspoplove/dstike-d-duino-32-v3/", + "vendor": "DSTIKE" +} diff --git a/boards/esp-wrover-kit.json b/boards/esp-wrover-kit.json index 6b8a5b4..2531e6f 100644 --- a/boards/esp-wrover-kit.json +++ b/boards/esp-wrover-kit.json @@ -40,16 +40,7 @@ "protocol": "esptool", "protocols": [ "esptool", - "ftdi", - "esp-prog", - "jlink", - "olimex-arm-usb-tiny-h", - "olimex-arm-usb-ocd-h", - "olimex-arm-usb-ocd", - "olimex-jtag-tiny", - "iot-bus-jtag", - "tumpa", - "minimodule" + "ftdi" ], "require_upload_port": true, "speed": 921600 diff --git a/boards/esp32-evb.json b/boards/esp32-evb.json index 4dff358..97b9bb7 100644 --- a/boards/esp32-evb.json +++ b/boards/esp32-evb.json @@ -28,18 +28,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool", - "esp-prog", - "jlink", - "olimex-arm-usb-tiny-h", - "olimex-arm-usb-ocd-h", - "olimex-arm-usb-ocd", - "olimex-jtag-tiny", - "iot-bus-jtag", - "tumpa", - "minimodule" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/esp32-gateway.json b/boards/esp32-gateway.json index 60edc4e..cb9ac03 100644 --- a/boards/esp32-gateway.json +++ b/boards/esp32-gateway.json @@ -28,18 +28,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool", - "esp-prog", - "jlink", - "olimex-arm-usb-tiny-h", - "olimex-arm-usb-ocd-h", - "olimex-arm-usb-ocd", - "olimex-jtag-tiny", - "iot-bus-jtag", - "tumpa", - "minimodule" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/esp32-pro.json b/boards/esp32-pro.json index 8e1b18b..cc99c5e 100644 --- a/boards/esp32-pro.json +++ b/boards/esp32-pro.json @@ -25,9 +25,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/esp320.json b/boards/esp320.json index fe2c064..08fe3d1 100644 --- a/boards/esp320.json +++ b/boards/esp320.json @@ -25,9 +25,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/esp32dev.json b/boards/esp32dev.json index 60850cd..e9271ed 100644 --- a/boards/esp32dev.json +++ b/boards/esp32dev.json @@ -28,18 +28,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool", - "esp-prog", - "jlink", - "olimex-arm-usb-tiny-h", - "olimex-arm-usb-ocd-h", - "olimex-arm-usb-ocd", - "olimex-jtag-tiny", - "iot-bus-jtag", - "tumpa", - "minimodule" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/esp32doit-devkit-v1.json b/boards/esp32doit-devkit-v1.json index e8a5e0c..9e06162 100644 --- a/boards/esp32doit-devkit-v1.json +++ b/boards/esp32doit-devkit-v1.json @@ -28,18 +28,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool", - "esp-prog", - "jlink", - "olimex-arm-usb-tiny-h", - "olimex-arm-usb-ocd-h", - "olimex-arm-usb-ocd", - "olimex-jtag-tiny", - "iot-bus-jtag", - "tumpa", - "minimodule" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/esp32thing.json b/boards/esp32thing.json index 056faae..550a5cb 100644 --- a/boards/esp32thing.json +++ b/boards/esp32thing.json @@ -28,18 +28,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool", - "esp-prog", - "jlink", - "olimex-arm-usb-tiny-h", - "olimex-arm-usb-ocd-h", - "olimex-arm-usb-ocd", - "olimex-jtag-tiny", - "iot-bus-jtag", - "tumpa", - "minimodule" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/esp32vn-iot-uno.json b/boards/esp32vn-iot-uno.json index a9d4dc5..0a9c39a 100644 --- a/boards/esp32vn-iot-uno.json +++ b/boards/esp32vn-iot-uno.json @@ -28,18 +28,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool", - "esp-prog", - "jlink", - "olimex-arm-usb-tiny-h", - "olimex-arm-usb-ocd-h", - "olimex-arm-usb-ocd", - "olimex-jtag-tiny", - "iot-bus-jtag", - "tumpa", - "minimodule" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/espea32.json b/boards/espea32.json index 1b94555..6bb3d52 100644 --- a/boards/espea32.json +++ b/boards/espea32.json @@ -25,9 +25,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/espectro32.json b/boards/espectro32.json index e09e2ca..30fe0d2 100644 --- a/boards/espectro32.json +++ b/boards/espectro32.json @@ -28,18 +28,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool", - "esp-prog", - "jlink", - "olimex-arm-usb-tiny-h", - "olimex-arm-usb-ocd-h", - "olimex-arm-usb-ocd", - "olimex-jtag-tiny", - "iot-bus-jtag", - "tumpa", - "minimodule" - ], "require_upload_port": true, "speed": 2000000 }, diff --git a/boards/espino32.json b/boards/espino32.json index 7a99c12..82664aa 100644 --- a/boards/espino32.json +++ b/boards/espino32.json @@ -28,18 +28,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool", - "esp-prog", - "jlink", - "olimex-arm-usb-tiny-h", - "olimex-arm-usb-ocd-h", - "olimex-arm-usb-ocd", - "olimex-jtag-tiny", - "iot-bus-jtag", - "tumpa", - "minimodule" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/featheresp32.json b/boards/featheresp32.json index a00b76a..bed8f15 100644 --- a/boards/featheresp32.json +++ b/boards/featheresp32.json @@ -28,18 +28,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool", - "esp-prog", - "jlink", - "olimex-arm-usb-tiny-h", - "olimex-arm-usb-ocd-h", - "olimex-arm-usb-ocd", - "olimex-jtag-tiny", - "iot-bus-jtag", - "tumpa", - "minimodule" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/firebeetle32.json b/boards/firebeetle32.json index 2d7a341..98678f2 100644 --- a/boards/firebeetle32.json +++ b/boards/firebeetle32.json @@ -28,18 +28,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool", - "esp-prog", - "jlink", - "olimex-arm-usb-tiny-h", - "olimex-arm-usb-ocd-h", - "olimex-arm-usb-ocd", - "olimex-jtag-tiny", - "iot-bus-jtag", - "tumpa", - "minimodule" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/heltec_wifi_kit_32.json b/boards/heltec_wifi_kit_32.json index 6e3c7bc..5d4db01 100644 --- a/boards/heltec_wifi_kit_32.json +++ b/boards/heltec_wifi_kit_32.json @@ -25,9 +25,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/heltec_wifi_lora_32.json b/boards/heltec_wifi_lora_32.json index e5c559b..f39ff1f 100644 --- a/boards/heltec_wifi_lora_32.json +++ b/boards/heltec_wifi_lora_32.json @@ -28,15 +28,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool", - "esp-prog", - "olimex-arm-usb-tiny-h", - "olimex-arm-usb-ocd-h", - "olimex-arm-usb-ocd", - "olimex-jtag-tiny", - "minimodule" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/hornbill32dev.json b/boards/hornbill32dev.json index 98e1bd3..0114770 100644 --- a/boards/hornbill32dev.json +++ b/boards/hornbill32dev.json @@ -28,18 +28,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool", - "esp-prog", - "jlink", - "olimex-arm-usb-tiny-h", - "olimex-arm-usb-ocd-h", - "olimex-arm-usb-ocd", - "olimex-jtag-tiny", - "iot-bus-jtag", - "tumpa", - "minimodule" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/hornbill32minima.json b/boards/hornbill32minima.json index 3c79e85..838b8cf 100644 --- a/boards/hornbill32minima.json +++ b/boards/hornbill32minima.json @@ -28,18 +28,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool", - "esp-prog", - "jlink", - "olimex-arm-usb-tiny-h", - "olimex-arm-usb-ocd-h", - "olimex-arm-usb-ocd", - "olimex-jtag-tiny", - "iot-bus-jtag", - "tumpa", - "minimodule" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/intorobot.json b/boards/intorobot.json index 5ab27c1..097f271 100644 --- a/boards/intorobot.json +++ b/boards/intorobot.json @@ -25,9 +25,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/iotbusio.json b/boards/iotbusio.json index 6c7adf2..cafa5b0 100644 --- a/boards/iotbusio.json +++ b/boards/iotbusio.json @@ -29,18 +29,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool", - "esp-prog", - "jlink", - "olimex-arm-usb-tiny-h", - "olimex-arm-usb-ocd-h", - "olimex-arm-usb-ocd", - "olimex-jtag-tiny", - "iot-bus-jtag", - "tumpa", - "minimodule" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/iotbusproteus.json b/boards/iotbusproteus.json index a06994b..3c4d176 100644 --- a/boards/iotbusproteus.json +++ b/boards/iotbusproteus.json @@ -29,18 +29,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool", - "esp-prog", - "jlink", - "olimex-arm-usb-tiny-h", - "olimex-arm-usb-ocd-h", - "olimex-arm-usb-ocd", - "olimex-jtag-tiny", - "iot-bus-jtag", - "tumpa", - "minimodule" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/lolin32.json b/boards/lolin32.json index 1a84a2e..e487d78 100644 --- a/boards/lolin32.json +++ b/boards/lolin32.json @@ -28,18 +28,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool", - "esp-prog", - "jlink", - "olimex-arm-usb-tiny-h", - "olimex-arm-usb-ocd-h", - "olimex-arm-usb-ocd", - "olimex-jtag-tiny", - "iot-bus-jtag", - "tumpa", - "minimodule" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/lolin_d32.json b/boards/lolin_d32.json index c13480b..29a8816 100644 --- a/boards/lolin_d32.json +++ b/boards/lolin_d32.json @@ -28,18 +28,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool", - "esp-prog", - "jlink", - "olimex-arm-usb-tiny-h", - "olimex-arm-usb-ocd-h", - "olimex-arm-usb-ocd", - "olimex-jtag-tiny", - "iot-bus-jtag", - "tumpa", - "minimodule" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/lolin_d32_pro.json b/boards/lolin_d32_pro.json index 1930a03..696ab3f 100644 --- a/boards/lolin_d32_pro.json +++ b/boards/lolin_d32_pro.json @@ -28,18 +28,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool", - "esp-prog", - "jlink", - "olimex-arm-usb-tiny-h", - "olimex-arm-usb-ocd-h", - "olimex-arm-usb-ocd", - "olimex-jtag-tiny", - "iot-bus-jtag", - "tumpa", - "minimodule" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/lopy.json b/boards/lopy.json index 64084c0..f1afd28 100644 --- a/boards/lopy.json +++ b/boards/lopy.json @@ -1,4 +1,4 @@ - +{ "build": { "core": "esp32", "extra_flags": "-DARDUINO_LoPy", @@ -28,15 +28,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool", - "esp-prog", - "olimex-arm-usb-tiny-h", - "olimex-arm-usb-ocd-h", - "olimex-arm-usb-ocd", - "olimex-jtag-tiny", - "minimodule" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/lopy4.json b/boards/lopy4.json index 573c0a4..007c120 100644 --- a/boards/lopy4.json +++ b/boards/lopy4.json @@ -28,15 +28,6 @@ "maximum_ram_size": 1310720, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool", - "esp-prog", - "olimex-arm-usb-tiny-h", - "olimex-arm-usb-ocd-h", - "olimex-arm-usb-ocd", - "olimex-jtag-tiny", - "minimodule" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/m5stack-core-esp32.json b/boards/m5stack-core-esp32.json index dcd382b..59f14e7 100644 --- a/boards/m5stack-core-esp32.json +++ b/boards/m5stack-core-esp32.json @@ -25,9 +25,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/m5stack-fire.json b/boards/m5stack-fire.json index c2953d2..7f319ca 100644 --- a/boards/m5stack-fire.json +++ b/boards/m5stack-fire.json @@ -25,9 +25,6 @@ "maximum_ram_size": 327680, "maximum_size": 16777216, "protocol": "esptool", - "protocols": [ - "esptool" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/mhetesp32devkit.json b/boards/mhetesp32devkit.json index 4ad8aa5..dc3ad6c 100644 --- a/boards/mhetesp32devkit.json +++ b/boards/mhetesp32devkit.json @@ -28,18 +28,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool", - "esp-prog", - "jlink", - "olimex-arm-usb-tiny-h", - "olimex-arm-usb-ocd-h", - "olimex-arm-usb-ocd", - "olimex-jtag-tiny", - "iot-bus-jtag", - "tumpa", - "minimodule" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/mhetesp32minikit.json b/boards/mhetesp32minikit.json index a2d6cf9..ef3c21c 100644 --- a/boards/mhetesp32minikit.json +++ b/boards/mhetesp32minikit.json @@ -28,18 +28,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool", - "esp-prog", - "jlink", - "olimex-arm-usb-tiny-h", - "olimex-arm-usb-ocd-h", - "olimex-arm-usb-ocd", - "olimex-jtag-tiny", - "iot-bus-jtag", - "tumpa", - "minimodule" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/microduino-core-esp32.json b/boards/microduino-core-esp32.json index 4d000ba..9677eed 100644 --- a/boards/microduino-core-esp32.json +++ b/boards/microduino-core-esp32.json @@ -25,9 +25,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool" - ], "require_upload_port": true, "speed": 2000000 }, diff --git a/boards/nano32.json b/boards/nano32.json index 79e9cf6..204b56c 100644 --- a/boards/nano32.json +++ b/boards/nano32.json @@ -27,9 +27,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/nina_w10.json b/boards/nina_w10.json index 8099566..3ae4680 100644 --- a/boards/nina_w10.json +++ b/boards/nina_w10.json @@ -26,9 +26,6 @@ "maximum_ram_size": 327680, "maximum_size": 2097152, "protocol": "esptool", - "protocols": [ - "esptool" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/node32s.json b/boards/node32s.json index 59e4174..72fa136 100644 --- a/boards/node32s.json +++ b/boards/node32s.json @@ -28,18 +28,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool", - "esp-prog", - "jlink", - "olimex-arm-usb-tiny-h", - "olimex-arm-usb-ocd-h", - "olimex-arm-usb-ocd", - "olimex-jtag-tiny", - "iot-bus-jtag", - "tumpa", - "minimodule" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/nodemcu-32s.json b/boards/nodemcu-32s.json index ed8325b..13e3711 100644 --- a/boards/nodemcu-32s.json +++ b/boards/nodemcu-32s.json @@ -28,18 +28,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool", - "esp-prog", - "jlink", - "olimex-arm-usb-tiny-h", - "olimex-arm-usb-ocd-h", - "olimex-arm-usb-ocd", - "olimex-jtag-tiny", - "iot-bus-jtag", - "tumpa", - "minimodule" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/odroid_esp32.json b/boards/odroid_esp32.json index 4edcb93..3eebbb3 100644 --- a/boards/odroid_esp32.json +++ b/boards/odroid_esp32.json @@ -25,9 +25,6 @@ "maximum_ram_size": 327680, "maximum_size": 16777216, "protocol": "esptool", - "protocols": [ - "esptool" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/onehorse32dev.json b/boards/onehorse32dev.json index d383639..5adcafc 100644 --- a/boards/onehorse32dev.json +++ b/boards/onehorse32dev.json @@ -25,9 +25,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/pico32.json b/boards/pico32.json index 223510d..b786a94 100644 --- a/boards/pico32.json +++ b/boards/pico32.json @@ -25,9 +25,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/pocket_32.json b/boards/pocket_32.json index 441ef9c..15cc54e 100644 --- a/boards/pocket_32.json +++ b/boards/pocket_32.json @@ -28,18 +28,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool", - "esp-prog", - "jlink", - "olimex-arm-usb-tiny-h", - "olimex-arm-usb-ocd-h", - "olimex-arm-usb-ocd", - "olimex-jtag-tiny", - "iot-bus-jtag", - "tumpa", - "minimodule" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/quantum.json b/boards/quantum.json index a0dac53..701274b 100644 --- a/boards/quantum.json +++ b/boards/quantum.json @@ -25,9 +25,6 @@ "maximum_ram_size": 327680, "maximum_size": 16777216, "protocol": "esptool", - "protocols": [ - "esptool" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/ttgo-lora32-v1.json b/boards/ttgo-lora32-v1.json index 2cd54b4..b8af8d3 100644 --- a/boards/ttgo-lora32-v1.json +++ b/boards/ttgo-lora32-v1.json @@ -28,18 +28,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool", - "esp-prog", - "jlink", - "olimex-arm-usb-tiny-h", - "olimex-arm-usb-ocd-h", - "olimex-arm-usb-ocd", - "olimex-jtag-tiny", - "iot-bus-jtag", - "tumpa", - "minimodule" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/wemosbat.json b/boards/wemosbat.json index b81dd21..4037c26 100644 --- a/boards/wemosbat.json +++ b/boards/wemosbat.json @@ -28,18 +28,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool", - "esp-prog", - "jlink", - "olimex-arm-usb-tiny-h", - "olimex-arm-usb-ocd-h", - "olimex-arm-usb-ocd", - "olimex-jtag-tiny", - "iot-bus-jtag", - "tumpa", - "minimodule" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/widora-air.json b/boards/widora-air.json index 7b5dcae..15dee83 100644 --- a/boards/widora-air.json +++ b/boards/widora-air.json @@ -25,9 +25,6 @@ "maximum_ram_size": 327680, "maximum_size": 16777216, "protocol": "esptool", - "protocols": [ - "esptool" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/boards/xinabox_cw02.json b/boards/xinabox_cw02.json index cff66b4..38e4e62 100644 --- a/boards/xinabox_cw02.json +++ b/boards/xinabox_cw02.json @@ -28,18 +28,6 @@ "maximum_ram_size": 327680, "maximum_size": 4194304, "protocol": "esptool", - "protocols": [ - "esptool", - "esp-prog", - "jlink", - "olimex-arm-usb-tiny-h", - "olimex-arm-usb-ocd-h", - "olimex-arm-usb-ocd", - "olimex-jtag-tiny", - "iot-bus-jtag", - "tumpa", - "minimodule" - ], "require_upload_port": true, "speed": 921600 }, diff --git a/platform.py b/platform.py index 61f023e..703da2e 100644 --- a/platform.py +++ b/platform.py @@ -38,13 +38,29 @@ class Espressif32Platform(PlatformBase): def _add_default_debug_tools(self, board): debug = board.manifest.get("debug", {}) - + upload_protocol = board.manifest.get("upload", {}).get("protocol") upload_protocols = board.manifest.get("upload", {}).get( "protocols", []) if "tools" not in debug: debug['tools'] = {} non_debug_protocols = ["esptool"] + supported_debu_tools = [ + "esp-prog", + "iot-bus-jtag", + "jlink", + "minimodule", + "olimex-arm-usb-tiny-h", + "olimex-arm-usb-ocd-h", + "olimex-arm-usb-ocd", + "olimex-jtag-tiny", + "tumpa" + ] + if debug: + upload_protocols.extend(supported_debu_tools) + + if upload_protocol and upload_protocol not in upload_protocols: + upload_protocols.append(upload_protocol) # Only FTDI based debug probes for link in upload_protocols: From faf9a065ba83e4e81e1f78d0404fc890824b8379 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 24 Nov 2018 15:29:21 +0200 Subject: [PATCH 04/27] Implement "erase" target // Resolve #127 --- builder/main.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/builder/main.py b/builder/main.py index b2d0156..d8846c5 100644 --- a/builder/main.py +++ b/builder/main.py @@ -146,6 +146,12 @@ env.Replace( SIZECHECKCMD="$SIZETOOL -A -d $SOURCES", SIZEPRINTCMD="$SIZETOOL -B -d $SOURCES", + ERASEFLAGS=[ + "--chip", "esp32", + "--port", '"$UPLOAD_PORT"' + ], + ERASECMD='"$PYTHONEXE" "$OBJCOPY" $ERASEFLAGS erase_flash', + MKSPIFFSTOOL="mkspiffs_${PIOPLATFORM}_${PIOFRAMEWORK}", PROGSUFFIX=".elf" ) @@ -331,6 +337,17 @@ else: AlwaysBuild(env.Alias(["upload", "uploadfs"], target_firm, upload_actions)) +# +# Target: Erase Flash +# + +AlwaysBuild( + env.Alias("erase", None, [ + env.VerboseAction(env.AutodetectUploadPort, + "Looking for serial port..."), + env.VerboseAction("$ERASECMD", "Ready for erasing") + ])) + # # Default targets # From abed0876859266a3c31276ac2c7d37404b9beaa9 Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Fri, 7 Dec 2018 00:09:50 +0100 Subject: [PATCH 05/27] Create ttgo-t-beam.json (#144) --- boards/ttgo-t-beam.json | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 boards/ttgo-t-beam.json diff --git a/boards/ttgo-t-beam.json b/boards/ttgo-t-beam.json new file mode 100644 index 0000000..dccad6f --- /dev/null +++ b/boards/ttgo-t-beam.json @@ -0,0 +1,36 @@ +{ + "build": { + "core": "esp32", + "extra_flags": "-DT-Beam", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "ldscript": "esp32_out.ld", + "mcu": "esp32", + "variant": "t-beam" + }, + "connectivity": [ + "wifi", + "bluetooth", + "can", + "ethernet" + ], + "debug": { + "openocd_board": "esp-wroom-32.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "TTGO T-Beam", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 1310720, + "maximum_size": 4194304, + "protocol": "esptool", + "require_upload_port": true, + "speed": 921600 + }, + "url": "https://github.com/LilyGO/TTGO-T-Beam", + "vendor": "TTGO" +} From 37047da2b57c78b7afcc14cde556fd25a9ef1157 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 13 Dec 2018 20:58:08 +0200 Subject: [PATCH 06/27] Mark oddWires boads as certified --- boards/iotbusio.json | 1 + boards/iotbusproteus.json | 1 + 2 files changed, 2 insertions(+) diff --git a/boards/iotbusio.json b/boards/iotbusio.json index cafa5b0..6ad310d 100644 --- a/boards/iotbusio.json +++ b/boards/iotbusio.json @@ -9,6 +9,7 @@ "mcu": "esp32", "variant": "esp32" }, + "certified": true, "connectivity": [ "wifi", "bluetooth", diff --git a/boards/iotbusproteus.json b/boards/iotbusproteus.json index 3c4d176..c18e233 100644 --- a/boards/iotbusproteus.json +++ b/boards/iotbusproteus.json @@ -9,6 +9,7 @@ "mcu": "esp32", "variant": "esp32" }, + "certified": true, "connectivity": [ "wifi", "bluetooth", From b838f45175250320e9f31fc5464f367a022fe23e Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 13 Dec 2018 20:58:30 +0200 Subject: [PATCH 07/27] Fix oddWires's Proteus board name --- boards/iotbusproteus.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/iotbusproteus.json b/boards/iotbusproteus.json index c18e233..a0112de 100644 --- a/boards/iotbusproteus.json +++ b/boards/iotbusproteus.json @@ -24,7 +24,7 @@ "arduino", "espidf" ], - "name": "oddWires Proteus IoT-Bus", + "name": "oddWires IoT-Bus Proteus", "upload": { "flash_size": "4MB", "maximum_ram_size": 327680, From 6cacc24d6d330d0a8ea42dae57036fc93976138d Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Thu, 13 Dec 2018 22:12:57 +0100 Subject: [PATCH 08/27] Update ttgo-t-beam.json (#146) --- boards/ttgo-t-beam.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/ttgo-t-beam.json b/boards/ttgo-t-beam.json index dccad6f..92d23b5 100644 --- a/boards/ttgo-t-beam.json +++ b/boards/ttgo-t-beam.json @@ -1,7 +1,7 @@ { "build": { "core": "esp32", - "extra_flags": "-DT-Beam", + "extra_flags": "-DARDUINO_T-Beam", "f_cpu": "240000000L", "f_flash": "40000000L", "flash_mode": "dio", From e4950be337df87875d3bb86fdae4ea0384163a14 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 15 Dec 2018 13:53:23 +0200 Subject: [PATCH 09/27] better handling of OTA address --- builder/main.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/builder/main.py b/builder/main.py index d8846c5..a7af5c5 100644 --- a/builder/main.py +++ b/builder/main.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import re +import socket import sys from os.path import isfile, join @@ -296,9 +296,10 @@ if upload_protocol == "esptool": # Handle uploading via OTA ota_port = None if env.get("UPLOAD_PORT"): - ota_port = re.match( - r"\"?((([0-9]{1,3}\.){3}[0-9]{1,3})|.+\.local)\"?$", - env.get("UPLOAD_PORT")) + try: + ota_port = socket.gethostbyname(env.get("UPLOAD_PORT")) + except socket.error: + pass if ota_port: env.Replace(UPLOADCMD="$UPLOADOTACMD") From caadff09bc91c4d80076265de6134e68810824b0 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 21 Dec 2018 17:06:41 +0200 Subject: [PATCH 10/27] Fix warning about "Unknown upload protocol custom" --- builder/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/main.py b/builder/main.py index a7af5c5..4d7bbf8 100644 --- a/builder/main.py +++ b/builder/main.py @@ -330,7 +330,7 @@ elif upload_protocol in debug_tools: upload_actions = [env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE")] # custom upload tool -elif "UPLOADCMD" in env: +elif upload_protocol == "custom": upload_actions = [env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE")] else: From e5fc098276165843b3d1a6d81fea91c253e3ab2f Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 26 Dec 2018 02:07:03 +0200 Subject: [PATCH 11/27] Escape Windows PATH for openOCD --- builder/main.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/builder/main.py b/builder/main.py index 4d7bbf8..9830f95 100644 --- a/builder/main.py +++ b/builder/main.py @@ -95,6 +95,10 @@ def _update_max_upload_size(env): env.BoardConfig().update("upload.maximum_size", max(sizes)) +def _to_unix_slashes(path): + return path.replace('\\', '/') + + # # SPIFFS helpers # @@ -317,11 +321,13 @@ elif upload_protocol in debug_tools: uploader_flags.extend(["-c", 'program_esp32 "{{$SOURCE}}" 0x10000 verify']) for image in env.get("FLASH_EXTRA_IMAGES", []): uploader_flags.extend( - ["-c", 'program_esp32 "%s" %s verify' % (image[1].replace('\\', '/'), image[0].replace('\\', '/'))]) + ["-c", 'program_esp32 "{{%s}}" %s verify' % ( + _to_unix_slashes(image[1]), _to_unix_slashes(image[0]))]) uploader_flags.extend(["-c", "reset run; shutdown"]) for i, item in enumerate(uploader_flags): if "$PACKAGE_DIR" in item: - uploader_flags[i] = item.replace("$PACKAGE_DIR", openocd_dir.replace('\\', '/')) + uploader_flags[i] = item.replace( + "$PACKAGE_DIR", _to_unix_slashes(openocd_dir)) env.Replace( UPLOADER="openocd", From a89a38222080b55681ab71cecb6a4f72112d51fa Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 26 Dec 2018 02:09:45 +0200 Subject: [PATCH 12/27] Minor fixes --- builder/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builder/main.py b/builder/main.py index 9830f95..b451aaa 100644 --- a/builder/main.py +++ b/builder/main.py @@ -315,14 +315,14 @@ if upload_protocol == "esptool": elif upload_protocol in debug_tools: openocd_dir = platform.get_package_dir("tool-openocd-esp32") or "" - uploader_flags = ["-s", openocd_dir.replace('\\', '/')] + uploader_flags = ["-s", _to_unix_slashes(openocd_dir)] uploader_flags.extend( debug_tools.get(upload_protocol).get("server").get("arguments", [])) uploader_flags.extend(["-c", 'program_esp32 "{{$SOURCE}}" 0x10000 verify']) for image in env.get("FLASH_EXTRA_IMAGES", []): uploader_flags.extend( ["-c", 'program_esp32 "{{%s}}" %s verify' % ( - _to_unix_slashes(image[1]), _to_unix_slashes(image[0]))]) + _to_unix_slashes(image[1]), image[0])]) uploader_flags.extend(["-c", "reset run; shutdown"]) for i, item in enumerate(uploader_flags): if "$PACKAGE_DIR" in item: From 21a6c67707f6d9f02c5fb9b886eb848d1195a7c9 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 26 Dec 2018 18:09:10 +0200 Subject: [PATCH 13/27] Automatically generate upload protocols based on debug tools --- platform.py | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/platform.py b/platform.py index 703da2e..f3a0991 100644 --- a/platform.py +++ b/platform.py @@ -37,31 +37,33 @@ class Espressif32Platform(PlatformBase): return result def _add_default_debug_tools(self, board): + non_debug_protocols = ["esptool"] + supported_debug_tools = [ + "esp-prog", + "iot-bus-jtag", + "jlink", + "minimodule", + "olimex-arm-usb-tiny-h", + "olimex-arm-usb-ocd-h", + "olimex-arm-usb-ocd", + "olimex-jtag-tiny", + "tumpa" + ] + debug = board.manifest.get("debug", {}) upload_protocol = board.manifest.get("upload", {}).get("protocol") upload_protocols = board.manifest.get("upload", {}).get( "protocols", []) - if "tools" not in debug: - debug['tools'] = {} - - non_debug_protocols = ["esptool"] - supported_debu_tools = [ - "esp-prog", - "iot-bus-jtag", - "jlink", - "minimodule", - "olimex-arm-usb-tiny-h", - "olimex-arm-usb-ocd-h", - "olimex-arm-usb-ocd", - "olimex-jtag-tiny", - "tumpa" - ] if debug: - upload_protocols.extend(supported_debu_tools) - + upload_protocols.extend(supported_debug_tools) if upload_protocol and upload_protocol not in upload_protocols: upload_protocols.append(upload_protocol) + board.manifest['upload']['protocols'] = upload_protocols + + if "tools" not in debug: + debug['tools'] = {} + # Only FTDI based debug probes for link in upload_protocols: if link in non_debug_protocols or link in debug['tools']: From d29e3c53c06882a88596b4d0a33ad8ff0a93e2e7 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 26 Dec 2018 18:10:45 +0200 Subject: [PATCH 14/27] Remove double quotes from openOCD commands --- builder/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builder/main.py b/builder/main.py index b451aaa..1e3ea14 100644 --- a/builder/main.py +++ b/builder/main.py @@ -318,10 +318,10 @@ elif upload_protocol in debug_tools: uploader_flags = ["-s", _to_unix_slashes(openocd_dir)] uploader_flags.extend( debug_tools.get(upload_protocol).get("server").get("arguments", [])) - uploader_flags.extend(["-c", 'program_esp32 "{{$SOURCE}}" 0x10000 verify']) + uploader_flags.extend(["-c", 'program_esp32 {{$SOURCE}} 0x10000 verify']) for image in env.get("FLASH_EXTRA_IMAGES", []): uploader_flags.extend( - ["-c", 'program_esp32 "{{%s}}" %s verify' % ( + ["-c", 'program_esp32 {{%s}} %s verify' % ( _to_unix_slashes(image[1]), image[0])]) uploader_flags.extend(["-c", "reset run; shutdown"]) for i, item in enumerate(uploader_flags): From bea35aeddae1433eec731a68a9d1eacf676ea872 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 26 Dec 2018 22:36:11 +0200 Subject: [PATCH 15/27] Skip PUMBAA example from CI (not Python 3 compatible) --- examples/pumbaa-blink/.skiptest | 1 + 1 file changed, 1 insertion(+) create mode 100644 examples/pumbaa-blink/.skiptest diff --git a/examples/pumbaa-blink/.skiptest b/examples/pumbaa-blink/.skiptest new file mode 100644 index 0000000..05e3ca0 --- /dev/null +++ b/examples/pumbaa-blink/.skiptest @@ -0,0 +1 @@ +.skiptest From 1b0c4045a7c4ecb58788a4562afc23207f1d434e Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 27 Dec 2018 02:47:28 +0200 Subject: [PATCH 16/27] Text examples with Python 3 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 58d8ed8..bc61382 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ language: python python: - "2.7" + - "3.5" env: - PLATFORMIO_PROJECT_DIR=examples/arduino-blink From febfe9029eb88d9a4ba18c7cb2a2578c8d2b71b6 Mon Sep 17 00:00:00 2001 From: valeros Date: Thu, 27 Dec 2018 21:39:43 +0200 Subject: [PATCH 17/27] Fix code incompatible with Python 3 --- builder/frameworks/_embedtxt_files.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/frameworks/_embedtxt_files.py b/builder/frameworks/_embedtxt_files.py index 5d64c56..1be72aa 100644 --- a/builder/frameworks/_embedtxt_files.py +++ b/builder/frameworks/_embedtxt_files.py @@ -36,7 +36,7 @@ def prepare_files(files): fp.seek(-1, SEEK_END) if fp.read(1) != '\0': fp.seek(0, SEEK_CUR) - fp.write('\0') + fp.write(b'\0') def extract_files(cppdefines): From e13bc275a1f920fd14de733e84eb5f43f66f78fc Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 9 Jan 2019 12:26:18 +0200 Subject: [PATCH 18/27] Fix board name --- boards/wemosbat.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/wemosbat.json b/boards/wemosbat.json index 4037c26..4b74638 100644 --- a/boards/wemosbat.json +++ b/boards/wemosbat.json @@ -22,7 +22,7 @@ "arduino", "espidf" ], - "name": "WeMos WiFi & Bluetooth Battery", + "name": "WeMos WiFi and Bluetooth Battery", "upload": { "flash_size": "4MB", "maximum_ram_size": 327680, From 5fc5602f4fb7ccf5b338906cf5e1ac12b8cb90b0 Mon Sep 17 00:00:00 2001 From: valeros Date: Wed, 9 Jan 2019 21:35:53 +0200 Subject: [PATCH 19/27] Update esp-idf package version --- platform.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.json b/platform.json index f18abce..f820cbe 100644 --- a/platform.json +++ b/platform.json @@ -50,7 +50,7 @@ "framework-espidf": { "type": "framework", "optional": true, - "version": "~3.30101.0" + "version": "~3.30102.190109" }, "framework-simba": { "type": "framework", From 59d2098691f9166a2ced6ae01263e596e2b8a315 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 10 Jan 2019 14:48:50 +0200 Subject: [PATCH 20/27] Update esptool.py to 2.6.0 --- platform.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.json b/platform.json index f820cbe..9cde765 100644 --- a/platform.json +++ b/platform.json @@ -64,7 +64,7 @@ }, "tool-esptoolpy": { "type": "uploader", - "version": "~1.20500.0" + "version": "~1.20600.0" }, "tool-espotapy": { "type": "uploader", From bb0a36934c4de81f316368bffbf33247d25120bb Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 10 Jan 2019 18:05:49 +0200 Subject: [PATCH 21/27] Disable PSRAM for ESP Wrover Kit by default --- boards/esp-wrover-kit.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/esp-wrover-kit.json b/boards/esp-wrover-kit.json index 2531e6f..2f2dce7 100644 --- a/boards/esp-wrover-kit.json +++ b/boards/esp-wrover-kit.json @@ -1,7 +1,7 @@ { "build": { "core": "esp32", - "extra_flags": "-DARDUINO_ESP32_DEV -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue", + "extra_flags": "-DARDUINO_ESP32_DEV", "f_cpu": "240000000L", "f_flash": "40000000L", "flash_mode": "dio", From 03fa2648c4cfc133feacd391c0a7e18068eff6e7 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 10 Jan 2019 18:06:09 +0200 Subject: [PATCH 22/27] Update boards data --- boards/m5stack-fire.json | 3 ++- boards/ttgo-t-beam.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/boards/m5stack-fire.json b/boards/m5stack-fire.json index 7f319ca..d2cf137 100644 --- a/boards/m5stack-fire.json +++ b/boards/m5stack-fire.json @@ -7,6 +7,7 @@ "flash_mode": "dio", "ldscript": "esp32_out.ld", "mcu": "esp32", + "partitions": "default_16MB.csv", "variant": "m5stack_fire" }, "connectivity": [ @@ -22,7 +23,7 @@ "name": "M5Stack FIRE", "upload": { "flash_size": "16MB", - "maximum_ram_size": 327680, + "maximum_ram_size": 6553600, "maximum_size": 16777216, "protocol": "esptool", "require_upload_port": true, diff --git a/boards/ttgo-t-beam.json b/boards/ttgo-t-beam.json index 92d23b5..85a038d 100644 --- a/boards/ttgo-t-beam.json +++ b/boards/ttgo-t-beam.json @@ -1,7 +1,7 @@ { "build": { "core": "esp32", - "extra_flags": "-DARDUINO_T-Beam", + "extra_flags": "-DARDUINO_T_Beam", "f_cpu": "240000000L", "f_flash": "40000000L", "flash_mode": "dio", From 8209abe69af4410f1f50a02a8ee8541fe4e6d3f2 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 10 Jan 2019 18:06:42 +0200 Subject: [PATCH 23/27] Add support for new boards --- boards/bpi-bit.json | 33 +++++++++++++++++++++++++++++++++ boards/esp32-poe.json | 33 +++++++++++++++++++++++++++++++++ boards/fm-devkit.json | 36 ++++++++++++++++++++++++++++++++++++ boards/oroca_edubot.json | 33 +++++++++++++++++++++++++++++++++ boards/turta_iot_node.json | 33 +++++++++++++++++++++++++++++++++ boards/wesp32.json | 36 ++++++++++++++++++++++++++++++++++++ 6 files changed, 204 insertions(+) create mode 100644 boards/bpi-bit.json create mode 100644 boards/esp32-poe.json create mode 100644 boards/fm-devkit.json create mode 100644 boards/oroca_edubot.json create mode 100644 boards/turta_iot_node.json create mode 100644 boards/wesp32.json diff --git a/boards/bpi-bit.json b/boards/bpi-bit.json new file mode 100644 index 0000000..b5c3521 --- /dev/null +++ b/boards/bpi-bit.json @@ -0,0 +1,33 @@ +{ + "build": { + "core": "esp32", + "extra_flags": "-DARDUINO_BPI_BIT", + "f_cpu": "160000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "ldscript": "esp32_out.ld", + "mcu": "esp32", + "variant": "bpi-bit" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "frameworks": [ + "arduino", + "espidf" + ], + "name": "BPI-Bit", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "protocol": "esptool", + "require_upload_port": true, + "speed": 921600 + }, + "url": "https://en.wikipedia.org/wiki/ESP32", + "vendor": "BPI Tech" +} diff --git a/boards/esp32-poe.json b/boards/esp32-poe.json new file mode 100644 index 0000000..c9d1bb1 --- /dev/null +++ b/boards/esp32-poe.json @@ -0,0 +1,33 @@ +{ + "build": { + "core": "esp32", + "extra_flags": "-DARDUINO_ESP32_POE", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "ldscript": "esp32_out.ld", + "mcu": "esp32", + "variant": "esp32-poe" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "frameworks": [ + "arduino", + "espidf" + ], + "name": "me=OLIMEX ESP32-PoE", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "protocol": "esptool", + "require_upload_port": true, + "speed": 921600 + }, + "url": "https://www.olimex.com/Products/IoT/ESP32/ESP32-POE/open-source-hardware", + "vendor": "OLIMEX" +} diff --git a/boards/fm-devkit.json b/boards/fm-devkit.json new file mode 100644 index 0000000..23897c4 --- /dev/null +++ b/boards/fm-devkit.json @@ -0,0 +1,36 @@ +{ + "build": { + "core": "esp32", + "extra_flags": "-DARDUINO_fm_devkit", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "ldscript": "esp32_out.ld", + "mcu": "esp32", + "variant": "fm-devkit" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "debug": { + "openocd_board": "esp-wroom-32.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "ESP32 FM DevKit", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "protocol": "esptool", + "require_upload_port": true, + "speed": 921600 + }, + "url": "https://github.com/dragon-engineer/esp32_fmdevkit", + "vendor": "Unknown" +} diff --git a/boards/oroca_edubot.json b/boards/oroca_edubot.json new file mode 100644 index 0000000..9b2e922 --- /dev/null +++ b/boards/oroca_edubot.json @@ -0,0 +1,33 @@ +{ + "build": { + "core": "esp32", + "extra_flags": "-DARDUINO_OROCA_EDUBOT", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "ldscript": "esp32_out.ld", + "mcu": "esp32", + "variant": "oroca_edubot" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "frameworks": [ + "arduino", + "espidf" + ], + "name": "OROCA EduBot", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "protocol": "esptool", + "require_upload_port": true, + "speed": 921600 + }, + "url": "https://github.com/oroca/OROCA-EduBot", + "vendor": "OROCA" +} diff --git a/boards/turta_iot_node.json b/boards/turta_iot_node.json new file mode 100644 index 0000000..8b4e0c0 --- /dev/null +++ b/boards/turta_iot_node.json @@ -0,0 +1,33 @@ +{ + "build": { + "core": "esp32", + "extra_flags": "-DARDUINO_ESP32_PICO", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "ldscript": "esp32_out.ld", + "mcu": "esp32", + "variant": "pico32" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "frameworks": [ + "arduino", + "espidf" + ], + "name": "Turta IoT Node", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "protocol": "esptool", + "require_upload_port": true, + "speed": 921600 + }, + "url": "https://www.turta.io/en/iotnode", + "vendor": "Turta" +} diff --git a/boards/wesp32.json b/boards/wesp32.json new file mode 100644 index 0000000..d05efb8 --- /dev/null +++ b/boards/wesp32.json @@ -0,0 +1,36 @@ +{ + "build": { + "core": "esp32", + "extra_flags": "-DARDUINO_WESP32", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "ldscript": "esp32_out.ld", + "mcu": "esp32", + "variant": "wesp32" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "debug": { + "openocd_board": "esp-wroom-32.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "Silicognition wESP32", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "protocol": "esptool", + "require_upload_port": true, + "speed": 921600 + }, + "url": "https://wesp32.com/", + "vendor": "Silicognition" +} From 13cd84594e40bc2a3fcf8a3c54cf2e233c2da295 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 10 Jan 2019 18:06:59 +0200 Subject: [PATCH 24/27] Update Arduino core to 1.0.1RC4 --- platform.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.json b/platform.json index 9cde765..7d120ef 100644 --- a/platform.json +++ b/platform.json @@ -45,7 +45,7 @@ "framework-arduinoespressif32": { "type": "framework", "optional": true, - "version": "~2.10000.0" + "version": "~2.10001.0" }, "framework-espidf": { "type": "framework", From 466aafdd68629c5f784d940bbe3c64be6e8ac188 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 11 Jan 2019 13:18:10 +0200 Subject: [PATCH 25/27] Update Arduino core to 1.0.1 --- platform.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.json b/platform.json index 7d120ef..7341730 100644 --- a/platform.json +++ b/platform.json @@ -45,7 +45,7 @@ "framework-arduinoespressif32": { "type": "framework", "optional": true, - "version": "~2.10001.0" + "version": "~2.10001.190111" }, "framework-espidf": { "type": "framework", From 788d6ff6c012e1f4dd2058397e322c4a1a029be7 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 11 Jan 2019 13:56:29 +0200 Subject: [PATCH 26/27] Bump version to 1.6.0 --- platform.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.json b/platform.json index 7341730..49d39ab 100644 --- a/platform.json +++ b/platform.json @@ -12,7 +12,7 @@ "type": "git", "url": "https://github.com/platformio/platform-espressif32.git" }, - "version": "1.5.0", + "version": "1.6.0", "packageRepositories": [ "https://dl.bintray.com/platformio/dl-packages/manifest.json", "http://dl.platformio.org/packages/manifest.json", From 5a5b55fcdbd804c9cb47431e719a75d7591e85e9 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 11 Jan 2019 13:57:01 +0200 Subject: [PATCH 27/27] Update compatible PlatformIO Core engine to <5 --- platform.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.json b/platform.json index 49d39ab..0442c17 100644 --- a/platform.json +++ b/platform.json @@ -6,7 +6,7 @@ "homepage": "http://platformio.org/platforms/espressif32", "license": "Apache-2.0", "engines": { - "platformio": "^3.0.0" + "platformio": "<5" }, "repository": { "type": "git",