From d405ba12c0525e5c919d81c01e63d81552e2e7c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kry=C5=A1tof=20=C4=8Cern=C3=BD?= Date: Wed, 24 Apr 2019 15:02:20 +0200 Subject: [PATCH 01/14] Change upload speed of ALKS board (#173) --- boards/alksesp32.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/alksesp32.json b/boards/alksesp32.json index 6fd1401..cd06af0 100644 --- a/boards/alksesp32.json +++ b/boards/alksesp32.json @@ -28,7 +28,7 @@ "maximum_size": 4194304, "protocol": "esptool", "require_upload_port": true, - "speed": 115200 + "speed": 921600 }, "url": "https://github.com/RoboticsBrno/ArduinoLearningKitStarter.git", "vendor": "RoboticsBrno" From d6981a0e98875828e93240b7987440c41fbd8b91 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 11 May 2019 22:13:26 +0300 Subject: [PATCH 02/14] Implement "espota" protocol --- boards/alksesp32.json | 1 - boards/bpi-bit.json | 1 - boards/d-duino-32.json | 1 - boards/esp-wrover-kit.json | 2 +- boards/esp32-evb.json | 1 - boards/esp32-gateway.json | 1 - boards/esp32-poe.json | 1 - boards/esp32-pro.json | 1 - boards/esp320.json | 1 - boards/esp32cam.json | 3 +- boards/esp32dev.json | 1 - boards/esp32doit-devkit-v1.json | 1 - boards/esp32thing.json | 1 - boards/esp32vn-iot-uno.json | 1 - boards/espea32.json | 1 - boards/espectro32.json | 1 - boards/espino32.json | 1 - boards/featheresp32.json | 1 - boards/firebeetle32.json | 1 - boards/fm-devkit.json | 1 - boards/frogboard.json | 1 - boards/heltec_wifi_kit_32.json | 1 - boards/heltec_wifi_lora_32.json | 1 - boards/heltec_wifi_lora_32_V2.json | 3 +- boards/heltec_wireless_stick.json | 3 +- boards/hornbill32dev.json | 1 - boards/hornbill32minima.json | 1 - boards/intorobot.json | 1 - boards/iotbusio.json | 1 - boards/iotbusproteus.json | 1 - boards/lolin32.json | 1 - boards/lolin_d32.json | 1 - boards/lolin_d32_pro.json | 1 - boards/lopy.json | 1 - boards/lopy4.json | 1 - boards/m5stack-core-esp32.json | 1 - boards/m5stack-fire.json | 1 - boards/m5stick-c.json | 1 - boards/mhetesp32devkit.json | 1 - boards/mhetesp32minikit.json | 1 - boards/microduino-core-esp32.json | 1 - boards/nano32.json | 1 - boards/nina_w10.json | 1 - boards/node32s.json | 1 - boards/nodemcu-32s.json | 1 - boards/odroid_esp32.json | 1 - boards/onehorse32dev.json | 1 - boards/oroca_edubot.json | 3 +- boards/pico32.json | 1 - boards/pocket_32.json | 1 - boards/quantum.json | 1 - boards/sparkfun_lora_gateway_1-channel.json | 1 - boards/ttgo-lora32-v1.json | 1 - boards/ttgo-t-beam.json | 1 - boards/turta_iot_node.json | 1 - boards/wemosbat.json | 1 - boards/wesp32.json | 1 - boards/widora-air.json | 1 - boards/xinabox_cw02.json | 1 - builder/main.py | 58 ++++++++++++--------- platform.py | 16 ++++-- 61 files changed, 50 insertions(+), 92 deletions(-) diff --git a/boards/alksesp32.json b/boards/alksesp32.json index cd06af0..ac9cca8 100644 --- a/boards/alksesp32.json +++ b/boards/alksesp32.json @@ -26,7 +26,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/bpi-bit.json b/boards/bpi-bit.json index b5c3521..c971c1b 100644 --- a/boards/bpi-bit.json +++ b/boards/bpi-bit.json @@ -24,7 +24,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/d-duino-32.json b/boards/d-duino-32.json index 03adcb7..733d5a0 100644 --- a/boards/d-duino-32.json +++ b/boards/d-duino-32.json @@ -27,7 +27,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/esp-wrover-kit.json b/boards/esp-wrover-kit.json index 2f2dce7..5bcb420 100644 --- a/boards/esp-wrover-kit.json +++ b/boards/esp-wrover-kit.json @@ -37,9 +37,9 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "protocols": [ "esptool", + "espota", "ftdi" ], "require_upload_port": true, diff --git a/boards/esp32-evb.json b/boards/esp32-evb.json index 97b9bb7..598b03f 100644 --- a/boards/esp32-evb.json +++ b/boards/esp32-evb.json @@ -27,7 +27,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/esp32-gateway.json b/boards/esp32-gateway.json index cb9ac03..792aba2 100644 --- a/boards/esp32-gateway.json +++ b/boards/esp32-gateway.json @@ -27,7 +27,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/esp32-poe.json b/boards/esp32-poe.json index 082e0b3..e97c941 100644 --- a/boards/esp32-poe.json +++ b/boards/esp32-poe.json @@ -24,7 +24,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/esp32-pro.json b/boards/esp32-pro.json index cc99c5e..9aa25cf 100644 --- a/boards/esp32-pro.json +++ b/boards/esp32-pro.json @@ -24,7 +24,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/esp320.json b/boards/esp320.json index 08fe3d1..85d2b47 100644 --- a/boards/esp320.json +++ b/boards/esp320.json @@ -24,7 +24,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/esp32cam.json b/boards/esp32cam.json index 4f68396..1e0640a 100644 --- a/boards/esp32cam.json +++ b/boards/esp32cam.json @@ -6,8 +6,8 @@ "f_flash": "40000000L", "flash_mode": "dio", "ldscript": "esp32_out.ld", - "partitions": "huge_app.csv", "mcu": "esp32", + "partitions": "huge_app.csv", "variant": "esp32" }, "connectivity": [ @@ -25,7 +25,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 460800 }, diff --git a/boards/esp32dev.json b/boards/esp32dev.json index e9271ed..f560a60 100644 --- a/boards/esp32dev.json +++ b/boards/esp32dev.json @@ -27,7 +27,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/esp32doit-devkit-v1.json b/boards/esp32doit-devkit-v1.json index 9e06162..4352482 100644 --- a/boards/esp32doit-devkit-v1.json +++ b/boards/esp32doit-devkit-v1.json @@ -27,7 +27,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/esp32thing.json b/boards/esp32thing.json index 550a5cb..6970f06 100644 --- a/boards/esp32thing.json +++ b/boards/esp32thing.json @@ -27,7 +27,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/esp32vn-iot-uno.json b/boards/esp32vn-iot-uno.json index 0a9c39a..dbe1f4c 100644 --- a/boards/esp32vn-iot-uno.json +++ b/boards/esp32vn-iot-uno.json @@ -27,7 +27,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/espea32.json b/boards/espea32.json index 6bb3d52..e2ca12b 100644 --- a/boards/espea32.json +++ b/boards/espea32.json @@ -24,7 +24,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/espectro32.json b/boards/espectro32.json index 30fe0d2..789b1aa 100644 --- a/boards/espectro32.json +++ b/boards/espectro32.json @@ -27,7 +27,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 2000000 }, diff --git a/boards/espino32.json b/boards/espino32.json index 82664aa..1292af6 100644 --- a/boards/espino32.json +++ b/boards/espino32.json @@ -27,7 +27,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/featheresp32.json b/boards/featheresp32.json index bed8f15..218d7f4 100644 --- a/boards/featheresp32.json +++ b/boards/featheresp32.json @@ -27,7 +27,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/firebeetle32.json b/boards/firebeetle32.json index 98678f2..d20d98a 100644 --- a/boards/firebeetle32.json +++ b/boards/firebeetle32.json @@ -27,7 +27,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/fm-devkit.json b/boards/fm-devkit.json index 23897c4..cb5225e 100644 --- a/boards/fm-devkit.json +++ b/boards/fm-devkit.json @@ -27,7 +27,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/frogboard.json b/boards/frogboard.json index 976eb06..0649ee4 100644 --- a/boards/frogboard.json +++ b/boards/frogboard.json @@ -27,7 +27,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/heltec_wifi_kit_32.json b/boards/heltec_wifi_kit_32.json index 952cd32..1484461 100644 --- a/boards/heltec_wifi_kit_32.json +++ b/boards/heltec_wifi_kit_32.json @@ -24,7 +24,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/heltec_wifi_lora_32.json b/boards/heltec_wifi_lora_32.json index fb50ec9..554c6f3 100644 --- a/boards/heltec_wifi_lora_32.json +++ b/boards/heltec_wifi_lora_32.json @@ -27,7 +27,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/heltec_wifi_lora_32_V2.json b/boards/heltec_wifi_lora_32_V2.json index 7b72aa5..3f89021 100644 --- a/boards/heltec_wifi_lora_32_V2.json +++ b/boards/heltec_wifi_lora_32_V2.json @@ -6,8 +6,8 @@ "f_flash": "40000000L", "flash_mode": "dio", "ldscript": "esp32_out.ld", - "partitions": "default_8MB.csv", "mcu": "esp32", + "partitions": "default_8MB.csv", "variant": "heltec_wifi_lora_32_V2" }, "connectivity": [ @@ -28,7 +28,6 @@ "flash_size": "8MB", "maximum_ram_size": 327680, "maximum_size": 8388608, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/heltec_wireless_stick.json b/boards/heltec_wireless_stick.json index e348705..b3fe3ee 100644 --- a/boards/heltec_wireless_stick.json +++ b/boards/heltec_wireless_stick.json @@ -6,8 +6,8 @@ "f_flash": "40000000L", "flash_mode": "dio", "ldscript": "esp32_out.ld", - "partitions": "default_8MB.csv", "mcu": "esp32", + "partitions": "default_8MB.csv", "variant": "heltec_wireless_stick" }, "connectivity": [ @@ -28,7 +28,6 @@ "flash_size": "8MB", "maximum_ram_size": 327680, "maximum_size": 8388608, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/hornbill32dev.json b/boards/hornbill32dev.json index 0114770..dfcc5ca 100644 --- a/boards/hornbill32dev.json +++ b/boards/hornbill32dev.json @@ -27,7 +27,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/hornbill32minima.json b/boards/hornbill32minima.json index 838b8cf..d7a850d 100644 --- a/boards/hornbill32minima.json +++ b/boards/hornbill32minima.json @@ -27,7 +27,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/intorobot.json b/boards/intorobot.json index 097f271..1c13162 100644 --- a/boards/intorobot.json +++ b/boards/intorobot.json @@ -24,7 +24,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/iotbusio.json b/boards/iotbusio.json index 6ad310d..24cc4cd 100644 --- a/boards/iotbusio.json +++ b/boards/iotbusio.json @@ -29,7 +29,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/iotbusproteus.json b/boards/iotbusproteus.json index a0112de..e7db599 100644 --- a/boards/iotbusproteus.json +++ b/boards/iotbusproteus.json @@ -29,7 +29,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/lolin32.json b/boards/lolin32.json index e487d78..d264cd5 100644 --- a/boards/lolin32.json +++ b/boards/lolin32.json @@ -27,7 +27,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/lolin_d32.json b/boards/lolin_d32.json index 29a8816..54cff73 100644 --- a/boards/lolin_d32.json +++ b/boards/lolin_d32.json @@ -27,7 +27,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/lolin_d32_pro.json b/boards/lolin_d32_pro.json index 696ab3f..c96ba26 100644 --- a/boards/lolin_d32_pro.json +++ b/boards/lolin_d32_pro.json @@ -27,7 +27,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/lopy.json b/boards/lopy.json index f1afd28..2c6ecaa 100644 --- a/boards/lopy.json +++ b/boards/lopy.json @@ -27,7 +27,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/lopy4.json b/boards/lopy4.json index 007c120..c26596c 100644 --- a/boards/lopy4.json +++ b/boards/lopy4.json @@ -27,7 +27,6 @@ "flash_size": "4MB", "maximum_ram_size": 1310720, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/m5stack-core-esp32.json b/boards/m5stack-core-esp32.json index 59f14e7..ca13b1a 100644 --- a/boards/m5stack-core-esp32.json +++ b/boards/m5stack-core-esp32.json @@ -24,7 +24,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/m5stack-fire.json b/boards/m5stack-fire.json index d2cf137..e846bb4 100644 --- a/boards/m5stack-fire.json +++ b/boards/m5stack-fire.json @@ -25,7 +25,6 @@ "flash_size": "16MB", "maximum_ram_size": 6553600, "maximum_size": 16777216, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/m5stick-c.json b/boards/m5stick-c.json index 5699aea..b5d7425 100644 --- a/boards/m5stick-c.json +++ b/boards/m5stick-c.json @@ -24,7 +24,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 1500000 }, diff --git a/boards/mhetesp32devkit.json b/boards/mhetesp32devkit.json index dc3ad6c..6d85361 100644 --- a/boards/mhetesp32devkit.json +++ b/boards/mhetesp32devkit.json @@ -27,7 +27,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/mhetesp32minikit.json b/boards/mhetesp32minikit.json index ef3c21c..fc2e414 100644 --- a/boards/mhetesp32minikit.json +++ b/boards/mhetesp32minikit.json @@ -27,7 +27,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/microduino-core-esp32.json b/boards/microduino-core-esp32.json index 9677eed..0dd02ba 100644 --- a/boards/microduino-core-esp32.json +++ b/boards/microduino-core-esp32.json @@ -24,7 +24,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 2000000 }, diff --git a/boards/nano32.json b/boards/nano32.json index 204b56c..f594860 100644 --- a/boards/nano32.json +++ b/boards/nano32.json @@ -26,7 +26,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/nina_w10.json b/boards/nina_w10.json index 3ae4680..1a06afb 100644 --- a/boards/nina_w10.json +++ b/boards/nina_w10.json @@ -25,7 +25,6 @@ "flash_size": "2MB", "maximum_ram_size": 327680, "maximum_size": 2097152, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/node32s.json b/boards/node32s.json index 72fa136..488b20f 100644 --- a/boards/node32s.json +++ b/boards/node32s.json @@ -27,7 +27,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/nodemcu-32s.json b/boards/nodemcu-32s.json index 13e3711..e91b385 100644 --- a/boards/nodemcu-32s.json +++ b/boards/nodemcu-32s.json @@ -27,7 +27,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/odroid_esp32.json b/boards/odroid_esp32.json index 3eebbb3..b7761fc 100644 --- a/boards/odroid_esp32.json +++ b/boards/odroid_esp32.json @@ -24,7 +24,6 @@ "flash_size": "16MB", "maximum_ram_size": 327680, "maximum_size": 16777216, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/onehorse32dev.json b/boards/onehorse32dev.json index 5adcafc..5781a54 100644 --- a/boards/onehorse32dev.json +++ b/boards/onehorse32dev.json @@ -24,7 +24,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/oroca_edubot.json b/boards/oroca_edubot.json index c54e2ef..6224392 100644 --- a/boards/oroca_edubot.json +++ b/boards/oroca_edubot.json @@ -6,8 +6,8 @@ "f_flash": "40000000L", "flash_mode": "dio", "ldscript": "esp32_out.ld", - "partitions": "huge_app.csv", "mcu": "esp32", + "partitions": "huge_app.csv", "variant": "oroca_edubot" }, "connectivity": [ @@ -25,7 +25,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/pico32.json b/boards/pico32.json index b786a94..b02fff0 100644 --- a/boards/pico32.json +++ b/boards/pico32.json @@ -24,7 +24,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/pocket_32.json b/boards/pocket_32.json index 15cc54e..455b381 100644 --- a/boards/pocket_32.json +++ b/boards/pocket_32.json @@ -27,7 +27,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/quantum.json b/boards/quantum.json index 701274b..746c5c0 100644 --- a/boards/quantum.json +++ b/boards/quantum.json @@ -24,7 +24,6 @@ "flash_size": "16MB", "maximum_ram_size": 327680, "maximum_size": 16777216, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/sparkfun_lora_gateway_1-channel.json b/boards/sparkfun_lora_gateway_1-channel.json index 7494456..8242063 100644 --- a/boards/sparkfun_lora_gateway_1-channel.json +++ b/boards/sparkfun_lora_gateway_1-channel.json @@ -27,7 +27,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/ttgo-lora32-v1.json b/boards/ttgo-lora32-v1.json index b8af8d3..21421d0 100644 --- a/boards/ttgo-lora32-v1.json +++ b/boards/ttgo-lora32-v1.json @@ -27,7 +27,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/ttgo-t-beam.json b/boards/ttgo-t-beam.json index 85a038d..75dd975 100644 --- a/boards/ttgo-t-beam.json +++ b/boards/ttgo-t-beam.json @@ -27,7 +27,6 @@ "flash_size": "4MB", "maximum_ram_size": 1310720, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/turta_iot_node.json b/boards/turta_iot_node.json index 8b4e0c0..0bccbd0 100644 --- a/boards/turta_iot_node.json +++ b/boards/turta_iot_node.json @@ -24,7 +24,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/wemosbat.json b/boards/wemosbat.json index 4b74638..02c0e93 100644 --- a/boards/wemosbat.json +++ b/boards/wemosbat.json @@ -27,7 +27,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/wesp32.json b/boards/wesp32.json index d05efb8..dd97f3a 100644 --- a/boards/wesp32.json +++ b/boards/wesp32.json @@ -27,7 +27,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/widora-air.json b/boards/widora-air.json index 15dee83..d9df178 100644 --- a/boards/widora-air.json +++ b/boards/widora-air.json @@ -24,7 +24,6 @@ "flash_size": "16MB", "maximum_ram_size": 327680, "maximum_size": 16777216, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/boards/xinabox_cw02.json b/boards/xinabox_cw02.json index 38e4e62..c0f1ac7 100644 --- a/boards/xinabox_cw02.json +++ b/boards/xinabox_cw02.json @@ -27,7 +27,6 @@ "flash_size": "4MB", "maximum_ram_size": 327680, "maximum_size": 4194304, - "protocol": "esptool", "require_upload_port": true, "speed": 921600 }, diff --git a/builder/main.py b/builder/main.py index d3afded..b12cd9b 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 socket +import re import sys from os.path import isfile, join @@ -253,12 +253,39 @@ upload_protocol = env.subst("$UPLOAD_PROTOCOL") debug_tools = env.BoardConfig().get("debug.tools", {}) upload_actions = [] -if upload_protocol == "esptool": +# Compatibility with old OTA configurations +if (upload_protocol != "espota" + and re.match(r"\"?((([0-9]{1,3}\.){3}[0-9]{1,3})|[^\\/]+\.local)\"?$", + env.get("UPLOAD_PORT", ""))): + upload_protocol = "espota" + sys.stderr.write( + "Warning! We have just detected `upload_port` as IP address or host " + "name of ESP device. `upload_protocol` is switched to `espota`.\n" + "Please specify `upload_protocol = espota` in `platformio.ini` " + "project configuration file.\n") + +if upload_protocol == "espota": + if not env.subst("$UPLOAD_PORT"): + sys.stderr.write( + "Error: Please specify IP address or host name of ESP device " + "using `upload_port` for build environment or use " + "global `--upload-port` option.\n" + "See https://docs.platformio.org/page/platforms/" + "espressif32.html#over-the-air-ota-update\n") + env.Replace( + UPLOADER=join( + platform.get_package_dir("tool-espotapy") or "", "espota.py"), + UPLOADERFLAGS=["--debug", "--progress", "-i", "$UPLOAD_PORT"], + UPLOADCMD='"$PYTHONEXE" "$UPLOADER" $UPLOADERFLAGS -f $SOURCE' + ) + if "uploadfs" in COMMAND_LINE_TARGETS: + env.Append(UPLOADERFLAGS=["-s"]) + upload_actions = [env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE")] + +elif upload_protocol == "esptool": env.Replace( UPLOADER=join( platform.get_package_dir("tool-esptoolpy") or "", "esptool.py"), - UPLOADEROTA=join( - platform.get_package_dir("tool-espotapy") or "", "espota.py"), UPLOADERFLAGS=[ "--chip", "esp32", "--port", '"$UPLOAD_PORT"', @@ -270,12 +297,7 @@ if upload_protocol == "esptool": "--flash_freq", "${__get_board_f_flash(__env__)}", "--flash_size", "detect" ], - UPLOADEROTAFLAGS=[ - "--debug", "--progress", "-i", "$UPLOAD_PORT", "-p", "3232", - "$UPLOAD_FLAGS" - ], - UPLOADCMD='"$PYTHONEXE" "$UPLOADER" $UPLOADERFLAGS 0x10000 $SOURCE', - UPLOADOTACMD='"$PYTHONEXE" "$UPLOADEROTA" $UPLOADEROTAFLAGS -f $SOURCE', + UPLOADCMD='"$PYTHONEXE" "$UPLOADER" $UPLOADERFLAGS 0x10000 $SOURCE' ) for image in env.get("FLASH_EXTRA_IMAGES", []): env.Append(UPLOADERFLAGS=[image[0], env.subst(image[1])]) @@ -295,17 +317,6 @@ if upload_protocol == "esptool": ], UPLOADCMD='"$PYTHONEXE" "$UPLOADER" $UPLOADERFLAGS $SOURCE', ) - env.Append(UPLOADEROTAFLAGS=["-s"]) - - # Handle uploading via OTA - ota_port = None - if env.get("UPLOAD_PORT"): - try: - ota_port = socket.gethostbyname(env.get("UPLOAD_PORT")) - except socket.error: - pass - if ota_port: - env.Replace(UPLOADCMD="$UPLOADOTACMD") upload_actions = [ env.VerboseAction(env.AutodetectUploadPort, @@ -350,9 +361,8 @@ AlwaysBuild(env.Alias(["upload", "uploadfs"], target_firm, upload_actions)) AlwaysBuild( env.Alias("erase", None, [ - env.VerboseAction(env.AutodetectUploadPort, - "Looking for serial port..."), - env.VerboseAction("$ERASECMD", "Ready for erasing") + env.VerboseAction(env.AutodetectUploadPort, "Looking for serial port..."), + env.VerboseAction("$ERASECMD", "Erasing...") ])) # diff --git a/platform.py b/platform.py index f3a0991..abff57f 100644 --- a/platform.py +++ b/platform.py @@ -30,13 +30,21 @@ class Espressif32Platform(PlatformBase): if not result: return result if id_: - return self._add_default_debug_tools(result) + return self._add_dynamic_options(result) else: for key, value in result.items(): - result[key] = self._add_default_debug_tools(result[key]) + result[key] = self._add_dynamic_options(result[key]) return result - def _add_default_debug_tools(self, board): + def _add_dynamic_options(self, board): + # upload protocols + if not board.get("upload.protocols", []): + board.manifest['upload']['protocols'] = ["esptool", "espota"] + if not board.get("upload.protocol", ""): + board.manifest['upload']['protocol'] = "esptool" + + # debug tools + debug = board.manifest.get("debug", {}) non_debug_protocols = ["esptool"] supported_debug_tools = [ "esp-prog", @@ -50,7 +58,6 @@ class Espressif32Platform(PlatformBase): "tumpa" ] - debug = board.manifest.get("debug", {}) upload_protocol = board.manifest.get("upload", {}).get("protocol") upload_protocols = board.manifest.get("upload", {}).get( "protocols", []) @@ -58,7 +65,6 @@ class Espressif32Platform(PlatformBase): 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: From 1cb24226355d7865646f5268a51a3e1c6ab07cfa Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 14 May 2019 00:23:48 +0300 Subject: [PATCH 03/14] Switch to "espota" script from Arduino core --- builder/main.py | 3 ++- platform.json | 5 ----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/builder/main.py b/builder/main.py index b12cd9b..85f60cc 100644 --- a/builder/main.py +++ b/builder/main.py @@ -274,7 +274,8 @@ if upload_protocol == "espota": "espressif32.html#over-the-air-ota-update\n") env.Replace( UPLOADER=join( - platform.get_package_dir("tool-espotapy") or "", "espota.py"), + platform.get_package_dir("framework-arduinoespressif32") or "", + "tools", "espota.py"), UPLOADERFLAGS=["--debug", "--progress", "-i", "$UPLOAD_PORT"], UPLOADCMD='"$PYTHONEXE" "$UPLOADER" $UPLOADERFLAGS -f $SOURCE' ) diff --git a/platform.json b/platform.json index 6be492c..29ebc37 100644 --- a/platform.json +++ b/platform.json @@ -66,11 +66,6 @@ "type": "uploader", "version": "~1.20600.0" }, - "tool-espotapy": { - "type": "uploader", - "optional": true, - "version": "~1.1.0" - }, "tool-openocd-esp32": { "type": "debugger", "optional": true, From 0fdfebb5f6a9cc660ddcea57c036af18e3d5b794 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 21 May 2019 11:53:00 +0300 Subject: [PATCH 04/14] Exclude "espota" from debugging probe list --- platform.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.py b/platform.py index abff57f..597ade8 100644 --- a/platform.py +++ b/platform.py @@ -45,7 +45,7 @@ class Espressif32Platform(PlatformBase): # debug tools debug = board.manifest.get("debug", {}) - non_debug_protocols = ["esptool"] + non_debug_protocols = ["esptool", "espota"] supported_debug_tools = [ "esp-prog", "iot-bus-jtag", From 29d44cfd6385dda4d1997c568b9ca43ee86e9eef Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 28 May 2019 14:09:26 +0300 Subject: [PATCH 05/14] Implement verbose mode for "upload" target --- builder/main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/builder/main.py b/builder/main.py index 85f60cc..6e47841 100644 --- a/builder/main.py +++ b/builder/main.py @@ -16,8 +16,9 @@ import re import sys from os.path import isfile, join -from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Builder, Default, - DefaultEnvironment) +from SCons.Script import ( + ARGUMENTS, COMMAND_LINE_TARGETS, AlwaysBuild, Builder, Default, + DefaultEnvironment) # # Helpers @@ -328,6 +329,8 @@ elif upload_protocol == "esptool": elif upload_protocol in debug_tools: openocd_dir = platform.get_package_dir("tool-openocd-esp32") or "" uploader_flags = ["-s", _to_unix_slashes(openocd_dir)] + if not int(ARGUMENTS.get("PIOVERBOSE", 0)): + uploader_flags.extend(["--debug", "1"]) uploader_flags.extend( debug_tools.get(upload_protocol).get("server").get("arguments", [])) uploader_flags.extend(["-c", 'program_esp32 {{$SOURCE}} 0x10000 verify']) From 6d6874f2e51a379404fd2f35086ffc97d77fb2eb Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 12 Jun 2019 14:19:35 +0300 Subject: [PATCH 06/14] Fix verbose output for openOCD --- builder/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/main.py b/builder/main.py index 6e47841..45602e6 100644 --- a/builder/main.py +++ b/builder/main.py @@ -330,7 +330,7 @@ elif upload_protocol in debug_tools: openocd_dir = platform.get_package_dir("tool-openocd-esp32") or "" uploader_flags = ["-s", _to_unix_slashes(openocd_dir)] if not int(ARGUMENTS.get("PIOVERBOSE", 0)): - uploader_flags.extend(["--debug", "1"]) + uploader_flags.append("--debug=1") uploader_flags.extend( debug_tools.get(upload_protocol).get("server").get("arguments", [])) uploader_flags.extend(["-c", 'program_esp32 {{$SOURCE}} 0x10000 verify']) From cb35c874e5a33d4be20bbb8e93b076b5a944599e Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 12 Jun 2019 23:09:40 +0300 Subject: [PATCH 07/14] Declare "target_elf" for "nobuild" --- builder/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/builder/main.py b/builder/main.py index 45602e6..da4464e 100644 --- a/builder/main.py +++ b/builder/main.py @@ -208,6 +208,7 @@ if not env.get("PIOFRAMEWORK"): target_elf = env.BuildProgram() if "nobuild" in COMMAND_LINE_TARGETS: + target_elf = join("$BUILD_DIR", "${PROGNAME}.elf") if set(["uploadfs", "uploadfsota"]) & set(COMMAND_LINE_TARGETS): fetch_spiffs_size(env) target_firm = join("$BUILD_DIR", "spiffs.bin") From 0dbb36de4d0ab32cd024db827471fcd2b9e399c5 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 13 Jun 2019 20:48:15 +0300 Subject: [PATCH 08/14] Automatically configure openOCD scripts folder --- builder/main.py | 53 +++++++++++++++++++++++++++---------------------- platform.py | 4 ++-- 2 files changed, 31 insertions(+), 26 deletions(-) diff --git a/builder/main.py b/builder/main.py index da4464e..f00e813 100644 --- a/builder/main.py +++ b/builder/main.py @@ -93,7 +93,7 @@ def _update_max_upload_size(env): if p['type'] in ("0", "app") ] if sizes: - env.BoardConfig().update("upload.maximum_size", max(sizes)) + board.update("upload.maximum_size", max(sizes)) def _to_unix_slashes(path): @@ -129,6 +129,7 @@ def __fetch_spiffs_size(target, source, env): env = DefaultEnvironment() platform = env.PioPlatform() +board = env.BoardConfig() env.Replace( __get_board_f_flash=_get_board_f_flash, @@ -177,8 +178,7 @@ env.Append( "elf2image", "--flash_mode", "$BOARD_FLASH_MODE", "--flash_freq", "${__get_board_f_flash(__env__)}", - "--flash_size", env.BoardConfig().get( - "upload.flash_size", "detect"), + "--flash_size", board.get("upload.flash_size", "detect"), "-o", "$TARGET", "$SOURCES" ]), "Building $TARGET"), suffix=".bin" @@ -252,7 +252,7 @@ AlwaysBuild(target_size) # upload_protocol = env.subst("$UPLOAD_PROTOCOL") -debug_tools = env.BoardConfig().get("debug.tools", {}) +debug_tools = board.get("debug.tools", {}) upload_actions = [] # Compatibility with old OTA configurations @@ -328,27 +328,31 @@ elif upload_protocol == "esptool": ] elif upload_protocol in debug_tools: - openocd_dir = platform.get_package_dir("tool-openocd-esp32") or "" - uploader_flags = ["-s", _to_unix_slashes(openocd_dir)] - if not int(ARGUMENTS.get("PIOVERBOSE", 0)): - uploader_flags.append("--debug=1") - uploader_flags.extend( + openocd_args = ["-d%d" % (2 if int(ARGUMENTS.get("PIOVERBOSE", 0)) else 1)] + openocd_args.extend( debug_tools.get(upload_protocol).get("server").get("arguments", [])) - uploader_flags.extend(["-c", 'program_esp32 {{$SOURCE}} 0x10000 verify']) + openocd_args.extend([ + "-c", + "program_esp32 {{$SOURCE}} %s verify" % + board.get("upload.offset_address", "0x10000") + ]) for image in env.get("FLASH_EXTRA_IMAGES", []): - uploader_flags.extend( - ["-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): - if "$PACKAGE_DIR" in item: - uploader_flags[i] = item.replace( - "$PACKAGE_DIR", _to_unix_slashes(openocd_dir)) - - env.Replace( - UPLOADER="openocd", - UPLOADERFLAGS=uploader_flags, - UPLOADCMD="$UPLOADER $UPLOADERFLAGS") + openocd_args.extend([ + "-c", + 'program_esp32 {{%s}} %s verify' % + (_to_unix_slashes(image[1]), image[0]) + ]) + openocd_args.extend(["-c", "reset run; shutdown"]) + openocd_args = [ + f.replace( + "$PACKAGE_DIR", + _to_unix_slashes( + platform.get_package_dir("tool-openocd-esp32") or "")) + for f in openocd_args + ] + env.Replace(UPLOADER="openocd", + UPLOADERFLAGS=openocd_args, + UPLOADCMD="$UPLOADER $UPLOADERFLAGS") upload_actions = [env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE")] # custom upload tool @@ -366,7 +370,8 @@ AlwaysBuild(env.Alias(["upload", "uploadfs"], target_firm, upload_actions)) AlwaysBuild( env.Alias("erase", None, [ - env.VerboseAction(env.AutodetectUploadPort, "Looking for serial port..."), + env.VerboseAction(env.AutodetectUploadPort, + "Looking for serial port..."), env.VerboseAction("$ERASECMD", "Erasing...") ])) diff --git a/platform.py b/platform.py index 597ade8..088a5fe 100644 --- a/platform.py +++ b/platform.py @@ -84,8 +84,8 @@ class Espressif32Platform(PlatformBase): server_args = [ "-s", "$PACKAGE_DIR/share/openocd/scripts", - "-f", "share/openocd/scripts/interface/%s.cfg" % openocd_interface, - "-f", "share/openocd/scripts/board/%s" % debug.get("openocd_board") + "-f", "interface/%s.cfg" % openocd_interface, + "-f", "board/%s" % debug.get("openocd_board") ] debug['tools'][link] = { From 8d08246acdeb8a828bc59d213e8bf449b9de53c5 Mon Sep 17 00:00:00 2001 From: valeros Date: Thu, 20 Jun 2019 13:42:21 +0300 Subject: [PATCH 09/14] Add initial support for ULP programming // Issue #95 --- builder/frameworks/espidf.py | 25 ++ builder/frameworks/ulp.py | 171 +++++++++ examples/espidf-ulp-adc/.gitignore | 2 + examples/espidf-ulp-adc/.travis.yml | 67 ++++ examples/espidf-ulp-adc/README.rst | 38 ++ examples/espidf-ulp-adc/include/README | 39 ++ examples/espidf-ulp-adc/lib/README | 46 +++ examples/espidf-ulp-adc/platformio.ini | 14 + examples/espidf-ulp-adc/src/sdkconfig.h | 349 ++++++++++++++++++ .../espidf-ulp-adc/src/ulp_adc_example_main.c | 94 +++++ examples/espidf-ulp-adc/test/README | 11 + examples/espidf-ulp-adc/ulp/adc.S | 115 ++++++ examples/espidf-ulp-pulse/.gitignore | 2 + examples/espidf-ulp-pulse/.travis.yml | 67 ++++ examples/espidf-ulp-pulse/README.rst | 38 ++ examples/espidf-ulp-pulse/include/README | 39 ++ examples/espidf-ulp-pulse/lib/README | 46 +++ examples/espidf-ulp-pulse/platformio.ini | 14 + examples/espidf-ulp-pulse/src/sdkconfig.h | 349 ++++++++++++++++++ .../espidf-ulp-pulse/src/ulp_example_main.c | 119 ++++++ examples/espidf-ulp-pulse/test/README | 11 + examples/espidf-ulp-pulse/ulp/pulse_cnt.S | 157 ++++++++ platform.json | 5 + platform.py | 5 + 24 files changed, 1823 insertions(+) create mode 100644 builder/frameworks/ulp.py create mode 100644 examples/espidf-ulp-adc/.gitignore create mode 100644 examples/espidf-ulp-adc/.travis.yml create mode 100644 examples/espidf-ulp-adc/README.rst create mode 100644 examples/espidf-ulp-adc/include/README create mode 100644 examples/espidf-ulp-adc/lib/README create mode 100644 examples/espidf-ulp-adc/platformio.ini create mode 100644 examples/espidf-ulp-adc/src/sdkconfig.h create mode 100644 examples/espidf-ulp-adc/src/ulp_adc_example_main.c create mode 100644 examples/espidf-ulp-adc/test/README create mode 100644 examples/espidf-ulp-adc/ulp/adc.S create mode 100644 examples/espidf-ulp-pulse/.gitignore create mode 100644 examples/espidf-ulp-pulse/.travis.yml create mode 100644 examples/espidf-ulp-pulse/README.rst create mode 100644 examples/espidf-ulp-pulse/include/README create mode 100644 examples/espidf-ulp-pulse/lib/README create mode 100644 examples/espidf-ulp-pulse/platformio.ini create mode 100644 examples/espidf-ulp-pulse/src/sdkconfig.h create mode 100644 examples/espidf-ulp-pulse/src/ulp_example_main.c create mode 100644 examples/espidf-ulp-pulse/test/README create mode 100644 examples/espidf-ulp-pulse/ulp/pulse_cnt.S diff --git a/builder/frameworks/espidf.py b/builder/frameworks/espidf.py index e53be61..781f547 100644 --- a/builder/frameworks/espidf.py +++ b/builder/frameworks/espidf.py @@ -35,6 +35,11 @@ platform = env.PioPlatform() env.SConscript("_bare.py", exports="env") env.SConscript("_embedtxt_files.py", exports="env") +ulp_lib = None +ulp_dir = join(env.subst("$PROJECT_DIR"), "ulp") +if isdir(ulp_dir) and listdir(ulp_dir): + ulp_lib = env.SConscript("ulp.py", exports="env") + FRAMEWORK_DIR = platform.get_package_dir("framework-espidf") assert FRAMEWORK_DIR and isdir(FRAMEWORK_DIR) @@ -56,6 +61,12 @@ def get_toolchain_version(): platform.get_package_version("toolchain-xtensa32")) +def is_ulp_enabled(sdk_params): + ulp_memory = int(sdk_params.get("CONFIG_ULP_COPROC_RESERVE_MEM", 0)) + ulp_enabled = int(sdk_params.get("CONFIG_ULP_COPROC_ENABLED", 0)) + return ulp_memory > 0 and ulp_enabled != 0 + + def parse_mk(path): result = {} variable = None @@ -608,6 +619,20 @@ env.Depends("$BUILD_DIR/$PROGNAME$PROGSUFFIX", env.ElfToBin( libs = [] +if ulp_lib: + if not is_ulp_enabled(sdk_params): + print("Warning! ULP is not properly configured." + "Add next configuration lines to your sdkconfig.h:") + print (" #define CONFIG_ULP_COPROC_ENABLED 1") + print (" #define CONFIG_ULP_COPROC_RESERVE_MEM 1024") + + libs.append(ulp_lib) + env.Append( + CPPPATH=[join("$BUILD_DIR", "ulp_app")], + LIBPATH=[join("$BUILD_DIR", "ulp_app")], + LINKFLAGS=["-T", "ulp_main.ld"] + ) + ignore_dirs = ( "bootloader", "esptool_py", diff --git a/builder/frameworks/ulp.py b/builder/frameworks/ulp.py new file mode 100644 index 0000000..3d261ee --- /dev/null +++ b/builder/frameworks/ulp.py @@ -0,0 +1,171 @@ +# Copyright 2019-present PlatformIO +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from os import remove +from os.path import exists, join + +from shutil import copyfile + +from SCons.Script import Builder, Import, Return + +Import("env") + +ulp_env = env.Clone() + +platform = ulp_env.PioPlatform() +FRAMEWORK_DIR = platform.get_package_dir("framework-espidf") +ULP_TOOLCHAIN_DIR = platform.get_package_dir("toolchain-esp32ulp") +ULP_BUILD_DIR = join("$BUILD_DIR", "ulp_app") + +# ULP toolchain binaries should be in PATH +ulp_env.PrependENVPath("PATH", join(ULP_TOOLCHAIN_DIR, "bin")) + + +def bin_converter(target, source, env): + # A workaround that helps avoid changing working directory + # in order to generate symbols that are irrespective of path + temp_source = join(env.subst("$PROJECT_DIR"), source[0].name) + copyfile(source[0].get_path(), temp_source) + + command = " ".join([ + "xtensa-esp32-elf-objcopy", "--input-target", + "binary", "--output-target", + "elf32-xtensa-le", "--binary-architecture", + "xtensa", "--rename-section", + ".data=.rodata.embedded", + source[0].name, target[0].get_path() + ]) + + ulp_env.Execute(command) + + if exists(temp_source): + remove(temp_source) + + return None + + +ulp_env.Append( + CPPPATH=["$PROJECTSRC_DIR"], + + BUILDERS=dict( + BuildElf=Builder( + action=ulp_env.VerboseAction(" ".join([ + "esp32ulp-elf-ld", + "-o", "$TARGET", + "-A", "elf32-esp32ulp", + "-L", ULP_BUILD_DIR, + "-T", "ulp_main.common.ld", + "$SOURCES" + ]), "Linking $TARGET"), + suffix=".elf" + ), + UlpElfToBin=Builder( + action=ulp_env.VerboseAction(" ".join([ + "esp32ulp-elf-objcopy", + "-O", "binary", + "$SOURCE", "$TARGET" + ]), "Building $TARGET"), + suffix=".bin" + ), + ConvertBin=Builder( + action=bin_converter, + suffix=".bin.bin.o" + ), + PreprocAs=Builder( + action=ulp_env.VerboseAction(" ".join([ + "xtensa-esp32-elf-gcc", + "-DESP_PLATFORM", "-MMD", "-MP", "-DGCC_NOT_5_2_0=0", + "-DWITH_POSIX", "-DHAVE_CONFIG_H", + "-MT", "${TARGET}.o", + "-DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\"", + "-I %s" % join( + FRAMEWORK_DIR, "components", "soc", "esp32", "include"), + "-E", "-P", "-xc", + "-o", "$TARGET", "-D__ASSEMBLER__", "$SOURCE" + ]), "Preprocessing $TARGET"), + single_source=True, + suffix=".ulp.pS" + ), + AsToObj=Builder( + action=ulp_env.VerboseAction(" ".join([ + "esp32ulp-elf-as", + "-o", "$TARGET", "$SOURCE" + ]), "Compiling $TARGET"), + single_source=True, + suffix=".o" + ) + ) +) + + +def preprocess_ld_script(): + arguments = ("-DESP_PLATFORM", "-MMD", "-MP", "-DGCC_NOT_5_2_0=0", + "-DWITH_POSIX", "-D__ASSEMBLER__", + '-DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h"', + "-DHAVE_CONFIG_H", "-MT", "$TARGET", "-E", "-P", "-xc", "-o", + "$TARGET", "-I $PROJECTSRC_DIR", "$SOURCE") + + return ulp_env.Command( + join(ULP_BUILD_DIR, "ulp_main.common.ld"), + join(FRAMEWORK_DIR, "components", "ulp", "ld", "esp32.ulp.ld"), + ulp_env.VerboseAction('xtensa-esp32-elf-gcc %s' % " ".join(arguments), + "Preprocessing linker script $TARGET")) + + +def collect_src_files(src_path): + return ulp_env.CollectBuildFiles(ULP_BUILD_DIR, src_path) + + +def generate_global_symbols(elf_file): + return ulp_env.Command( + join(ULP_BUILD_DIR, "ulp_main.sym"), elf_file, + ulp_env.VerboseAction( + "esp32ulp-elf-nm -g -f posix $SOURCE > $TARGET", + "Generating global symbols $TARGET")) + + +def generate_export_files(symbol_file): + # generates ld script and header file + gen_script = join(FRAMEWORK_DIR, "components", "ulp", "esp32ulp_mapgen.py") + build_suffix = join(ULP_BUILD_DIR, "ulp_main") + return ulp_env.Command( + [join(ULP_BUILD_DIR, "ulp_main.ld"), + join(ULP_BUILD_DIR, "ulp_main.h")], symbol_file, + ulp_env.VerboseAction( + '"$PYTHONEXE" "%s" -s $SOURCE -o %s' % (gen_script, build_suffix), + "Exporting ULP linker and header files")) + + +def create_static_lib(bin_file): + return ulp_env.StaticLibrary(join(ULP_BUILD_DIR, "ulp_main"), [bin_file]) + + +ulp_src_files = collect_src_files( + join(ulp_env.subst("$PROJECT_DIR"), "ulp")) +objects = ulp_env.AsToObj(ulp_env.PreprocAs(ulp_src_files)) +ulp_elf = ulp_env.BuildElf(join(ULP_BUILD_DIR, "ulp_main"), objects) +raw_ulp_binary = ulp_env.UlpElfToBin(ulp_elf) +ulp_bin = ulp_env.ConvertBin(raw_ulp_binary) +global_symbols = generate_global_symbols(ulp_elf) +export_files = generate_export_files(global_symbols) + +ulp_lib = create_static_lib(ulp_bin) + +ulp_env.Depends(ulp_lib, export_files) +ulp_env.Depends(ulp_elf, preprocess_ld_script()) + +# ULP sources must be built before the files in "src" folder +ulp_env.Requires(join("$BUILD_DIR", "${PROGNAME}.elf"), ulp_lib) + +Return("ulp_lib") diff --git a/examples/espidf-ulp-adc/.gitignore b/examples/espidf-ulp-adc/.gitignore new file mode 100644 index 0000000..6c69f4c --- /dev/null +++ b/examples/espidf-ulp-adc/.gitignore @@ -0,0 +1,2 @@ +.pioenvs +.piolibdeps diff --git a/examples/espidf-ulp-adc/.travis.yml b/examples/espidf-ulp-adc/.travis.yml new file mode 100644 index 0000000..7c486f1 --- /dev/null +++ b/examples/espidf-ulp-adc/.travis.yml @@ -0,0 +1,67 @@ +# Continuous Integration (CI) is the practice, in software +# engineering, of merging all developer working copies with a shared mainline +# several times a day < https://docs.platformio.org/page/ci/index.html > +# +# Documentation: +# +# * Travis CI Embedded Builds with PlatformIO +# < https://docs.travis-ci.com/user/integration/platformio/ > +# +# * PlatformIO integration with Travis CI +# < https://docs.platformio.org/page/ci/travis.html > +# +# * User Guide for `platformio ci` command +# < https://docs.platformio.org/page/userguide/cmd_ci.html > +# +# +# Please choose one of the following templates (proposed below) and uncomment +# it (remove "# " before each line) or use own configuration according to the +# Travis CI documentation (see above). +# + + +# +# Template #1: General project. Test it using existing `platformio.ini`. +# + +# language: python +# python: +# - "2.7" +# +# sudo: false +# cache: +# directories: +# - "~/.platformio" +# +# install: +# - pip install -U platformio +# - platformio update +# +# script: +# - platformio run + + +# +# Template #2: The project is intended to be used as a library with examples. +# + +# language: python +# python: +# - "2.7" +# +# sudo: false +# cache: +# directories: +# - "~/.platformio" +# +# env: +# - PLATFORMIO_CI_SRC=path/to/test/file.c +# - PLATFORMIO_CI_SRC=examples/file.ino +# - PLATFORMIO_CI_SRC=path/to/test/directory +# +# install: +# - pip install -U platformio +# - platformio update +# +# script: +# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N diff --git a/examples/espidf-ulp-adc/README.rst b/examples/espidf-ulp-adc/README.rst new file mode 100644 index 0000000..0a284cb --- /dev/null +++ b/examples/espidf-ulp-adc/README.rst @@ -0,0 +1,38 @@ +.. Copyright 2014-present PlatformIO + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +How to build PlatformIO based project +===================================== + +1. `Install PlatformIO Core `_ +2. Download `development platform with examples `_ +3. Extract ZIP archive +4. Run these commands: + +.. code-block:: bash + + # Change directory to example + > cd platform-espressif32/examples/espidf-ulp-adc + + # Build project + > platformio run + + # Upload firmware + > platformio run --target upload + + # Build specific environment + > platformio run -e esp32dev + + # Upload firmware for the specific environment + > platformio run -e esp32dev --target upload + + # Clean build files + > platformio run --target clean diff --git a/examples/espidf-ulp-adc/include/README b/examples/espidf-ulp-adc/include/README new file mode 100644 index 0000000..194dcd4 --- /dev/null +++ b/examples/espidf-ulp-adc/include/README @@ -0,0 +1,39 @@ + +This directory is intended for project header files. + +A header file is a file containing C declarations and macro definitions +to be shared between several project source files. You request the use of a +header file in your project source file (C, C++, etc) located in `src` folder +by including it, with the C preprocessing directive `#include'. + +```src/main.c + +#include "header.h" + +int main (void) +{ + ... +} +``` + +Including a header file produces the same results as copying the header file +into each source file that needs it. Such copying would be time-consuming +and error-prone. With a header file, the related declarations appear +in only one place. If they need to be changed, they can be changed in one +place, and programs that include the header file will automatically use the +new version when next recompiled. The header file eliminates the labor of +finding and changing all the copies as well as the risk that a failure to +find one copy will result in inconsistencies within a program. + +In C, the usual convention is to give header files names that end with `.h'. +It is most portable to use only letters, digits, dashes, and underscores in +header file names, and at most one dot. + +Read more about using header files in official GCC documentation: + +* Include Syntax +* Include Operation +* Once-Only Headers +* Computed Includes + +https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/examples/espidf-ulp-adc/lib/README b/examples/espidf-ulp-adc/lib/README new file mode 100644 index 0000000..6debab1 --- /dev/null +++ b/examples/espidf-ulp-adc/lib/README @@ -0,0 +1,46 @@ + +This directory is intended for project specific (private) libraries. +PlatformIO will compile them to static libraries and link into executable file. + +The source code of each library should be placed in a an own separate directory +("lib/your_library_name/[here are source files]"). + +For example, see a structure of the following two libraries `Foo` and `Bar`: + +|--lib +| | +| |--Bar +| | |--docs +| | |--examples +| | |--src +| | |- Bar.c +| | |- Bar.h +| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html +| | +| |--Foo +| | |- Foo.c +| | |- Foo.h +| | +| |- README --> THIS FILE +| +|- platformio.ini +|--src + |- main.c + +and a contents of `src/main.c`: +``` +#include +#include + +int main (void) +{ + ... +} + +``` + +PlatformIO Library Dependency Finder will find automatically dependent +libraries scanning project source files. + +More information about PlatformIO Library Dependency Finder +- https://docs.platformio.org/page/librarymanager/ldf.html diff --git a/examples/espidf-ulp-adc/platformio.ini b/examples/espidf-ulp-adc/platformio.ini new file mode 100644 index 0000000..cf23761 --- /dev/null +++ b/examples/espidf-ulp-adc/platformio.ini @@ -0,0 +1,14 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter, extra scripting +; Upload options: custom port, speed and extra flags +; Library options: dependencies, extra library storages +; +; Please visit documentation for the other options and examples +; http://docs.platformio.org/page/projectconf.html + +[env:esp32dev] +platform = espressif32 +framework = espidf +board = esp32dev +build_flags = -DCONFIG_WIFI_SSID=\"ESP_AP\" -DCONFIG_WIFI_PASSWORD=\"MYPASS\" diff --git a/examples/espidf-ulp-adc/src/sdkconfig.h b/examples/espidf-ulp-adc/src/sdkconfig.h new file mode 100644 index 0000000..a278aa1 --- /dev/null +++ b/examples/espidf-ulp-adc/src/sdkconfig.h @@ -0,0 +1,349 @@ +/* + * + * Automatically generated file; DO NOT EDIT. + * Espressif IoT Development Framework Configuration + * + */ +#define CONFIG_ULP_COPROC_ENABLED 1 +#define CONFIG_ULP_COPROC_RESERVE_MEM 1024 +#define CONFIG_GATTC_ENABLE 1 +#define CONFIG_ESP32_PHY_MAX_TX_POWER 20 +#define CONFIG_TRACEMEM_RESERVE_DRAM 0x0 +#define CONFIG_FREERTOS_MAX_TASK_NAME_LEN 16 +#define CONFIG_MQTT_TRANSPORT_SSL 1 +#define CONFIG_BLE_SMP_ENABLE 1 +#define CONFIG_SDP_INITIAL_TRACE_LEVEL 2 +#define CONFIG_MB_SERIAL_TASK_PRIO 10 +#define CONFIG_MQTT_PROTOCOL_311 1 +#define CONFIG_TCP_RECVMBOX_SIZE 6 +#define CONFIG_FATFS_CODEPAGE_437 1 +#define CONFIG_BLE_SCAN_DUPLICATE 1 +#define CONFIG_AVDT_TRACE_LEVEL_WARNING 1 +#define CONFIG_AWS_IOT_SHADOW_MAX_SIMULTANEOUS_ACKS 10 +#define CONFIG_TCP_WND_DEFAULT 5744 +#define CONFIG_PARTITION_TABLE_OFFSET 0x8000 +#define CONFIG_SW_COEXIST_ENABLE 1 +#define CONFIG_SPIFFS_USE_MAGIC_LENGTH 1 +#define CONFIG_AVCT_INITIAL_TRACE_LEVEL 2 +#define CONFIG_IPC_TASK_STACK_SIZE 1024 +#define CONFIG_FATFS_PER_FILE_CACHE 1 +#define CONFIG_ESPTOOLPY_FLASHFREQ "40m" +#define CONFIG_AWS_IOT_SHADOW_MAX_SIZE_OF_THING_NAME 20 +#define CONFIG_MBEDTLS_KEY_EXCHANGE_RSA 1 +#define CONFIG_UDP_RECVMBOX_SIZE 6 +#define CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE 0 +#define CONFIG_MBEDTLS_AES_C 1 +#define CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED 1 +#define CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN 752 +#define CONFIG_MBEDTLS_GCM_C 1 +#define CONFIG_ESPTOOLPY_FLASHSIZE "2MB" +#define CONFIG_HEAP_POISONING_DISABLED 1 +#define CONFIG_SPIFFS_CACHE_WR 1 +#define CONFIG_BROWNOUT_DET_LVL_SEL_0 1 +#define CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER 1 +#define CONFIG_EMAC_L2_TO_L3_RX_BUF_MODE 1 +#define CONFIG_BTDM_CONTROLLER_MODEM_SLEEP 1 +#define CONFIG_SPIFFS_CACHE 1 +#define CONFIG_INT_WDT 1 +#define CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN 3 +#define CONFIG_MBEDTLS_SSL_PROTO_TLS1 1 +#define CONFIG_ESP_GRATUITOUS_ARP 1 +#define CONFIG_AWS_IOT_SHADOW_MAX_SIZE_OF_UNIQUE_CLIENT_ID_BYTES 80 +#define CONFIG_MBEDTLS_ECDSA_C 1 +#define CONFIG_ESPTOOLPY_FLASHFREQ_40M 1 +#define CONFIG_LOG_BOOTLOADER_LEVEL_INFO 1 +#define CONFIG_ESPTOOLPY_FLASHSIZE_2MB 1 +#define CONFIG_HTTPD_MAX_REQ_HDR_LEN 512 +#define CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE 0 +#define CONFIG_AWS_IOT_MQTT_PORT 8883 +#define CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS 1 +#define CONFIG_MBEDTLS_ECDH_C 1 +#define CONFIG_MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE 1 +#define CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM 10 +#define CONFIG_AWS_IOT_MQTT_MAX_RECONNECT_WAIT_INTERVAL 128000 +#define CONFIG_MBEDTLS_SSL_ALPN 1 +#define CONFIG_BTM_TRACE_LEVEL_WARNING 1 +#define CONFIG_MBEDTLS_PEM_WRITE_C 1 +#define CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN 4096 +#define CONFIG_RFCOMM_TRACE_LEVEL_WARNING 1 +#define CONFIG_LOG_DEFAULT_LEVEL_INFO 1 +#define CONFIG_BT_RESERVE_DRAM 0xdb5c +#define CONFIG_FATFS_FS_LOCK 0 +#define CONFIG_IP_LOST_TIMER_INTERVAL 120 +#define CONFIG_SPIFFS_META_LENGTH 4 +#define CONFIG_ESP32_PANIC_PRINT_REBOOT 1 +#define CONFIG_MB_CONTROLLER_NOTIFY_QUEUE_SIZE 20 +#define CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED 1 +#define CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED 1 +#define CONFIG_AWS_IOT_MQTT_RX_BUF_LEN 512 +#define CONFIG_MB_SERIAL_BUF_SIZE 256 +#define CONFIG_CONSOLE_UART_BAUDRATE 115200 +#define CONFIG_LWIP_MAX_SOCKETS 10 +#define CONFIG_LWIP_NETIF_LOOPBACK 1 +#define CONFIG_MCA_TRACE_LEVEL_WARNING 1 +#define CONFIG_EMAC_TASK_PRIORITY 20 +#define CONFIG_TIMER_TASK_STACK_DEPTH 2048 +#define CONFIG_TCP_MSS 1436 +#define CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED 1 +#define CONFIG_BTIF_INITIAL_TRACE_LEVEL 2 +#define CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN_EFF 3 +#define CONFIG_FATFS_CODEPAGE 437 +#define CONFIG_APPL_TRACE_LEVEL_WARNING 1 +#define CONFIG_BTC_INITIAL_TRACE_LEVEL 2 +#define CONFIG_ESP32_DEFAULT_CPU_FREQ_160 1 +#define CONFIG_LWIP_MAX_UDP_PCBS 16 +#define CONFIG_ESPTOOLPY_BAUD 115200 +#define CONFIG_INT_WDT_CHECK_CPU1 1 +#define CONFIG_AVRC_INITIAL_TRACE_LEVEL 2 +#define CONFIG_ADC_CAL_LUT_ENABLE 1 +#define CONFIG_AWS_IOT_MQTT_TX_BUF_LEN 512 +#define CONFIG_FLASHMODE_DIO 1 +#define CONFIG_ESPTOOLPY_AFTER_RESET 1 +#define CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED 1 +#define CONFIG_LWIP_DHCPS_MAX_STATION_NUM 8 +#define CONFIG_TOOLPREFIX "xtensa-esp32-elf-" +#define CONFIG_MBEDTLS_ECP_C 1 +#define CONFIG_FREERTOS_IDLE_TASK_STACKSIZE 1536 +#define CONFIG_MBEDTLS_RC4_DISABLED 1 +#define CONFIG_GAP_TRACE_LEVEL_WARNING 1 +#define CONFIG_CONSOLE_UART_NUM 0 +#define CONFIG_AWS_IOT_SHADOW_MAX_JSON_TOKEN_EXPECTED 120 +#define CONFIG_ESP32_APPTRACE_LOCK_ENABLE 1 +#define CONFIG_PTHREAD_STACK_MIN 768 +#define CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC 1 +#define CONFIG_ESPTOOLPY_BAUD_115200B 1 +#define CONFIG_TCP_OVERSIZE_MSS 1 +#define CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS 1 +#define CONFIG_CONSOLE_UART_DEFAULT 1 +#define CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS 4 +#define CONFIG_GATT_TRACE_LEVEL_WARNING 1 +#define CONFIG_ESPTOOLPY_FLASHSIZE_DETECT 1 +#define CONFIG_EXAMPLE_EMBEDDED_CERTS 1 +#define CONFIG_TIMER_TASK_STACK_SIZE 3584 +#define CONFIG_BTIF_TRACE_LEVEL_WARNING 1 +#define CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE 1 +#define CONFIG_HCI_INITIAL_TRACE_LEVEL 2 +#define CONFIG_AVDT_INITIAL_TRACE_LEVEL 2 +#define CONFIG_MBEDTLS_X509_CRL_PARSE_C 1 +#define CONFIG_SCAN_DUPLICATE_BY_DEVICE_ADDR 1 +#define CONFIG_AWS_IOT_SHADOW_MAX_SHADOW_TOPIC_LENGTH_WITHOUT_THINGNAME 60 +#define CONFIG_MB_SERIAL_TASK_STACK_SIZE 2048 +#define CONFIG_GATTS_SEND_SERVICE_CHANGE_AUTO 1 +#define CONFIG_LWIP_DHCPS_LEASE_UNIT 60 +#define CONFIG_SPIFFS_USE_MAGIC 1 +#define CONFIG_TCPIP_TASK_STACK_SIZE 3072 +#define CONFIG_BLUFI_TRACE_LEVEL_WARNING 1 +#define CONFIG_BLUEDROID_PINNED_TO_CORE_0 1 +#define CONFIG_TASK_WDT 1 +#define CONFIG_RFCOMM_INITIAL_TRACE_LEVEL 2 +#define CONFIG_MAIN_TASK_STACK_SIZE 3584 +#define CONFIG_SPIFFS_PAGE_CHECK 1 +#define CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0 1 +#define CONFIG_LWIP_MAX_ACTIVE_TCP 16 +#define CONFIG_TASK_WDT_TIMEOUT_S 5 +#define CONFIG_INT_WDT_TIMEOUT_MS 300 +#define CONFIG_ESPTOOLPY_FLASHMODE "dio" +#define CONFIG_BTC_TASK_STACK_SIZE 3072 +#define CONFIG_BLUEDROID_ENABLED 1 +#define CONFIG_NEWLIB_STDIN_LINE_ENDING_CR 1 +#define CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA 1 +#define CONFIG_ESPTOOLPY_BEFORE "default_reset" +#define CONFIG_ADC2_DISABLE_DAC 1 +#define CONFIG_FATFS_LFN_HEAP 1 +#define CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_NUM 100 +#define CONFIG_LOG_DEFAULT_LEVEL 3 +#define CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION 1 +#define CONFIG_TIMER_QUEUE_LENGTH 10 +#define CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT 1 +#define CONFIG_GATTS_SEND_SERVICE_CHANGE_MODE 0 +#define CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY 1 +#define CONFIG_MAKE_WARN_UNDEFINED_VARIABLES 1 +#define CONFIG_FATFS_TIMEOUT_MS 10000 +#define CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM 32 +#define CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS 1 +#define CONFIG_PAN_INITIAL_TRACE_LEVEL 2 +#define CONFIG_MBEDTLS_CCM_C 1 +#define CONFIG_SPI_MASTER_ISR_IN_IRAM 1 +#define CONFIG_MCA_INITIAL_TRACE_LEVEL 2 +#define CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER 20 +#define CONFIG_A2D_INITIAL_TRACE_LEVEL 2 +#define CONFIG_ESP32_RTC_CLK_CAL_CYCLES 1024 +#define CONFIG_ESP32_WIFI_TX_BA_WIN 6 +#define CONFIG_ESP32_WIFI_NVS_ENABLED 1 +#define CONFIG_MDNS_MAX_SERVICES 10 +#define CONFIG_EMAC_CHECK_LINK_PERIOD_MS 2000 +#define CONFIG_BTDM_LPCLK_SEL_MAIN_XTAL 1 +#define CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED 1 +#define CONFIG_LIBSODIUM_USE_MBEDTLS_SHA 1 +#define CONFIG_AWS_IOT_SDK 1 +#define CONFIG_DMA_RX_BUF_NUM 10 +#define CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED 1 +#define CONFIG_TCP_SYNMAXRTX 6 +#define CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA 1 +#define CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN_EFF 0 +#define CONFIG_PYTHON "python" +#define CONFIG_MBEDTLS_ECP_NIST_OPTIM 1 +#define CONFIG_ESP32_TIME_SYSCALL_USE_RTC_FRC1 1 +#define CONFIG_ESPTOOLPY_COMPRESSED 1 +#define CONFIG_PARTITION_TABLE_FILENAME "partitions_singleapp.csv" +#define CONFIG_MB_CONTROLLER_STACK_SIZE 4096 +#define CONFIG_TCP_SND_BUF_DEFAULT 5744 +#define CONFIG_GARP_TMR_INTERVAL 60 +#define CONFIG_LWIP_DHCP_MAX_NTP_SERVERS 1 +#define CONFIG_BNEP_INITIAL_TRACE_LEVEL 2 +#define CONFIG_HCI_TRACE_LEVEL_WARNING 1 +#define CONFIG_TCP_MSL 60000 +#define CONFIG_MBEDTLS_SSL_PROTO_TLS1_1 1 +#define CONFIG_LWIP_SO_REUSE_RXTOALL 1 +#define CONFIG_MB_CONTROLLER_NOTIFY_TIMEOUT 20 +#define CONFIG_PARTITION_TABLE_SINGLE_APP 1 +#define CONFIG_ESP32_WIFI_RX_BA_WIN 6 +#define CONFIG_MBEDTLS_X509_CSR_PARSE_C 1 +#define CONFIG_SPIFFS_USE_MTIME 1 +#define CONFIG_BTC_TRACE_LEVEL_WARNING 1 +#define CONFIG_EMAC_TASK_STACK_SIZE 3072 +#define CONFIG_SMP_TRACE_LEVEL_WARNING 1 +#define CONFIG_MB_QUEUE_LENGTH 20 +#define CONFIG_SW_COEXIST_PREFERENCE_VALUE 2 +#define CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA 1 +#define CONFIG_LWIP_DHCP_DOES_ARP_CHECK 1 +#define CONFIG_FREERTOS_TASK_FUNCTION_WRAPPER 1 +#define CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE 2304 +#define CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V 1 +#define CONFIG_A2D_TRACE_LEVEL_WARNING 1 +#define CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY 2000 +#define CONFIG_AWS_IOT_MQTT_NUM_SUBSCRIBE_HANDLERS 5 +#define CONFIG_BROWNOUT_DET_LVL 0 +#define CONFIG_MBEDTLS_PEM_PARSE_C 1 +#define CONFIG_SPIFFS_GC_MAX_RUNS 10 +#define CONFIG_ESP32_APPTRACE_DEST_NONE 1 +#define CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC 1 +#define CONFIG_MBEDTLS_SSL_PROTO_TLS1_2 1 +#define CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_RSA 1 +#define CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM 32 +#define CONFIG_HTTPD_MAX_URI_LEN 512 +#define CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED 1 +#define CONFIG_AVCT_TRACE_LEVEL_WARNING 1 +#define CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED 1 +#define CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1 1 +#define CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ 160 +#define CONFIG_MBEDTLS_HARDWARE_AES 1 +#define CONFIG_FREERTOS_HZ 100 +#define CONFIG_LOG_COLORS 1 +#define CONFIG_OSI_TRACE_LEVEL_WARNING 1 +#define CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE 1 +#define CONFIG_STACK_CHECK_NONE 1 +#define CONFIG_ADC_CAL_EFUSE_TP_ENABLE 1 +#define CONFIG_BNEP_TRACE_LEVEL_WARNING 1 +#define CONFIG_FREERTOS_ASSERT_FAIL_ABORT 1 +#define CONFIG_BROWNOUT_DET 1 +#define CONFIG_AWS_IOT_SHADOW_MAX_SIMULTANEOUS_THINGNAMES 10 +#define CONFIG_ESP32_XTAL_FREQ 40 +#define CONFIG_OSI_INITIAL_TRACE_LEVEL 2 +#define CONFIG_MONITOR_BAUD_115200B 1 +#define CONFIG_LOG_BOOTLOADER_LEVEL 3 +#define CONFIG_MBEDTLS_TLS_ENABLED 1 +#define CONFIG_LWIP_MAX_RAW_PCBS 16 +#define CONFIG_SMP_ENABLE 1 +#define CONFIG_HID_TRACE_LEVEL_WARNING 1 +#define CONFIG_AVRC_TRACE_LEVEL_WARNING 1 +#define CONFIG_MBEDTLS_SSL_SESSION_TICKETS 1 +#define CONFIG_SPIFFS_MAX_PARTITIONS 3 +#define CONFIG_ESP_ERR_TO_NAME_LOOKUP 1 +#define CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE_0 1 +#define CONFIG_MBEDTLS_SSL_RENEGOTIATION 1 +#define CONFIG_HID_INITIAL_TRACE_LEVEL 2 +#define CONFIG_ESPTOOLPY_BEFORE_RESET 1 +#define CONFIG_MB_EVENT_QUEUE_TIMEOUT 20 +#define CONFIG_ESPTOOLPY_BAUD_OTHER_VAL 115200 +#define CONFIG_AWS_EXAMPLE_CLIENT_ID "myesp32" +#define CONFIG_SPIFFS_OBJ_NAME_LEN 32 +#define CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT 5 +#define CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_ACL_CONN_EFF 0 +#define CONFIG_PARTITION_TABLE_MD5 1 +#define CONFIG_TCPIP_RECVMBOX_SIZE 32 +#define CONFIG_TCP_MAXRTX 12 +#define CONFIG_BTM_INITIAL_TRACE_LEVEL 2 +#define CONFIG_ESPTOOLPY_AFTER "hard_reset" +#define CONFIG_TCPIP_TASK_AFFINITY 0x7FFFFFFF +#define CONFIG_LWIP_SO_REUSE 1 +#define CONFIG_ESP32_XTAL_FREQ_40 1 +#define CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY 1 +#define CONFIG_DMA_TX_BUF_NUM 10 +#define CONFIG_LWIP_MAX_LISTENING_TCP 16 +#define CONFIG_FREERTOS_INTERRUPT_BACKTRACE 1 +#define CONFIG_WL_SECTOR_SIZE 4096 +#define CONFIG_ESP32_DEBUG_OCDAWARE 1 +#define CONFIG_MQTT_TRANSPORT_WEBSOCKET 1 +#define CONFIG_TIMER_TASK_PRIORITY 1 +#define CONFIG_MBEDTLS_TLS_CLIENT 1 +#define CONFIG_AWS_IOT_MQTT_MIN_RECONNECT_WAIT_INTERVAL 1000 +#define CONFIG_BTDM_CONTROLLER_HCI_MODE_VHCI 1 +#define CONFIG_BT_ENABLED 1 +#define CONFIG_SDP_TRACE_LEVEL_WARNING 1 +#define CONFIG_SW_COEXIST_PREFERENCE_BALANCE 1 +#define CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED 1 +#define CONFIG_MONITOR_BAUD 115200 +#define CONFIG_ESP32_DEBUG_STUBS_ENABLE 1 +#define CONFIG_TCPIP_LWIP 1 +#define CONFIG_REDUCE_PHY_TX_POWER 1 +#define CONFIG_BOOTLOADER_WDT_TIME_MS 9000 +#define CONFIG_PAN_TRACE_LEVEL_WARNING 1 +#define CONFIG_FREERTOS_CORETIMER_0 1 +#define CONFIG_PARTITION_TABLE_CUSTOM_FILENAME "partitions.csv" +#define CONFIG_MBEDTLS_HAVE_TIME 1 +#define CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY 1 +#define CONFIG_TCP_QUEUE_OOSEQ 1 +#define CONFIG_GATTS_ENABLE 1 +#define CONFIG_ADC_CAL_EFUSE_VREF_ENABLE 1 +#define CONFIG_MBEDTLS_TLS_SERVER 1 +#define CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT 1 +#define CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_SUPPORTED 1 +#define CONFIG_FREERTOS_ISR_STACKSIZE 1536 +#define CONFIG_SUPPORT_TERMIOS 1 +#define CONFIG_OPENSSL_ASSERT_DO_NOTHING 1 +#define CONFIG_WL_SECTOR_SIZE_4096 1 +#define CONFIG_OPTIMIZATION_LEVEL_DEBUG 1 +#define CONFIG_GATT_INITIAL_TRACE_LEVEL 2 +#define CONFIG_FREERTOS_NO_AFFINITY 0x7FFFFFFF +#define CONFIG_AWS_IOT_MQTT_HOST "" +#define CONFIG_L2CAP_TRACE_LEVEL_WARNING 1 +#define CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED 1 +#define CONFIG_MB_TIMER_INDEX 0 +#define CONFIG_SCAN_DUPLICATE_TYPE 0 +#define CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED 1 +#define CONFIG_APPL_INITIAL_TRACE_LEVEL 2 +#define CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED 1 +#define CONFIG_SMP_INITIAL_TRACE_LEVEL 2 +#define CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA 1 +#define CONFIG_SPI_SLAVE_ISR_IN_IRAM 1 +#define CONFIG_L2CAP_INITIAL_TRACE_LEVEL 2 +#define CONFIG_SYSTEM_EVENT_QUEUE_SIZE 32 +#define CONFIG_BT_ACL_CONNECTIONS 4 +#define CONFIG_FATFS_MAX_LFN 255 +#define CONFIG_ESP32_WIFI_TX_BUFFER_TYPE 1 +#define CONFIG_BOOTLOADER_WDT_ENABLE 1 +#define CONFIG_GAP_INITIAL_TRACE_LEVEL 2 +#define CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED 1 +#define CONFIG_LWIP_LOOPBACK_MAX_PBUFS 8 +#define CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN 16384 +#define CONFIG_MB_TIMER_GROUP 0 +#define CONFIG_SPI_FLASH_ROM_DRIVER_PATCH 1 +#define CONFIG_MQTT_TRANSPORT_WEBSOCKET_SECURE 1 +#define CONFIG_SPIFFS_PAGE_SIZE 256 +#define CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED 1 +#define CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0 1 +#define CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT 3072 +#define CONFIG_MB_TIMER_PORT_ENABLED 1 +#define CONFIG_DUPLICATE_SCAN_CACHE_SIZE 200 +#define CONFIG_MONITOR_BAUD_OTHER_VAL 115200 +#define CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF 1 +#define CONFIG_ESPTOOLPY_PORT "/dev/ttyUSB0" +#define CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS 1 +#define CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN 1 +#define CONFIG_BLE_ADV_REPORT_DISCARD_THRSHOLD 20 +#define CONFIG_BLUEDROID_PINNED_TO_CORE 0 +#define CONFIG_BTDM_MODEM_SLEEP_MODE_ORIG 1 +#define CONFIG_ESP32_WIFI_IRAM_OPT 1 +#define CONFIG_BLUFI_INITIAL_TRACE_LEVEL 2 +#define CONFIG_FATFS_API_ENCODING_ANSI_OEM 1 diff --git a/examples/espidf-ulp-adc/src/ulp_adc_example_main.c b/examples/espidf-ulp-adc/src/ulp_adc_example_main.c new file mode 100644 index 0000000..b0347dc --- /dev/null +++ b/examples/espidf-ulp-adc/src/ulp_adc_example_main.c @@ -0,0 +1,94 @@ +/* ULP Example + + This example code is in the Public Domain (or CC0 licensed, at your option.) + + Unless required by applicable law or agreed to in writing, this + software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + CONDITIONS OF ANY KIND, either express or implied. +*/ + +#include +#include +#include "esp_sleep.h" +#include "nvs.h" +#include "nvs_flash.h" +#include "soc/rtc_cntl_reg.h" +#include "soc/sens_reg.h" +#include "driver/gpio.h" +#include "driver/rtc_io.h" +#include "driver/adc.h" +#include "driver/dac.h" +#include "esp32/ulp.h" +#include "ulp_main.h" + +extern const uint8_t ulp_main_bin_start[] asm("_binary_ulp_main_bin_start"); +extern const uint8_t ulp_main_bin_end[] asm("_binary_ulp_main_bin_end"); + +/* This function is called once after power-on reset, to load ULP program into + * RTC memory and configure the ADC. + */ +static void init_ulp_program(); + +/* This function is called every time before going into deep sleep. + * It starts the ULP program and resets measurement counter. + */ +static void start_ulp_program(); + +void app_main() +{ + esp_sleep_wakeup_cause_t cause = esp_sleep_get_wakeup_cause(); + if (cause != ESP_SLEEP_WAKEUP_ULP) { + printf("Not ULP wakeup\n"); + init_ulp_program(); + } else { + printf("Deep sleep wakeup\n"); + printf("ULP did %d measurements since last reset\n", ulp_sample_counter & UINT16_MAX); + printf("Thresholds: low=%d high=%d\n", ulp_low_thr, ulp_high_thr); + ulp_last_result &= UINT16_MAX; + printf("Value=%d was %s threshold\n", ulp_last_result, + ulp_last_result < ulp_low_thr ? "below" : "above"); + } + printf("Entering deep sleep\n\n"); + start_ulp_program(); + ESP_ERROR_CHECK( esp_sleep_enable_ulp_wakeup() ); + esp_deep_sleep_start(); +} + +static void init_ulp_program() +{ + esp_err_t err = ulp_load_binary(0, ulp_main_bin_start, + (ulp_main_bin_end - ulp_main_bin_start) / sizeof(uint32_t)); + ESP_ERROR_CHECK(err); + + /* Configure ADC channel */ + /* Note: when changing channel here, also change 'adc_channel' constant + in adc.S */ + adc1_config_channel_atten(ADC1_CHANNEL_6, ADC_ATTEN_DB_11); + adc1_config_width(ADC_WIDTH_BIT_12); + adc1_ulp_enable(); + + /* Set low and high thresholds, approx. 1.35V - 1.75V*/ + ulp_low_thr = 1500; + ulp_high_thr = 2000; + + /* Set ULP wake up period to 20ms */ + ulp_set_wakeup_period(0, 2000000); + + /* Disconnect GPIO12 and GPIO15 to remove current drain through + * pullup/pulldown resistors. + * GPIO12 may be pulled high to select flash voltage. + */ + rtc_gpio_isolate(GPIO_NUM_12); + rtc_gpio_isolate(GPIO_NUM_15); + esp_deep_sleep_disable_rom_logging(); // suppress boot messages +} + +static void start_ulp_program() +{ + /* Reset sample counter */ + ulp_sample_counter = 0; + + /* Start the program */ + esp_err_t err = ulp_run(&ulp_entry - RTC_SLOW_MEM); + ESP_ERROR_CHECK(err); +} diff --git a/examples/espidf-ulp-adc/test/README b/examples/espidf-ulp-adc/test/README new file mode 100644 index 0000000..df5066e --- /dev/null +++ b/examples/espidf-ulp-adc/test/README @@ -0,0 +1,11 @@ + +This directory is intended for PIO Unit Testing and project tests. + +Unit Testing is a software testing method by which individual units of +source code, sets of one or more MCU program modules together with associated +control data, usage procedures, and operating procedures, are tested to +determine whether they are fit for use. Unit testing finds problems early +in the development cycle. + +More information about PIO Unit Testing: +- https://docs.platformio.org/page/plus/unit-testing.html diff --git a/examples/espidf-ulp-adc/ulp/adc.S b/examples/espidf-ulp-adc/ulp/adc.S new file mode 100644 index 0000000..70d0439 --- /dev/null +++ b/examples/espidf-ulp-adc/ulp/adc.S @@ -0,0 +1,115 @@ +/* ULP Example: using ADC in deep sleep + + This example code is in the Public Domain (or CC0 licensed, at your option.) + + Unless required by applicable law or agreed to in writing, this + software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + CONDITIONS OF ANY KIND, either express or implied. + + This file contains assembly code which runs on the ULP. + + ULP wakes up to run this code at a certain period, determined by the values + in SENS_ULP_CP_SLEEP_CYCx_REG registers. On each wake up, the program + measures input voltage on the given ADC channel 'adc_oversampling_factor' + times. Measurements are accumulated and average value is calculated. + Average value is compared to the two thresholds: 'low_thr' and 'high_thr'. + If the value is less than 'low_thr' or more than 'high_thr', ULP wakes up + the chip from deep sleep. +*/ + +/* ULP assembly files are passed through C preprocessor first, so include directives + and C macros may be used in these files + */ +#include "soc/rtc_cntl_reg.h" +#include "soc/soc_ulp.h" + + /* ADC1 channel 6, GPIO34 */ + .set adc_channel, 6 + + /* Configure the number of ADC samples to average on each measurement. + For convenience, make it a power of 2. */ + .set adc_oversampling_factor_log, 2 + .set adc_oversampling_factor, (1 << adc_oversampling_factor_log) + + /* Define variables, which go into .bss section (zero-initialized data) */ + .bss + + /* Low threshold of ADC reading. + Set by the main program. */ + .global low_thr +low_thr: + .long 0 + + /* High threshold of ADC reading. + Set by the main program. */ + .global high_thr +high_thr: + .long 0 + + /* Counter of measurements done */ + .global sample_counter +sample_counter: + .long 0 + + .global last_result +last_result: + .long 0 + + /* Code goes into .text section */ + .text + .global entry +entry: + /* increment sample counter */ + move r3, sample_counter + ld r2, r3, 0 + add r2, r2, 1 + st r2, r3, 0 + + /* do measurements using ADC */ + /* r0 will be used as accumulator */ + move r0, 0 + /* initialize the loop counter */ + stage_rst +measure: + /* measure and add value to accumulator */ + adc r1, 0, adc_channel + 1 + add r0, r0, r1 + /* increment loop counter and check exit condition */ + stage_inc 1 + jumps measure, adc_oversampling_factor, lt + + /* divide accumulator by adc_oversampling_factor. + Since it is chosen as a power of two, use right shift */ + rsh r0, r0, adc_oversampling_factor_log + /* averaged value is now in r0; store it into last_result */ + move r3, last_result + st r0, r3, 0 + + /* compare with low_thr; wake up if value < low_thr */ + move r3, low_thr + ld r3, r3, 0 + sub r3, r0, r3 + jump wake_up, ov + + /* compare with high_thr; wake up if value > high_thr */ + move r3, high_thr + ld r3, r3, 0 + sub r3, r3, r0 + jump wake_up, ov + + /* value within range, end the program */ + .global exit +exit: + halt + + .global wake_up +wake_up: + /* Check if the system can be woken up */ + READ_RTC_FIELD(RTC_CNTL_LOW_POWER_ST_REG, RTC_CNTL_RDY_FOR_WAKEUP) + and r0, r0, 1 + jump exit, eq + + /* Wake up the SoC, end program */ + wake + WRITE_RTC_FIELD(RTC_CNTL_STATE0_REG, RTC_CNTL_ULP_CP_SLP_TIMER_EN, 0) + halt diff --git a/examples/espidf-ulp-pulse/.gitignore b/examples/espidf-ulp-pulse/.gitignore new file mode 100644 index 0000000..6c69f4c --- /dev/null +++ b/examples/espidf-ulp-pulse/.gitignore @@ -0,0 +1,2 @@ +.pioenvs +.piolibdeps diff --git a/examples/espidf-ulp-pulse/.travis.yml b/examples/espidf-ulp-pulse/.travis.yml new file mode 100644 index 0000000..7c486f1 --- /dev/null +++ b/examples/espidf-ulp-pulse/.travis.yml @@ -0,0 +1,67 @@ +# Continuous Integration (CI) is the practice, in software +# engineering, of merging all developer working copies with a shared mainline +# several times a day < https://docs.platformio.org/page/ci/index.html > +# +# Documentation: +# +# * Travis CI Embedded Builds with PlatformIO +# < https://docs.travis-ci.com/user/integration/platformio/ > +# +# * PlatformIO integration with Travis CI +# < https://docs.platformio.org/page/ci/travis.html > +# +# * User Guide for `platformio ci` command +# < https://docs.platformio.org/page/userguide/cmd_ci.html > +# +# +# Please choose one of the following templates (proposed below) and uncomment +# it (remove "# " before each line) or use own configuration according to the +# Travis CI documentation (see above). +# + + +# +# Template #1: General project. Test it using existing `platformio.ini`. +# + +# language: python +# python: +# - "2.7" +# +# sudo: false +# cache: +# directories: +# - "~/.platformio" +# +# install: +# - pip install -U platformio +# - platformio update +# +# script: +# - platformio run + + +# +# Template #2: The project is intended to be used as a library with examples. +# + +# language: python +# python: +# - "2.7" +# +# sudo: false +# cache: +# directories: +# - "~/.platformio" +# +# env: +# - PLATFORMIO_CI_SRC=path/to/test/file.c +# - PLATFORMIO_CI_SRC=examples/file.ino +# - PLATFORMIO_CI_SRC=path/to/test/directory +# +# install: +# - pip install -U platformio +# - platformio update +# +# script: +# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N diff --git a/examples/espidf-ulp-pulse/README.rst b/examples/espidf-ulp-pulse/README.rst new file mode 100644 index 0000000..ec7495b --- /dev/null +++ b/examples/espidf-ulp-pulse/README.rst @@ -0,0 +1,38 @@ +.. Copyright 2014-present PlatformIO + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +How to build PlatformIO based project +===================================== + +1. `Install PlatformIO Core `_ +2. Download `development platform with examples `_ +3. Extract ZIP archive +4. Run these commands: + +.. code-block:: bash + + # Change directory to example + > cd platform-espressif32/examples/espidf-ulp-pulse + + # Build project + > platformio run + + # Upload firmware + > platformio run --target upload + + # Build specific environment + > platformio run -e esp32dev + + # Upload firmware for the specific environment + > platformio run -e esp32dev --target upload + + # Clean build files + > platformio run --target clean diff --git a/examples/espidf-ulp-pulse/include/README b/examples/espidf-ulp-pulse/include/README new file mode 100644 index 0000000..194dcd4 --- /dev/null +++ b/examples/espidf-ulp-pulse/include/README @@ -0,0 +1,39 @@ + +This directory is intended for project header files. + +A header file is a file containing C declarations and macro definitions +to be shared between several project source files. You request the use of a +header file in your project source file (C, C++, etc) located in `src` folder +by including it, with the C preprocessing directive `#include'. + +```src/main.c + +#include "header.h" + +int main (void) +{ + ... +} +``` + +Including a header file produces the same results as copying the header file +into each source file that needs it. Such copying would be time-consuming +and error-prone. With a header file, the related declarations appear +in only one place. If they need to be changed, they can be changed in one +place, and programs that include the header file will automatically use the +new version when next recompiled. The header file eliminates the labor of +finding and changing all the copies as well as the risk that a failure to +find one copy will result in inconsistencies within a program. + +In C, the usual convention is to give header files names that end with `.h'. +It is most portable to use only letters, digits, dashes, and underscores in +header file names, and at most one dot. + +Read more about using header files in official GCC documentation: + +* Include Syntax +* Include Operation +* Once-Only Headers +* Computed Includes + +https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/examples/espidf-ulp-pulse/lib/README b/examples/espidf-ulp-pulse/lib/README new file mode 100644 index 0000000..6debab1 --- /dev/null +++ b/examples/espidf-ulp-pulse/lib/README @@ -0,0 +1,46 @@ + +This directory is intended for project specific (private) libraries. +PlatformIO will compile them to static libraries and link into executable file. + +The source code of each library should be placed in a an own separate directory +("lib/your_library_name/[here are source files]"). + +For example, see a structure of the following two libraries `Foo` and `Bar`: + +|--lib +| | +| |--Bar +| | |--docs +| | |--examples +| | |--src +| | |- Bar.c +| | |- Bar.h +| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html +| | +| |--Foo +| | |- Foo.c +| | |- Foo.h +| | +| |- README --> THIS FILE +| +|- platformio.ini +|--src + |- main.c + +and a contents of `src/main.c`: +``` +#include +#include + +int main (void) +{ + ... +} + +``` + +PlatformIO Library Dependency Finder will find automatically dependent +libraries scanning project source files. + +More information about PlatformIO Library Dependency Finder +- https://docs.platformio.org/page/librarymanager/ldf.html diff --git a/examples/espidf-ulp-pulse/platformio.ini b/examples/espidf-ulp-pulse/platformio.ini new file mode 100644 index 0000000..cf23761 --- /dev/null +++ b/examples/espidf-ulp-pulse/platformio.ini @@ -0,0 +1,14 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter, extra scripting +; Upload options: custom port, speed and extra flags +; Library options: dependencies, extra library storages +; +; Please visit documentation for the other options and examples +; http://docs.platformio.org/page/projectconf.html + +[env:esp32dev] +platform = espressif32 +framework = espidf +board = esp32dev +build_flags = -DCONFIG_WIFI_SSID=\"ESP_AP\" -DCONFIG_WIFI_PASSWORD=\"MYPASS\" diff --git a/examples/espidf-ulp-pulse/src/sdkconfig.h b/examples/espidf-ulp-pulse/src/sdkconfig.h new file mode 100644 index 0000000..a278aa1 --- /dev/null +++ b/examples/espidf-ulp-pulse/src/sdkconfig.h @@ -0,0 +1,349 @@ +/* + * + * Automatically generated file; DO NOT EDIT. + * Espressif IoT Development Framework Configuration + * + */ +#define CONFIG_ULP_COPROC_ENABLED 1 +#define CONFIG_ULP_COPROC_RESERVE_MEM 1024 +#define CONFIG_GATTC_ENABLE 1 +#define CONFIG_ESP32_PHY_MAX_TX_POWER 20 +#define CONFIG_TRACEMEM_RESERVE_DRAM 0x0 +#define CONFIG_FREERTOS_MAX_TASK_NAME_LEN 16 +#define CONFIG_MQTT_TRANSPORT_SSL 1 +#define CONFIG_BLE_SMP_ENABLE 1 +#define CONFIG_SDP_INITIAL_TRACE_LEVEL 2 +#define CONFIG_MB_SERIAL_TASK_PRIO 10 +#define CONFIG_MQTT_PROTOCOL_311 1 +#define CONFIG_TCP_RECVMBOX_SIZE 6 +#define CONFIG_FATFS_CODEPAGE_437 1 +#define CONFIG_BLE_SCAN_DUPLICATE 1 +#define CONFIG_AVDT_TRACE_LEVEL_WARNING 1 +#define CONFIG_AWS_IOT_SHADOW_MAX_SIMULTANEOUS_ACKS 10 +#define CONFIG_TCP_WND_DEFAULT 5744 +#define CONFIG_PARTITION_TABLE_OFFSET 0x8000 +#define CONFIG_SW_COEXIST_ENABLE 1 +#define CONFIG_SPIFFS_USE_MAGIC_LENGTH 1 +#define CONFIG_AVCT_INITIAL_TRACE_LEVEL 2 +#define CONFIG_IPC_TASK_STACK_SIZE 1024 +#define CONFIG_FATFS_PER_FILE_CACHE 1 +#define CONFIG_ESPTOOLPY_FLASHFREQ "40m" +#define CONFIG_AWS_IOT_SHADOW_MAX_SIZE_OF_THING_NAME 20 +#define CONFIG_MBEDTLS_KEY_EXCHANGE_RSA 1 +#define CONFIG_UDP_RECVMBOX_SIZE 6 +#define CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE 0 +#define CONFIG_MBEDTLS_AES_C 1 +#define CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED 1 +#define CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN 752 +#define CONFIG_MBEDTLS_GCM_C 1 +#define CONFIG_ESPTOOLPY_FLASHSIZE "2MB" +#define CONFIG_HEAP_POISONING_DISABLED 1 +#define CONFIG_SPIFFS_CACHE_WR 1 +#define CONFIG_BROWNOUT_DET_LVL_SEL_0 1 +#define CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER 1 +#define CONFIG_EMAC_L2_TO_L3_RX_BUF_MODE 1 +#define CONFIG_BTDM_CONTROLLER_MODEM_SLEEP 1 +#define CONFIG_SPIFFS_CACHE 1 +#define CONFIG_INT_WDT 1 +#define CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN 3 +#define CONFIG_MBEDTLS_SSL_PROTO_TLS1 1 +#define CONFIG_ESP_GRATUITOUS_ARP 1 +#define CONFIG_AWS_IOT_SHADOW_MAX_SIZE_OF_UNIQUE_CLIENT_ID_BYTES 80 +#define CONFIG_MBEDTLS_ECDSA_C 1 +#define CONFIG_ESPTOOLPY_FLASHFREQ_40M 1 +#define CONFIG_LOG_BOOTLOADER_LEVEL_INFO 1 +#define CONFIG_ESPTOOLPY_FLASHSIZE_2MB 1 +#define CONFIG_HTTPD_MAX_REQ_HDR_LEN 512 +#define CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE 0 +#define CONFIG_AWS_IOT_MQTT_PORT 8883 +#define CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS 1 +#define CONFIG_MBEDTLS_ECDH_C 1 +#define CONFIG_MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE 1 +#define CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM 10 +#define CONFIG_AWS_IOT_MQTT_MAX_RECONNECT_WAIT_INTERVAL 128000 +#define CONFIG_MBEDTLS_SSL_ALPN 1 +#define CONFIG_BTM_TRACE_LEVEL_WARNING 1 +#define CONFIG_MBEDTLS_PEM_WRITE_C 1 +#define CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN 4096 +#define CONFIG_RFCOMM_TRACE_LEVEL_WARNING 1 +#define CONFIG_LOG_DEFAULT_LEVEL_INFO 1 +#define CONFIG_BT_RESERVE_DRAM 0xdb5c +#define CONFIG_FATFS_FS_LOCK 0 +#define CONFIG_IP_LOST_TIMER_INTERVAL 120 +#define CONFIG_SPIFFS_META_LENGTH 4 +#define CONFIG_ESP32_PANIC_PRINT_REBOOT 1 +#define CONFIG_MB_CONTROLLER_NOTIFY_QUEUE_SIZE 20 +#define CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED 1 +#define CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED 1 +#define CONFIG_AWS_IOT_MQTT_RX_BUF_LEN 512 +#define CONFIG_MB_SERIAL_BUF_SIZE 256 +#define CONFIG_CONSOLE_UART_BAUDRATE 115200 +#define CONFIG_LWIP_MAX_SOCKETS 10 +#define CONFIG_LWIP_NETIF_LOOPBACK 1 +#define CONFIG_MCA_TRACE_LEVEL_WARNING 1 +#define CONFIG_EMAC_TASK_PRIORITY 20 +#define CONFIG_TIMER_TASK_STACK_DEPTH 2048 +#define CONFIG_TCP_MSS 1436 +#define CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED 1 +#define CONFIG_BTIF_INITIAL_TRACE_LEVEL 2 +#define CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN_EFF 3 +#define CONFIG_FATFS_CODEPAGE 437 +#define CONFIG_APPL_TRACE_LEVEL_WARNING 1 +#define CONFIG_BTC_INITIAL_TRACE_LEVEL 2 +#define CONFIG_ESP32_DEFAULT_CPU_FREQ_160 1 +#define CONFIG_LWIP_MAX_UDP_PCBS 16 +#define CONFIG_ESPTOOLPY_BAUD 115200 +#define CONFIG_INT_WDT_CHECK_CPU1 1 +#define CONFIG_AVRC_INITIAL_TRACE_LEVEL 2 +#define CONFIG_ADC_CAL_LUT_ENABLE 1 +#define CONFIG_AWS_IOT_MQTT_TX_BUF_LEN 512 +#define CONFIG_FLASHMODE_DIO 1 +#define CONFIG_ESPTOOLPY_AFTER_RESET 1 +#define CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED 1 +#define CONFIG_LWIP_DHCPS_MAX_STATION_NUM 8 +#define CONFIG_TOOLPREFIX "xtensa-esp32-elf-" +#define CONFIG_MBEDTLS_ECP_C 1 +#define CONFIG_FREERTOS_IDLE_TASK_STACKSIZE 1536 +#define CONFIG_MBEDTLS_RC4_DISABLED 1 +#define CONFIG_GAP_TRACE_LEVEL_WARNING 1 +#define CONFIG_CONSOLE_UART_NUM 0 +#define CONFIG_AWS_IOT_SHADOW_MAX_JSON_TOKEN_EXPECTED 120 +#define CONFIG_ESP32_APPTRACE_LOCK_ENABLE 1 +#define CONFIG_PTHREAD_STACK_MIN 768 +#define CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC 1 +#define CONFIG_ESPTOOLPY_BAUD_115200B 1 +#define CONFIG_TCP_OVERSIZE_MSS 1 +#define CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS 1 +#define CONFIG_CONSOLE_UART_DEFAULT 1 +#define CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS 4 +#define CONFIG_GATT_TRACE_LEVEL_WARNING 1 +#define CONFIG_ESPTOOLPY_FLASHSIZE_DETECT 1 +#define CONFIG_EXAMPLE_EMBEDDED_CERTS 1 +#define CONFIG_TIMER_TASK_STACK_SIZE 3584 +#define CONFIG_BTIF_TRACE_LEVEL_WARNING 1 +#define CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE 1 +#define CONFIG_HCI_INITIAL_TRACE_LEVEL 2 +#define CONFIG_AVDT_INITIAL_TRACE_LEVEL 2 +#define CONFIG_MBEDTLS_X509_CRL_PARSE_C 1 +#define CONFIG_SCAN_DUPLICATE_BY_DEVICE_ADDR 1 +#define CONFIG_AWS_IOT_SHADOW_MAX_SHADOW_TOPIC_LENGTH_WITHOUT_THINGNAME 60 +#define CONFIG_MB_SERIAL_TASK_STACK_SIZE 2048 +#define CONFIG_GATTS_SEND_SERVICE_CHANGE_AUTO 1 +#define CONFIG_LWIP_DHCPS_LEASE_UNIT 60 +#define CONFIG_SPIFFS_USE_MAGIC 1 +#define CONFIG_TCPIP_TASK_STACK_SIZE 3072 +#define CONFIG_BLUFI_TRACE_LEVEL_WARNING 1 +#define CONFIG_BLUEDROID_PINNED_TO_CORE_0 1 +#define CONFIG_TASK_WDT 1 +#define CONFIG_RFCOMM_INITIAL_TRACE_LEVEL 2 +#define CONFIG_MAIN_TASK_STACK_SIZE 3584 +#define CONFIG_SPIFFS_PAGE_CHECK 1 +#define CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0 1 +#define CONFIG_LWIP_MAX_ACTIVE_TCP 16 +#define CONFIG_TASK_WDT_TIMEOUT_S 5 +#define CONFIG_INT_WDT_TIMEOUT_MS 300 +#define CONFIG_ESPTOOLPY_FLASHMODE "dio" +#define CONFIG_BTC_TASK_STACK_SIZE 3072 +#define CONFIG_BLUEDROID_ENABLED 1 +#define CONFIG_NEWLIB_STDIN_LINE_ENDING_CR 1 +#define CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA 1 +#define CONFIG_ESPTOOLPY_BEFORE "default_reset" +#define CONFIG_ADC2_DISABLE_DAC 1 +#define CONFIG_FATFS_LFN_HEAP 1 +#define CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_NUM 100 +#define CONFIG_LOG_DEFAULT_LEVEL 3 +#define CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION 1 +#define CONFIG_TIMER_QUEUE_LENGTH 10 +#define CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT 1 +#define CONFIG_GATTS_SEND_SERVICE_CHANGE_MODE 0 +#define CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY 1 +#define CONFIG_MAKE_WARN_UNDEFINED_VARIABLES 1 +#define CONFIG_FATFS_TIMEOUT_MS 10000 +#define CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM 32 +#define CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS 1 +#define CONFIG_PAN_INITIAL_TRACE_LEVEL 2 +#define CONFIG_MBEDTLS_CCM_C 1 +#define CONFIG_SPI_MASTER_ISR_IN_IRAM 1 +#define CONFIG_MCA_INITIAL_TRACE_LEVEL 2 +#define CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER 20 +#define CONFIG_A2D_INITIAL_TRACE_LEVEL 2 +#define CONFIG_ESP32_RTC_CLK_CAL_CYCLES 1024 +#define CONFIG_ESP32_WIFI_TX_BA_WIN 6 +#define CONFIG_ESP32_WIFI_NVS_ENABLED 1 +#define CONFIG_MDNS_MAX_SERVICES 10 +#define CONFIG_EMAC_CHECK_LINK_PERIOD_MS 2000 +#define CONFIG_BTDM_LPCLK_SEL_MAIN_XTAL 1 +#define CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED 1 +#define CONFIG_LIBSODIUM_USE_MBEDTLS_SHA 1 +#define CONFIG_AWS_IOT_SDK 1 +#define CONFIG_DMA_RX_BUF_NUM 10 +#define CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED 1 +#define CONFIG_TCP_SYNMAXRTX 6 +#define CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA 1 +#define CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN_EFF 0 +#define CONFIG_PYTHON "python" +#define CONFIG_MBEDTLS_ECP_NIST_OPTIM 1 +#define CONFIG_ESP32_TIME_SYSCALL_USE_RTC_FRC1 1 +#define CONFIG_ESPTOOLPY_COMPRESSED 1 +#define CONFIG_PARTITION_TABLE_FILENAME "partitions_singleapp.csv" +#define CONFIG_MB_CONTROLLER_STACK_SIZE 4096 +#define CONFIG_TCP_SND_BUF_DEFAULT 5744 +#define CONFIG_GARP_TMR_INTERVAL 60 +#define CONFIG_LWIP_DHCP_MAX_NTP_SERVERS 1 +#define CONFIG_BNEP_INITIAL_TRACE_LEVEL 2 +#define CONFIG_HCI_TRACE_LEVEL_WARNING 1 +#define CONFIG_TCP_MSL 60000 +#define CONFIG_MBEDTLS_SSL_PROTO_TLS1_1 1 +#define CONFIG_LWIP_SO_REUSE_RXTOALL 1 +#define CONFIG_MB_CONTROLLER_NOTIFY_TIMEOUT 20 +#define CONFIG_PARTITION_TABLE_SINGLE_APP 1 +#define CONFIG_ESP32_WIFI_RX_BA_WIN 6 +#define CONFIG_MBEDTLS_X509_CSR_PARSE_C 1 +#define CONFIG_SPIFFS_USE_MTIME 1 +#define CONFIG_BTC_TRACE_LEVEL_WARNING 1 +#define CONFIG_EMAC_TASK_STACK_SIZE 3072 +#define CONFIG_SMP_TRACE_LEVEL_WARNING 1 +#define CONFIG_MB_QUEUE_LENGTH 20 +#define CONFIG_SW_COEXIST_PREFERENCE_VALUE 2 +#define CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA 1 +#define CONFIG_LWIP_DHCP_DOES_ARP_CHECK 1 +#define CONFIG_FREERTOS_TASK_FUNCTION_WRAPPER 1 +#define CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE 2304 +#define CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V 1 +#define CONFIG_A2D_TRACE_LEVEL_WARNING 1 +#define CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY 2000 +#define CONFIG_AWS_IOT_MQTT_NUM_SUBSCRIBE_HANDLERS 5 +#define CONFIG_BROWNOUT_DET_LVL 0 +#define CONFIG_MBEDTLS_PEM_PARSE_C 1 +#define CONFIG_SPIFFS_GC_MAX_RUNS 10 +#define CONFIG_ESP32_APPTRACE_DEST_NONE 1 +#define CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC 1 +#define CONFIG_MBEDTLS_SSL_PROTO_TLS1_2 1 +#define CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_RSA 1 +#define CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM 32 +#define CONFIG_HTTPD_MAX_URI_LEN 512 +#define CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED 1 +#define CONFIG_AVCT_TRACE_LEVEL_WARNING 1 +#define CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED 1 +#define CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1 1 +#define CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ 160 +#define CONFIG_MBEDTLS_HARDWARE_AES 1 +#define CONFIG_FREERTOS_HZ 100 +#define CONFIG_LOG_COLORS 1 +#define CONFIG_OSI_TRACE_LEVEL_WARNING 1 +#define CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE 1 +#define CONFIG_STACK_CHECK_NONE 1 +#define CONFIG_ADC_CAL_EFUSE_TP_ENABLE 1 +#define CONFIG_BNEP_TRACE_LEVEL_WARNING 1 +#define CONFIG_FREERTOS_ASSERT_FAIL_ABORT 1 +#define CONFIG_BROWNOUT_DET 1 +#define CONFIG_AWS_IOT_SHADOW_MAX_SIMULTANEOUS_THINGNAMES 10 +#define CONFIG_ESP32_XTAL_FREQ 40 +#define CONFIG_OSI_INITIAL_TRACE_LEVEL 2 +#define CONFIG_MONITOR_BAUD_115200B 1 +#define CONFIG_LOG_BOOTLOADER_LEVEL 3 +#define CONFIG_MBEDTLS_TLS_ENABLED 1 +#define CONFIG_LWIP_MAX_RAW_PCBS 16 +#define CONFIG_SMP_ENABLE 1 +#define CONFIG_HID_TRACE_LEVEL_WARNING 1 +#define CONFIG_AVRC_TRACE_LEVEL_WARNING 1 +#define CONFIG_MBEDTLS_SSL_SESSION_TICKETS 1 +#define CONFIG_SPIFFS_MAX_PARTITIONS 3 +#define CONFIG_ESP_ERR_TO_NAME_LOOKUP 1 +#define CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE_0 1 +#define CONFIG_MBEDTLS_SSL_RENEGOTIATION 1 +#define CONFIG_HID_INITIAL_TRACE_LEVEL 2 +#define CONFIG_ESPTOOLPY_BEFORE_RESET 1 +#define CONFIG_MB_EVENT_QUEUE_TIMEOUT 20 +#define CONFIG_ESPTOOLPY_BAUD_OTHER_VAL 115200 +#define CONFIG_AWS_EXAMPLE_CLIENT_ID "myesp32" +#define CONFIG_SPIFFS_OBJ_NAME_LEN 32 +#define CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT 5 +#define CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_ACL_CONN_EFF 0 +#define CONFIG_PARTITION_TABLE_MD5 1 +#define CONFIG_TCPIP_RECVMBOX_SIZE 32 +#define CONFIG_TCP_MAXRTX 12 +#define CONFIG_BTM_INITIAL_TRACE_LEVEL 2 +#define CONFIG_ESPTOOLPY_AFTER "hard_reset" +#define CONFIG_TCPIP_TASK_AFFINITY 0x7FFFFFFF +#define CONFIG_LWIP_SO_REUSE 1 +#define CONFIG_ESP32_XTAL_FREQ_40 1 +#define CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY 1 +#define CONFIG_DMA_TX_BUF_NUM 10 +#define CONFIG_LWIP_MAX_LISTENING_TCP 16 +#define CONFIG_FREERTOS_INTERRUPT_BACKTRACE 1 +#define CONFIG_WL_SECTOR_SIZE 4096 +#define CONFIG_ESP32_DEBUG_OCDAWARE 1 +#define CONFIG_MQTT_TRANSPORT_WEBSOCKET 1 +#define CONFIG_TIMER_TASK_PRIORITY 1 +#define CONFIG_MBEDTLS_TLS_CLIENT 1 +#define CONFIG_AWS_IOT_MQTT_MIN_RECONNECT_WAIT_INTERVAL 1000 +#define CONFIG_BTDM_CONTROLLER_HCI_MODE_VHCI 1 +#define CONFIG_BT_ENABLED 1 +#define CONFIG_SDP_TRACE_LEVEL_WARNING 1 +#define CONFIG_SW_COEXIST_PREFERENCE_BALANCE 1 +#define CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED 1 +#define CONFIG_MONITOR_BAUD 115200 +#define CONFIG_ESP32_DEBUG_STUBS_ENABLE 1 +#define CONFIG_TCPIP_LWIP 1 +#define CONFIG_REDUCE_PHY_TX_POWER 1 +#define CONFIG_BOOTLOADER_WDT_TIME_MS 9000 +#define CONFIG_PAN_TRACE_LEVEL_WARNING 1 +#define CONFIG_FREERTOS_CORETIMER_0 1 +#define CONFIG_PARTITION_TABLE_CUSTOM_FILENAME "partitions.csv" +#define CONFIG_MBEDTLS_HAVE_TIME 1 +#define CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY 1 +#define CONFIG_TCP_QUEUE_OOSEQ 1 +#define CONFIG_GATTS_ENABLE 1 +#define CONFIG_ADC_CAL_EFUSE_VREF_ENABLE 1 +#define CONFIG_MBEDTLS_TLS_SERVER 1 +#define CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT 1 +#define CONFIG_BLE_ADV_REPORT_FLOW_CONTROL_SUPPORTED 1 +#define CONFIG_FREERTOS_ISR_STACKSIZE 1536 +#define CONFIG_SUPPORT_TERMIOS 1 +#define CONFIG_OPENSSL_ASSERT_DO_NOTHING 1 +#define CONFIG_WL_SECTOR_SIZE_4096 1 +#define CONFIG_OPTIMIZATION_LEVEL_DEBUG 1 +#define CONFIG_GATT_INITIAL_TRACE_LEVEL 2 +#define CONFIG_FREERTOS_NO_AFFINITY 0x7FFFFFFF +#define CONFIG_AWS_IOT_MQTT_HOST "" +#define CONFIG_L2CAP_TRACE_LEVEL_WARNING 1 +#define CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED 1 +#define CONFIG_MB_TIMER_INDEX 0 +#define CONFIG_SCAN_DUPLICATE_TYPE 0 +#define CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED 1 +#define CONFIG_APPL_INITIAL_TRACE_LEVEL 2 +#define CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED 1 +#define CONFIG_SMP_INITIAL_TRACE_LEVEL 2 +#define CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA 1 +#define CONFIG_SPI_SLAVE_ISR_IN_IRAM 1 +#define CONFIG_L2CAP_INITIAL_TRACE_LEVEL 2 +#define CONFIG_SYSTEM_EVENT_QUEUE_SIZE 32 +#define CONFIG_BT_ACL_CONNECTIONS 4 +#define CONFIG_FATFS_MAX_LFN 255 +#define CONFIG_ESP32_WIFI_TX_BUFFER_TYPE 1 +#define CONFIG_BOOTLOADER_WDT_ENABLE 1 +#define CONFIG_GAP_INITIAL_TRACE_LEVEL 2 +#define CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED 1 +#define CONFIG_LWIP_LOOPBACK_MAX_PBUFS 8 +#define CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN 16384 +#define CONFIG_MB_TIMER_GROUP 0 +#define CONFIG_SPI_FLASH_ROM_DRIVER_PATCH 1 +#define CONFIG_MQTT_TRANSPORT_WEBSOCKET_SECURE 1 +#define CONFIG_SPIFFS_PAGE_SIZE 256 +#define CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED 1 +#define CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0 1 +#define CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT 3072 +#define CONFIG_MB_TIMER_PORT_ENABLED 1 +#define CONFIG_DUPLICATE_SCAN_CACHE_SIZE 200 +#define CONFIG_MONITOR_BAUD_OTHER_VAL 115200 +#define CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF 1 +#define CONFIG_ESPTOOLPY_PORT "/dev/ttyUSB0" +#define CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS 1 +#define CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN 1 +#define CONFIG_BLE_ADV_REPORT_DISCARD_THRSHOLD 20 +#define CONFIG_BLUEDROID_PINNED_TO_CORE 0 +#define CONFIG_BTDM_MODEM_SLEEP_MODE_ORIG 1 +#define CONFIG_ESP32_WIFI_IRAM_OPT 1 +#define CONFIG_BLUFI_INITIAL_TRACE_LEVEL 2 +#define CONFIG_FATFS_API_ENCODING_ANSI_OEM 1 diff --git a/examples/espidf-ulp-pulse/src/ulp_example_main.c b/examples/espidf-ulp-pulse/src/ulp_example_main.c new file mode 100644 index 0000000..a6e76ba --- /dev/null +++ b/examples/espidf-ulp-pulse/src/ulp_example_main.c @@ -0,0 +1,119 @@ +/* ULP Example + + This example code is in the Public Domain (or CC0 licensed, at your option.) + + Unless required by applicable law or agreed to in writing, this + software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + CONDITIONS OF ANY KIND, either express or implied. +*/ + +#include +#include "esp_sleep.h" +#include "nvs.h" +#include "nvs_flash.h" +#include "soc/rtc_cntl_reg.h" +#include "soc/sens_reg.h" +#include "soc/rtc_periph.h" +#include "driver/gpio.h" +#include "driver/rtc_io.h" +#include "esp32/ulp.h" +#include "ulp_main.h" + +extern const uint8_t ulp_main_bin_start[] asm("_binary_ulp_main_bin_start"); +extern const uint8_t ulp_main_bin_end[] asm("_binary_ulp_main_bin_end"); + +static void init_ulp_program(); +static void update_pulse_count(); + +void app_main() +{ + esp_sleep_wakeup_cause_t cause = esp_sleep_get_wakeup_cause(); + if (cause != ESP_SLEEP_WAKEUP_ULP) { + printf("Not ULP wakeup, initializing ULP\n"); + init_ulp_program(); + } else { + printf("ULP wakeup, saving pulse count\n"); + update_pulse_count(); + } + + printf("Entering deep sleep\n\n"); + ESP_ERROR_CHECK( esp_sleep_enable_ulp_wakeup() ); + esp_deep_sleep_start(); +} + +static void init_ulp_program() +{ + esp_err_t err = ulp_load_binary(0, ulp_main_bin_start, + (ulp_main_bin_end - ulp_main_bin_start) / sizeof(uint32_t)); + ESP_ERROR_CHECK(err); + + /* GPIO used for pulse counting. */ + gpio_num_t gpio_num = GPIO_NUM_0; + assert(rtc_gpio_desc[gpio_num].reg && "GPIO used for pulse counting must be an RTC IO"); + + /* Initialize some variables used by ULP program. + * Each 'ulp_xyz' variable corresponds to 'xyz' variable in the ULP program. + * These variables are declared in an auto generated header file, + * 'ulp_main.h', name of this file is defined in component.mk as ULP_APP_NAME. + * These variables are located in RTC_SLOW_MEM and can be accessed both by the + * ULP and the main CPUs. + * + * Note that the ULP reads only the lower 16 bits of these variables. + */ + ulp_debounce_counter = 3; + ulp_debounce_max_count = 3; + ulp_next_edge = 0; + ulp_io_number = rtc_gpio_desc[gpio_num].rtc_num; /* map from GPIO# to RTC_IO# */ + ulp_edge_count_to_wake_up = 10; + + /* Initialize selected GPIO as RTC IO, enable input, disable pullup and pulldown */ + rtc_gpio_init(gpio_num); + rtc_gpio_set_direction(gpio_num, RTC_GPIO_MODE_INPUT_ONLY); + rtc_gpio_pulldown_dis(gpio_num); + rtc_gpio_pullup_dis(gpio_num); + rtc_gpio_hold_en(gpio_num); + + /* Disconnect GPIO12 and GPIO15 to remove current drain through + * pullup/pulldown resistors. + * GPIO12 may be pulled high to select flash voltage. + */ + rtc_gpio_isolate(GPIO_NUM_12); + rtc_gpio_isolate(GPIO_NUM_15); + esp_deep_sleep_disable_rom_logging(); // suppress boot messages + + /* Set ULP wake up period to T = 20ms. + * Minimum pulse width has to be T * (ulp_debounce_counter + 1) = 80ms. + */ + ulp_set_wakeup_period(0, 20000); + + /* Start the program */ + err = ulp_run(&ulp_entry - RTC_SLOW_MEM); + ESP_ERROR_CHECK(err); +} + +static void update_pulse_count() +{ + const char* namespace = "plusecnt"; + const char* count_key = "count"; + + ESP_ERROR_CHECK( nvs_flash_init() ); + nvs_handle handle; + ESP_ERROR_CHECK( nvs_open(namespace, NVS_READWRITE, &handle)); + uint32_t pulse_count = 0; + esp_err_t err = nvs_get_u32(handle, count_key, &pulse_count); + assert(err == ESP_OK || err == ESP_ERR_NVS_NOT_FOUND); + printf("Read pulse count from NVS: %5d\n", pulse_count); + + /* ULP program counts signal edges, convert that to the number of pulses */ + uint32_t pulse_count_from_ulp = (ulp_edge_count & UINT16_MAX) / 2; + /* In case of an odd number of edges, keep one until next time */ + ulp_edge_count = ulp_edge_count % 2; + printf("Pulse count from ULP: %5d\n", pulse_count_from_ulp); + + /* Save the new pulse count to NVS */ + pulse_count += pulse_count_from_ulp; + ESP_ERROR_CHECK(nvs_set_u32(handle, count_key, pulse_count)); + ESP_ERROR_CHECK(nvs_commit(handle)); + nvs_close(handle); + printf("Wrote updated pulse count to NVS: %5d\n", pulse_count); +} diff --git a/examples/espidf-ulp-pulse/test/README b/examples/espidf-ulp-pulse/test/README new file mode 100644 index 0000000..df5066e --- /dev/null +++ b/examples/espidf-ulp-pulse/test/README @@ -0,0 +1,11 @@ + +This directory is intended for PIO Unit Testing and project tests. + +Unit Testing is a software testing method by which individual units of +source code, sets of one or more MCU program modules together with associated +control data, usage procedures, and operating procedures, are tested to +determine whether they are fit for use. Unit testing finds problems early +in the development cycle. + +More information about PIO Unit Testing: +- https://docs.platformio.org/page/plus/unit-testing.html diff --git a/examples/espidf-ulp-pulse/ulp/pulse_cnt.S b/examples/espidf-ulp-pulse/ulp/pulse_cnt.S new file mode 100644 index 0000000..774375e --- /dev/null +++ b/examples/espidf-ulp-pulse/ulp/pulse_cnt.S @@ -0,0 +1,157 @@ +/* ULP Example: pulse counting + + This example code is in the Public Domain (or CC0 licensed, at your option.) + + Unless required by applicable law or agreed to in writing, this + software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + CONDITIONS OF ANY KIND, either express or implied. + + This file contains assembly code which runs on the ULP. + + ULP wakes up to run this code at a certain period, determined by the values + in SENS_ULP_CP_SLEEP_CYCx_REG registers. On each wake up, the program checks + the input on GPIO0. If the value is different from the previous one, the + program "debounces" the input: on the next debounce_max_count wake ups, + it expects to see the same value of input. + If this condition holds true, the program increments edge_count and starts + waiting for input signal polarity to change again. + When the edge counter reaches certain value (set by the main program), + this program running triggers a wake up from deep sleep. +*/ + +/* ULP assembly files are passed through C preprocessor first, so include directives + and C macros may be used in these files + */ +#include "soc/rtc_cntl_reg.h" +#include "soc/rtc_io_reg.h" +#include "soc/soc_ulp.h" + + /* Define variables, which go into .bss section (zero-initialized data) */ + .bss + /* Next input signal edge expected: 0 (negative) or 1 (positive) */ + .global next_edge +next_edge: + .long 0 + + /* Counter started when signal value changes. + Edge is "debounced" when the counter reaches zero. */ + .global debounce_counter +debounce_counter: + .long 0 + + /* Value to which debounce_counter gets reset. + Set by the main program. */ + .global debounce_max_count +debounce_max_count: + .long 0 + + /* Total number of signal edges acquired */ + .global edge_count +edge_count: + .long 0 + + /* Number of edges to acquire before waking up the SoC. + Set by the main program. */ + .global edge_count_to_wake_up +edge_count_to_wake_up: + .long 0 + + /* RTC IO number used to sample the input signal. + Set by main program. */ + .global io_number +io_number: + .long 0 + + /* Code goes into .text section */ + .text + .global entry +entry: + /* Load io_number */ + move r3, io_number + ld r3, r3, 0 + + /* Lower 16 IOs and higher need to be handled separately, + * because r0-r3 registers are 16 bit wide. + * Check which IO this is. + */ + move r0, r3 + jumpr read_io_high, 16, ge + + /* Read the value of lower 16 RTC IOs into R0 */ + READ_RTC_REG(RTC_GPIO_IN_REG, RTC_GPIO_IN_NEXT_S, 16) + rsh r0, r0, r3 + jump read_done + + /* Read the value of RTC IOs 16-17, into R0 */ +read_io_high: + READ_RTC_REG(RTC_GPIO_IN_REG, RTC_GPIO_IN_NEXT_S + 16, 2) + sub r3, r3, 16 + rsh r0, r0, r3 + +read_done: + and r0, r0, 1 + /* State of input changed? */ + move r3, next_edge + ld r3, r3, 0 + add r3, r0, r3 + and r3, r3, 1 + jump changed, eq + /* Not changed */ + /* Reset debounce_counter to debounce_max_count */ + move r3, debounce_max_count + move r2, debounce_counter + ld r3, r3, 0 + st r3, r2, 0 + /* End program */ + halt + + .global changed +changed: + /* Input state changed */ + /* Has debounce_counter reached zero? */ + move r3, debounce_counter + ld r2, r3, 0 + add r2, r2, 0 /* dummy ADD to use "jump if ALU result is zero" */ + jump edge_detected, eq + /* Not yet. Decrement debounce_counter */ + sub r2, r2, 1 + st r2, r3, 0 + /* End program */ + halt + + .global edge_detected +edge_detected: + /* Reset debounce_counter to debounce_max_count */ + move r3, debounce_max_count + move r2, debounce_counter + ld r3, r3, 0 + st r3, r2, 0 + /* Flip next_edge */ + move r3, next_edge + ld r2, r3, 0 + add r2, r2, 1 + and r2, r2, 1 + st r2, r3, 0 + /* Increment edge_count */ + move r3, edge_count + ld r2, r3, 0 + add r2, r2, 1 + st r2, r3, 0 + /* Compare edge_count to edge_count_to_wake_up */ + move r3, edge_count_to_wake_up + ld r3, r3, 0 + sub r3, r3, r2 + jump wake_up, eq + /* Not yet. End program */ + halt + + .global wake_up +wake_up: + /* Check if the system can be woken up */ + READ_RTC_FIELD(RTC_CNTL_LOW_POWER_ST_REG, RTC_CNTL_RDY_FOR_WAKEUP) + and r0, r0, 1 + jump wake_up, eq + + /* Wake up the SoC, end program */ + wake + halt diff --git a/platform.json b/platform.json index 29ebc37..199749d 100644 --- a/platform.json +++ b/platform.json @@ -42,6 +42,11 @@ "type": "toolchain", "version": "~2.50200.0" }, + "toolchain-esp32ulp": { + "type": "toolchain", + "optional": true, + "version": "~1.22851.190618" + }, "framework-arduinoespressif32": { "type": "framework", "optional": true, diff --git a/platform.py b/platform.py index 088a5fe..e2ecbbe 100644 --- a/platform.py +++ b/platform.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +from os.path import isdir + from platformio.managers.platform import PlatformBase @@ -22,6 +24,9 @@ class Espressif32Platform(PlatformBase): self.packages['tool-mkspiffs']['optional'] = False if variables.get("upload_protocol"): self.packages['tool-openocd-esp32']['optional'] = False + if isdir("ulp"): + self.packages['toolchain-esp32ulp']['optional'] = False + return PlatformBase.configure_default_packages(self, variables, targets) From a4588001638b105bbba313a94c73046fac083300 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 22 Jun 2019 13:36:07 +0300 Subject: [PATCH 10/14] Create FUNDING.yml --- .github/FUNDING.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..6f70f7e --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +custom: https://platformio.org/donate From 0a807b594c2262dbf06b7b0fa17693584e21bfa1 Mon Sep 17 00:00:00 2001 From: Kyle Isom Date: Sun, 23 Jun 2019 10:29:06 -0700 Subject: [PATCH 11/14] Add M5Stack GREY module. (#189) * Add M5Stack GREY module. c.f. https://m5stack.com/collections/m5-core/products/grey-development-core * Rename board. * Fix build section. --- boards/m5stack-grey.json | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 boards/m5stack-grey.json diff --git a/boards/m5stack-grey.json b/boards/m5stack-grey.json new file mode 100644 index 0000000..071387b --- /dev/null +++ b/boards/m5stack-grey.json @@ -0,0 +1,32 @@ +{ + "build": { + "core": "esp32", + "extra_flags": "-DARDUINO_M5Stack_Core_ESP32", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "ldscript": "esp32_out.ld", + "mcu": "esp32", + "variant": "m5stack_core_esp32" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "frameworks": [ + "arduino", + "espidf" + ], + "name": "M5Stack GREY ESP32", + "upload": { + "flash_size": "16MB", + "maximum_ram_size": 532480, + "maximum_size": 16777216, + "require_upload_port": true, + "speed": 921600 + }, + "url": "http://www.m5stack.com", + "vendor": "M5Stack" +} From daa26141c6143b634378a52a4b24509a26103edf Mon Sep 17 00:00:00 2001 From: valeros Date: Mon, 24 Jun 2019 15:38:16 +0300 Subject: [PATCH 12/14] Update esp-idf framework to v3.2.1 --- builder/frameworks/espidf.py | 5 +++-- platform.json | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/builder/frameworks/espidf.py b/builder/frameworks/espidf.py index 781f547..4006629 100644 --- a/builder/frameworks/espidf.py +++ b/builder/frameworks/espidf.py @@ -228,8 +228,8 @@ def build_protocomm_lib(sdk_params): for d in src_dirs: src_filter += " +<%s>" % d - if is_set("CONFIG_BT_ENABLED", sdk_params) and is_set( - "CONFIG_BLUEDROID_ENABLED", sdk_params): + if not (is_set("CONFIG_BT_ENABLED", sdk_params) and is_set( + "CONFIG_BLUEDROID_ENABLED", sdk_params)): src_filter += " -" src_filter += " -" @@ -445,6 +445,7 @@ env.Prepend( LIBPATH=[ join(FRAMEWORK_DIR, "components", "esp32"), join(FRAMEWORK_DIR, "components", "esp32", "ld"), + join(FRAMEWORK_DIR, "components", "esp32", "ld", "wifi_iram_opt"), join(FRAMEWORK_DIR, "components", "esp32", "lib"), join(FRAMEWORK_DIR, "components", "bt", "lib"), join(FRAMEWORK_DIR, "components", "newlib", "lib"), diff --git a/platform.json b/platform.json index 199749d..df1a2a0 100644 --- a/platform.json +++ b/platform.json @@ -55,7 +55,7 @@ "framework-espidf": { "type": "framework", "optional": true, - "version": "~3.30200.190418" + "version": "~3.30201.190624" }, "framework-simba": { "type": "framework", From 7876a1417247e7914c715728b0568a28a953c179 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 28 Jun 2019 12:27:17 +0300 Subject: [PATCH 13/14] Update ESP-IDF framework to 3.2.2 --- platform.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.json b/platform.json index df1a2a0..93a65ba 100644 --- a/platform.json +++ b/platform.json @@ -55,7 +55,7 @@ "framework-espidf": { "type": "framework", "optional": true, - "version": "~3.30201.190624" + "version": "~3.30202.0" }, "framework-simba": { "type": "framework", From 714442617ca4e64046373719832bacbba3dad544 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 28 Jun 2019 15:21:43 +0300 Subject: [PATCH 14/14] Bump version to 1.9.0 --- platform.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.json b/platform.json index 93a65ba..a9f0ff4 100644 --- a/platform.json +++ b/platform.json @@ -12,7 +12,7 @@ "type": "git", "url": "https://github.com/platformio/platform-espressif32.git" }, - "version": "1.8.0", + "version": "1.9.0", "packageRepositories": [ "https://dl.bintray.com/platformio/dl-packages/manifest.json", "http://dl.platformio.org/packages/manifest.json",