diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 4980f48c4..cfed461f2 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -24,6 +24,7 @@ jobs: - "examples/espidf-peripherals-uart" - "examples/espidf-peripherals-usb" - "examples/espidf-storage-sdcard" + - "examples/espidf-storage-spiffs" - "examples/espidf-ulp-adc" - "examples/espidf-ulp-pulse" - "examples/pumbaa-blink" diff --git a/README.md b/README.md index ffcbdd3d1..cd538167b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Espressif 32: development platform for [PlatformIO](http://platformio.org) -![alt text](https://github.com/platformio/platform-espressif32/workflows/Examples/badge.svg "Espressif 32 development platform") +[![Build Status](https://github.com/platformio/platform-espressif32/workflows/Examples/badge.svg)](https://github.com/platformio/platform-espressif32/actions) Espressif Systems is a privately held fabless semiconductor company. They provide wireless communications and Wi-Fi chips which are widely used in mobile devices and the Internet of Things applications. diff --git a/boards/esp32doit-espduino.json b/boards/esp32doit-espduino.json new file mode 100644 index 000000000..1cadd7e9a --- /dev/null +++ b/boards/esp32doit-espduino.json @@ -0,0 +1,37 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32_out.ld" + }, + "core": "esp32", + "extra_flags": "-DARDUINO_ESP32_DEV", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "doitESPduino32" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "debug": { + "openocd_board": "esp-wroom-32.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "DOIT ESPduino32", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "http://www.doit.am/", + "vendor": "DOIT" +} diff --git a/boards/esp32thing_plus.json b/boards/esp32thing_plus.json new file mode 100644 index 000000000..cf1a74d68 --- /dev/null +++ b/boards/esp32thing_plus.json @@ -0,0 +1,38 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32_out.ld", + "partitions": "default_16MB.csv" + }, + "core": "esp32", + "extra_flags": "-DARDUINO_ESP32_THING_PLUS", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "esp32thing_plus" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "debug": { + "openocd_board": "esp-wroom-32.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "SparkFun ESP32 Thing Plus", + "upload": { + "flash_size": "16MB", + "maximum_ram_size": 327680, + "maximum_size": 16777216, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://www.sparkfun.com/products/15663", + "vendor": "SparkFun Electronics" +} diff --git a/boards/etboard.json b/boards/etboard.json new file mode 100644 index 000000000..1ce9645a2 --- /dev/null +++ b/boards/etboard.json @@ -0,0 +1,34 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32_out.ld" + }, + "core": "esp32", + "extra_flags": "-DARDUINO_ETBoard", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "ETBoard" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "frameworks": [ + "arduino", + "espidf" + ], + "name": "ETBoard", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "http://et.ketri.re.kr", + "vendor": "ETBoard" +} diff --git a/boards/healthypi4.json b/boards/healthypi4.json new file mode 100644 index 000000000..bfebc98a8 --- /dev/null +++ b/boards/healthypi4.json @@ -0,0 +1,34 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32_out.ld" + }, + "core": "esp32", + "extra_flags": "-DARDUINO_HEALTHYPI_4", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "healthypi4" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "frameworks": [ + "arduino", + "espidf" + ], + "name": "ProtoCentral HealthyPi 4", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://healthypi.protocentral.com", + "vendor": "ProtoCentral" +} diff --git a/boards/heltec_wireless_stick_lite.json b/boards/heltec_wireless_stick_lite.json new file mode 100644 index 000000000..6ffac9acf --- /dev/null +++ b/boards/heltec_wireless_stick_lite.json @@ -0,0 +1,34 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32_out.ld" + }, + "core": "esp32", + "extra_flags": "-DARDUINO_HELTEC_WIRELESS_STICK_LITE", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "heltec_wireless_stick_lite" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "frameworks": [ + "arduino", + "espidf" + ], + "name": "Heltec Wireless Stick Lite", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://heltec.org/project/wireless-stick-lite/", + "vendor": "Heltec Automation" +} diff --git a/boards/honeylemon.json b/boards/honeylemon.json new file mode 100644 index 000000000..c3796dfe0 --- /dev/null +++ b/boards/honeylemon.json @@ -0,0 +1,37 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32_out.ld" + }, + "core": "esp32", + "extra_flags": "-DARDUINO_HONEYLEMON", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "honeylemon" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "debug": { + "openocd_board": "esp-wroom-32.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "HONEYLemon", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://en.wikipedia.org/wiki/ESP32", + "vendor": "HONEYLemon" +} diff --git a/boards/imbrios-logsens-v1p1.json b/boards/imbrios-logsens-v1p1.json new file mode 100644 index 000000000..a65362f98 --- /dev/null +++ b/boards/imbrios-logsens-v1p1.json @@ -0,0 +1,34 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32_out.ld" + }, + "core": "esp32", + "extra_flags": "-DARDUINO_IMBRIOS_LOGSENS_V1P1", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "imbrios-logsens-v1p1" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "frameworks": [ + "arduino", + "espidf" + ], + "name": "Imbrios LogSens V1P1", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://www.imbrios.com/products/logsens", + "vendor": "Imbrios" +} diff --git a/boards/inex_openkb.json b/boards/inex_openkb.json new file mode 100644 index 000000000..8f326d5f3 --- /dev/null +++ b/boards/inex_openkb.json @@ -0,0 +1,34 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32_out.ld" + }, + "core": "esp32", + "extra_flags": "-DARDUINO_openkb", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "openkb" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "frameworks": [ + "arduino", + "espidf" + ], + "name": "INEX OpenKB", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://inex.co.th/home/product/openkb/", + "vendor": "INEX" +} diff --git a/boards/kits-edu.json b/boards/kits-edu.json new file mode 100644 index 000000000..6ec72aef9 --- /dev/null +++ b/boards/kits-edu.json @@ -0,0 +1,34 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32_out.ld" + }, + "core": "esp32", + "extra_flags": "-DARDUINO_ESP32_PICO", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "pico32" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "frameworks": [ + "arduino", + "espidf" + ], + "name": "KITS ESP32 EDU", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "http://www.koreaits.com/new/product/summary.htm?goods_no=468&mid_no=103&no=17", + "vendor": "KITS" +} diff --git a/boards/labplus_mpython.json b/boards/labplus_mpython.json new file mode 100644 index 000000000..255edcc9b --- /dev/null +++ b/boards/labplus_mpython.json @@ -0,0 +1,35 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32_out.ld", + "partitions": "huge_app.csv" + }, + "core": "esp32", + "extra_flags": "-DARDUINO_ESP32_DEV", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "mpython" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "frameworks": [ + "arduino", + "espidf" + ], + "name": "Labplus mPython", + "upload": { + "flash_size": "8MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://github.com/labplus-cn/mpython", + "vendor": "Labplus" +} diff --git a/boards/lolin32_lite.json b/boards/lolin32_lite.json new file mode 100644 index 000000000..5e16bc85a --- /dev/null +++ b/boards/lolin32_lite.json @@ -0,0 +1,34 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32_out.ld" + }, + "core": "esp32", + "extra_flags": "-DARDUINO_LOLIN32_LITE", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "lolin32-lite" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "frameworks": [ + "arduino", + "espidf" + ], + "name": "WEMOS LOLIN32 Lite", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://diyprojects.io/wemos-lolin32-lite-compact-revision-lolin32-4-90/", + "vendor": "WEMOS" +} diff --git a/boards/lolin_d32_pro.json b/boards/lolin_d32_pro.json index 18bfcf8a4..732b07318 100644 --- a/boards/lolin_d32_pro.json +++ b/boards/lolin_d32_pro.json @@ -4,7 +4,7 @@ "ldscript": "esp32_out.ld" }, "core": "esp32", - "extra_flags": "-DARDUINO_LOLIN_D32_PRO", + "extra_flags": "-DARDUINO_LOLIN_D32_PRO -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue", "f_cpu": "240000000L", "f_flash": "40000000L", "flash_mode": "dio", @@ -18,7 +18,7 @@ "can" ], "debug": { - "openocd_board": "esp-wroom-32.cfg" + "openocd_board": "esp32-wrover.cfg" }, "frameworks": [ "arduino", @@ -32,6 +32,6 @@ "require_upload_port": true, "speed": 460800 }, - "url": "https://wiki.wemos.cc/products:d32:d32_pro", + "url": "https://www.wemos.cc/en/latest/d32/d32_pro.html", "vendor": "WEMOS" } diff --git a/boards/m5stack-atom.json b/boards/m5stack-atom.json new file mode 100644 index 000000000..786ef3203 --- /dev/null +++ b/boards/m5stack-atom.json @@ -0,0 +1,34 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32_out.ld" + }, + "core": "esp32", + "extra_flags": "-DARDUINO_M5Stack_ATOM", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "m5stack_atom" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "frameworks": [ + "arduino", + "espidf" + ], + "name": "M5Stack-ATOM", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "http://www.m5stack.com", + "vendor": "M5Stack" +} diff --git a/boards/m5stack-core2.json b/boards/m5stack-core2.json new file mode 100644 index 000000000..97fd5a35d --- /dev/null +++ b/boards/m5stack-core2.json @@ -0,0 +1,35 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32_out.ld", + "partitions": "default_16MB.csv" + }, + "core": "esp32", + "extra_flags": "-DARDUINO_M5STACK_Core2 -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "m5stack_core2" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "frameworks": [ + "arduino", + "espidf" + ], + "name": "M5Stack Core2", + "upload": { + "flash_size": "16MB", + "maximum_ram_size": 6553600, + "maximum_size": 16777216, + "require_upload_port": true, + "speed": 460800 + }, + "url": "http://www.m5stack.com", + "vendor": "M5Stack" +} diff --git a/boards/m5stack-coreink.json b/boards/m5stack-coreink.json new file mode 100644 index 000000000..f5aee0d7b --- /dev/null +++ b/boards/m5stack-coreink.json @@ -0,0 +1,34 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32_out.ld" + }, + "core": "esp32", + "extra_flags": "-DARDUINO_M5Stack_CoreInk", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "m5stack_coreink" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "frameworks": [ + "arduino", + "espidf" + ], + "name": "M5Stick-Core Ink", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "http://www.m5stack.com", + "vendor": "M5Stack" +} diff --git a/boards/m5stack-fire.json b/boards/m5stack-fire.json index a7a51b1c4..59001916c 100644 --- a/boards/m5stack-fire.json +++ b/boards/m5stack-fire.json @@ -5,7 +5,7 @@ "partitions": "default_16MB.csv" }, "core": "esp32", - "extra_flags": "-DARDUINO_M5STACK_FIRE", + "extra_flags": "-DARDUINO_M5STACK_FIRE -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue", "f_cpu": "240000000L", "f_flash": "40000000L", "flash_mode": "dio", diff --git a/boards/m5stack-timer-cam.json b/boards/m5stack-timer-cam.json new file mode 100644 index 000000000..41ff2a809 --- /dev/null +++ b/boards/m5stack-timer-cam.json @@ -0,0 +1,34 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32_out.ld" + }, + "core": "esp32", + "extra_flags": "-DARDUINO_M5Stack_Timer_CAM -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "m5stack_timer_cam" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "frameworks": [ + "arduino", + "espidf" + ], + "name": "M5Stack Timer CAM", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "http://www.m5stack.com", + "vendor": "M5Stack" +} diff --git a/boards/mgbot-iotik32a.json b/boards/mgbot-iotik32a.json new file mode 100644 index 000000000..7cab2a56e --- /dev/null +++ b/boards/mgbot-iotik32a.json @@ -0,0 +1,34 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32_out.ld" + }, + "core": "esp32", + "extra_flags": "-DARDUINO_MGBOT_IOTIK32A", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "mgbot-iotik32a" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "frameworks": [ + "arduino", + "espidf" + ], + "name": "MGBOT IOTIK 32A", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "http://iotik.ru/en/iotik32a/", + "vendor": "MGBOT" +} diff --git a/boards/mgbot-iotik32b.json b/boards/mgbot-iotik32b.json new file mode 100644 index 000000000..86e1cce2c --- /dev/null +++ b/boards/mgbot-iotik32b.json @@ -0,0 +1,34 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32_out.ld" + }, + "core": "esp32", + "extra_flags": "-DARDUINO_MGBOT_IOTIK32B", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "mgbot-iotik32b" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "frameworks": [ + "arduino", + "espidf" + ], + "name": "MGBOT IOTIK 32B", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "http://iotik.ru/en/iotik32b/", + "vendor": "MGBOT" +} diff --git a/boards/piranha_esp32.json b/boards/piranha_esp32.json new file mode 100644 index 000000000..acd8a231a --- /dev/null +++ b/boards/piranha_esp32.json @@ -0,0 +1,34 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32_out.ld" + }, + "core": "esp32", + "extra_flags": "-DARDUINO_Piranha", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "piranha_esp-32" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "frameworks": [ + "arduino", + "espidf" + ], + "name": "Fishino Piranha ESP-32", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "http://fishino.it/boards.html", + "vendor": "Fishino" +} diff --git a/boards/s_odi_ultra.json b/boards/s_odi_ultra.json new file mode 100644 index 000000000..3a0307867 --- /dev/null +++ b/boards/s_odi_ultra.json @@ -0,0 +1,34 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32_out.ld" + }, + "core": "esp32", + "extra_flags": "-DARDUINO_ESP32_DEV", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "S_ODI_Ultra_v1" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "frameworks": [ + "arduino", + "espidf" + ], + "name": "S.ODI Ultra v1", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://www.espressif.com/en/products/socs/esp32", + "vendor": "S.ODI" +} diff --git a/boards/sensesiot_weizen.json b/boards/sensesiot_weizen.json new file mode 100644 index 000000000..4492655c4 --- /dev/null +++ b/boards/sensesiot_weizen.json @@ -0,0 +1,37 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32_out.ld" + }, + "core": "esp32", + "extra_flags": "-DARDUINO_sensesiot_weizen", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "esp32" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "debug": { + "openocd_board": "esp32-wrover.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "LOGISENSES Senses Weizen", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://www.logisenses.com/index.php/product/senses-weizen/", + "vendor": "LOGISENSES" +} diff --git a/boards/tinypico.json b/boards/tinypico.json index 883abb412..6a8b88c87 100644 --- a/boards/tinypico.json +++ b/boards/tinypico.json @@ -4,7 +4,7 @@ "ldscript": "esp32_out.ld" }, "core": "esp32", - "extra_flags": "-DARDUINO_ESP32_PICO -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue", + "extra_flags": "-DARDUINO_TINYPICO -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue", "f_cpu": "240000000L", "f_flash": "40000000L", "flash_mode": "qio", diff --git a/boards/ttgo-lora32-v21.json b/boards/ttgo-lora32-v21.json new file mode 100644 index 000000000..c2fb118b3 --- /dev/null +++ b/boards/ttgo-lora32-v21.json @@ -0,0 +1,37 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32_out.ld" + }, + "core": "esp32", + "extra_flags": "-DARDUINO_TTGO_LoRa32_v21new", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "ttgo-lora32-v21new" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "debug": { + "openocd_board": "esp-wroom-32.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "TTGO LoRa32-OLED v2.1.6", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://github.com/LilyGO/TTGO-LoRa32-V2.1", + "vendor": "TTGO" +} diff --git a/boards/ttgo-t-watch.json b/boards/ttgo-t-watch.json index aaf47c0cb..c58c273f3 100644 --- a/boards/ttgo-t-watch.json +++ b/boards/ttgo-t-watch.json @@ -5,7 +5,7 @@ "partitions": "default_16MB.csv" }, "core": "esp32", - "extra_flags": "-DARDUINO_T-Watch -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue", + "extra_flags": "-DARDUINO_TWATCH_BASE -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue", "f_cpu": "240000000L", "f_flash": "40000000L", "flash_mode": "dio", diff --git a/boards/ttgo-t7-v13-mini32.json b/boards/ttgo-t7-v13-mini32.json new file mode 100644 index 000000000..531dbb78b --- /dev/null +++ b/boards/ttgo-t7-v13-mini32.json @@ -0,0 +1,34 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32_out.ld" + }, + "core": "esp32", + "extra_flags": "-DARDUINO_TTGO_T7_V13_Mini32", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "ttgo-t7-v13-mini32" + }, + "connectivity": [ + "wifi", + "bluetooth", + "can", + "ethernet" + ], + "frameworks": [ + "arduino", + "espidf" + ], + "name": "TTGO T7 V1.3 Mini32", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 1310720, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://github.com/LilyGO/ESP32-MINI-32-V1.3", + "vendor": "TTGO" +} diff --git a/boards/ttgo-t7-v14-mini32.json b/boards/ttgo-t7-v14-mini32.json new file mode 100644 index 000000000..a5d5a7aaa --- /dev/null +++ b/boards/ttgo-t7-v14-mini32.json @@ -0,0 +1,37 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32_out.ld" + }, + "core": "esp32", + "extra_flags": "-DARDUINO_TTGO_T7_V14_Mini32", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "ttgo-t7-v14-mini32" + }, + "connectivity": [ + "wifi", + "bluetooth", + "can", + "ethernet" + ], + "debug": { + "openocd_board": "esp32-wrover.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "TTGO T7 V1.4 Mini32", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 1310720, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "http://www.lilygo.cn/prod_view.aspx?TypeId=50033&Id=978&FId=t3:50033:3", + "vendor": "TTGO" +} diff --git a/boards/wifiduino32.json b/boards/wifiduino32.json new file mode 100644 index 000000000..53ca00942 --- /dev/null +++ b/boards/wifiduino32.json @@ -0,0 +1,34 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32_out.ld" + }, + "core": "esp32", + "extra_flags": "-DARDUINO_Wifiduino32", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "wifiduino32" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "frameworks": [ + "arduino", + "espidf" + ], + "name": "Blinker WiFiduino32", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://diandeng.tech", + "vendor": "Blinker" +} diff --git a/builder/main.py b/builder/main.py index 383c197c7..e19ea8f9d 100644 --- a/builder/main.py +++ b/builder/main.py @@ -293,8 +293,8 @@ def __fetch_spiffs_size(target, source, env): UPLOADERFLAGS=["--debug", "--progress", "-i", "$UPLOAD_PORT"], UPLOADCMD='"$PYTHONEXE" "$UPLOADER" $UPLOADERFLAGS -f $SOURCE' ) - if "uploadfs" in COMMAND_LINE_TARGETS: - env.Append(UPLOADERFLAGS=["-s"]) + if set(["uploadfs", "uploadfsota"]) & set(COMMAND_LINE_TARGETS): + env.Append(UPLOADERFLAGS=["--spiffs"]) upload_actions = [env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE")] elif upload_protocol == "esptool": diff --git a/examples/arduino-blink/platformio.ini b/examples/arduino-blink/platformio.ini index ad383a4f3..b9bd7f537 100644 --- a/examples/arduino-blink/platformio.ini +++ b/examples/arduino-blink/platformio.ini @@ -27,3 +27,8 @@ platform = espressif32 framework = arduino board = lolin32 monitor_speed = 115200 + +[env:ttgo-lora32-v21] +platform = espressif32 +framework = arduino +board = ttgo-lora32-v21 diff --git a/examples/espidf-storage-spiffs/.gitignore b/examples/espidf-storage-spiffs/.gitignore new file mode 100644 index 000000000..03f4a3c19 --- /dev/null +++ b/examples/espidf-storage-spiffs/.gitignore @@ -0,0 +1 @@ +.pio diff --git a/examples/espidf-storage-spiffs/CMakeLists.txt b/examples/espidf-storage-spiffs/CMakeLists.txt new file mode 100644 index 000000000..1894b31ca --- /dev/null +++ b/examples/espidf-storage-spiffs/CMakeLists.txt @@ -0,0 +1,6 @@ +# The following lines of boilerplate have to be in your project's CMakeLists +# in this exact order for cmake to work correctly +cmake_minimum_required(VERSION 3.5) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(spiffs) diff --git a/examples/espidf-storage-spiffs/README.rst b/examples/espidf-storage-spiffs/README.rst new file mode 100644 index 000000000..25efc94a5 --- /dev/null +++ b/examples/espidf-storage-spiffs/README.rst @@ -0,0 +1,35 @@ +.. 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-storage-spiffs + + # Build project + > platformio run + + # Upload firmware + > platformio run --target upload + + # Upload SPIFFS image + > platformio run --target uploadfs + + # Clean build files + > platformio run --target clean diff --git a/examples/espidf-storage-spiffs/data/hello.txt b/examples/espidf-storage-spiffs/data/hello.txt new file mode 100644 index 000000000..5a8367719 --- /dev/null +++ b/examples/espidf-storage-spiffs/data/hello.txt @@ -0,0 +1 @@ +Hello World from SPIFFS. diff --git a/examples/espidf-storage-spiffs/include/README b/examples/espidf-storage-spiffs/include/README new file mode 100644 index 000000000..194dcd432 --- /dev/null +++ b/examples/espidf-storage-spiffs/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-storage-spiffs/lib/README b/examples/espidf-storage-spiffs/lib/README new file mode 100644 index 000000000..6debab1e8 --- /dev/null +++ b/examples/espidf-storage-spiffs/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-storage-spiffs/partitions_example.csv b/examples/espidf-storage-spiffs/partitions_example.csv new file mode 100644 index 000000000..92db904e0 --- /dev/null +++ b/examples/espidf-storage-spiffs/partitions_example.csv @@ -0,0 +1,6 @@ +# Name, Type, SubType, Offset, Size, Flags +# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap +nvs, data, nvs, 0x9000, 0x6000, +phy_init, data, phy, 0xf000, 0x1000, +factory, app, factory, 0x10000, 1M, +spiffs, data, spiffs, , 0xF0000, diff --git a/examples/espidf-storage-spiffs/platformio.ini b/examples/espidf-storage-spiffs/platformio.ini new file mode 100644 index 000000000..83870a9a3 --- /dev/null +++ b/examples/espidf-storage-spiffs/platformio.ini @@ -0,0 +1,15 @@ +; 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 +monitor_speed = 115200 +board_build.partitions = partitions_example.csv diff --git a/examples/espidf-storage-spiffs/sdkconfig.defaults b/examples/espidf-storage-spiffs/sdkconfig.defaults new file mode 100644 index 000000000..b9bb0c0a5 --- /dev/null +++ b/examples/espidf-storage-spiffs/sdkconfig.defaults @@ -0,0 +1,3 @@ +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_example.csv" +CONFIG_PARTITION_TABLE_FILENAME="partitions_example.csv" diff --git a/examples/espidf-storage-spiffs/src/CMakeLists.txt b/examples/espidf-storage-spiffs/src/CMakeLists.txt new file mode 100644 index 000000000..026db1313 --- /dev/null +++ b/examples/espidf-storage-spiffs/src/CMakeLists.txt @@ -0,0 +1,2 @@ +idf_component_register(SRCS "spiffs_example_main.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/espidf-storage-spiffs/src/spiffs_example_main.c b/examples/espidf-storage-spiffs/src/spiffs_example_main.c new file mode 100644 index 000000000..279f3df19 --- /dev/null +++ b/examples/espidf-storage-spiffs/src/spiffs_example_main.c @@ -0,0 +1,73 @@ +/* SPIFFS filesystem 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 +#include +#include "esp_err.h" +#include "esp_log.h" +#include "esp_spiffs.h" + +static const char *TAG = "example"; + +void app_main(void) +{ + ESP_LOGI(TAG, "Initializing SPIFFS"); + + esp_vfs_spiffs_conf_t conf = { + .base_path = "/spiffs", + .partition_label = NULL, + .max_files = 5, + .format_if_mount_failed = true + }; + + // Use settings defined above to initialize and mount SPIFFS filesystem. + // Note: esp_vfs_spiffs_register is an all-in-one convenience function. + esp_err_t ret = esp_vfs_spiffs_register(&conf); + + if (ret != ESP_OK) { + if (ret == ESP_FAIL) { + ESP_LOGE(TAG, "Failed to mount or format filesystem"); + } else if (ret == ESP_ERR_NOT_FOUND) { + ESP_LOGE(TAG, "Failed to find SPIFFS partition"); + } else { + ESP_LOGE(TAG, "Failed to initialize SPIFFS (%s)", esp_err_to_name(ret)); + } + return; + } + + size_t total = 0, used = 0; + ret = esp_spiffs_info(conf.partition_label, &total, &used); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to get SPIFFS partition information (%s)", esp_err_to_name(ret)); + } else { + ESP_LOGI(TAG, "Partition size: total: %d, used: %d", total, used); + } + + // Open renamed file for reading + ESP_LOGI(TAG, "Reading file"); + FILE* f = fopen("/spiffs/hello.txt", "r"); + if (f == NULL) { + ESP_LOGI(TAG, "Failed to open file for reading"); + return; + } + char line[64]; + fgets(line, sizeof(line), f); + fclose(f); + // strip newline + char* pos = strchr(line, '\n'); + if (pos) { + *pos = '\0'; + } + ESP_LOGI(TAG, "Read from file: '%s'", line); + + // All done, unmount partition and disable SPIFFS + esp_vfs_spiffs_unregister(conf.partition_label); + ESP_LOGI(TAG, "SPIFFS unmounted"); +} diff --git a/examples/espidf-storage-spiffs/test/README b/examples/espidf-storage-spiffs/test/README new file mode 100644 index 000000000..df5066e64 --- /dev/null +++ b/examples/espidf-storage-spiffs/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/platform.json b/platform.json index f8d2e066d..843005c71 100644 --- a/platform.json +++ b/platform.json @@ -18,7 +18,7 @@ "type": "git", "url": "https://github.com/platformio/platform-espressif32.git" }, - "version": "3.0.0", + "version": "3.1.0", "frameworks": { "arduino": { "package": "framework-arduinoespressif32", @@ -75,7 +75,7 @@ "type": "framework", "optional": true, "owner": "platformio", - "version": "~3.10004.191002" + "version": "~3.10005.0" }, "framework-arduino-mbcwb": { "type": "framework",