From 6ff0e547c187868ec5ac0d8d31e77640b2db6be1 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Mon, 15 Jul 2024 14:22:46 +0200 Subject: [PATCH 1/8] Delete examples/espidf-ble-eddystone directory --- examples/espidf-ble-eddystone/.gitignore | 1 - examples/espidf-ble-eddystone/.travis.yml | 67 ----- examples/espidf-ble-eddystone/CMakeLists.txt | 6 - examples/espidf-ble-eddystone/README.md | 27 -- examples/espidf-ble-eddystone/include/README | 39 --- examples/espidf-ble-eddystone/lib/README | 46 ---- examples/espidf-ble-eddystone/platformio.ini | 14 - .../espidf-ble-eddystone/sdkconfig.defaults | 6 - .../espidf-ble-eddystone/src/CMakeLists.txt | 4 - .../src/esp_eddystone_api.c | 251 ------------------ .../src/esp_eddystone_api.h | 67 ----- .../src/esp_eddystone_demo.c | 173 ------------ .../src/esp_eddystone_protocol.h | 110 -------- examples/espidf-ble-eddystone/test/README | 11 - 14 files changed, 822 deletions(-) delete mode 100644 examples/espidf-ble-eddystone/.gitignore delete mode 100644 examples/espidf-ble-eddystone/.travis.yml delete mode 100644 examples/espidf-ble-eddystone/CMakeLists.txt delete mode 100644 examples/espidf-ble-eddystone/README.md delete mode 100644 examples/espidf-ble-eddystone/include/README delete mode 100644 examples/espidf-ble-eddystone/lib/README delete mode 100644 examples/espidf-ble-eddystone/platformio.ini delete mode 100644 examples/espidf-ble-eddystone/sdkconfig.defaults delete mode 100644 examples/espidf-ble-eddystone/src/CMakeLists.txt delete mode 100644 examples/espidf-ble-eddystone/src/esp_eddystone_api.c delete mode 100644 examples/espidf-ble-eddystone/src/esp_eddystone_api.h delete mode 100644 examples/espidf-ble-eddystone/src/esp_eddystone_demo.c delete mode 100644 examples/espidf-ble-eddystone/src/esp_eddystone_protocol.h delete mode 100644 examples/espidf-ble-eddystone/test/README diff --git a/examples/espidf-ble-eddystone/.gitignore b/examples/espidf-ble-eddystone/.gitignore deleted file mode 100644 index 03f4a3c19..000000000 --- a/examples/espidf-ble-eddystone/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pio diff --git a/examples/espidf-ble-eddystone/.travis.yml b/examples/espidf-ble-eddystone/.travis.yml deleted file mode 100644 index 7c486f183..000000000 --- a/examples/espidf-ble-eddystone/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# 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-ble-eddystone/CMakeLists.txt b/examples/espidf-ble-eddystone/CMakeLists.txt deleted file mode 100644 index 9c5943ef0..000000000 --- a/examples/espidf-ble-eddystone/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -# 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(ble_eddystone_demo) diff --git a/examples/espidf-ble-eddystone/README.md b/examples/espidf-ble-eddystone/README.md deleted file mode 100644 index 95ad3377c..000000000 --- a/examples/espidf-ble-eddystone/README.md +++ /dev/null @@ -1,27 +0,0 @@ -How to build PlatformIO based project -===================================== - -1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) -2. Download [development platform with examples](https://github.com/platformio/platform-espressif32/archive/develop.zip) -3. Extract ZIP archive -4. Run these commands: - -```shell -# Change directory to example -$ cd platform-espressif32/examples/espidf-ble-eddystone - -# Build project -$ pio run - -# Upload firmware -$ pio run --target upload - -# Build specific environment -$ pio run -e esp32dev - -# Upload firmware for the specific environment -$ pio run -e esp32dev --target upload - -# Clean build files -$ pio run --target clean -``` \ No newline at end of file diff --git a/examples/espidf-ble-eddystone/include/README b/examples/espidf-ble-eddystone/include/README deleted file mode 100644 index 194dcd432..000000000 --- a/examples/espidf-ble-eddystone/include/README +++ /dev/null @@ -1,39 +0,0 @@ - -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-ble-eddystone/lib/README b/examples/espidf-ble-eddystone/lib/README deleted file mode 100644 index 6debab1e8..000000000 --- a/examples/espidf-ble-eddystone/lib/README +++ /dev/null @@ -1,46 +0,0 @@ - -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-ble-eddystone/platformio.ini b/examples/espidf-ble-eddystone/platformio.ini deleted file mode 100644 index 6d6af7407..000000000 --- a/examples/espidf-ble-eddystone/platformio.ini +++ /dev/null @@ -1,14 +0,0 @@ -; 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 -; https://docs.platformio.org/page/projectconf.html - -[env:esp32dev] -platform = espressif32 -framework = espidf -board = esp32dev -monitor_speed = 115200 diff --git a/examples/espidf-ble-eddystone/sdkconfig.defaults b/examples/espidf-ble-eddystone/sdkconfig.defaults deleted file mode 100644 index 00fb52113..000000000 --- a/examples/espidf-ble-eddystone/sdkconfig.defaults +++ /dev/null @@ -1,6 +0,0 @@ -# Override some defaults so BT stack is enabled -# and WiFi disabled by default in this example -CONFIG_BT_ENABLED=y -CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y -CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=n -CONFIG_BTDM_CTRL_MODE_BTDM=n diff --git a/examples/espidf-ble-eddystone/src/CMakeLists.txt b/examples/espidf-ble-eddystone/src/CMakeLists.txt deleted file mode 100644 index 0820e85fc..000000000 --- a/examples/espidf-ble-eddystone/src/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -idf_component_register(SRCS "esp_eddystone_api.c" - "esp_eddystone_demo.c" - INCLUDE_DIRS "") -target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format") diff --git a/examples/espidf-ble-eddystone/src/esp_eddystone_api.c b/examples/espidf-ble-eddystone/src/esp_eddystone_api.c deleted file mode 100644 index 283211650..000000000 --- a/examples/espidf-ble-eddystone/src/esp_eddystone_api.c +++ /dev/null @@ -1,251 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Unlicense OR CC0-1.0 - */ - - -/**************************************************************************** -* -* This file is used to decode eddystone information. -* -****************************************************************************/ - -#include -#include -#include -#include - -#include "esp_err.h" -#include "esp_gap_ble_api.h" -#include "esp_eddystone_protocol.h" -#include "esp_eddystone_api.h" - - -/* Declare static functions */ -static esp_err_t esp_eddystone_uid_received(const uint8_t* buf, uint8_t len, esp_eddystone_result_t* res); -static esp_err_t esp_eddystone_url_received(const uint8_t* buf, uint8_t len, esp_eddystone_result_t* res); -static char* esp_eddystone_resolve_url_scheme(const uint8_t* url_start, const uint8_t* url_end); -static esp_err_t esp_eddystone_tlm_received(const uint8_t* buf, uint8_t len, esp_eddystone_result_t* res); -static esp_err_t esp_eddystone_get_inform(const uint8_t* buf, uint8_t len, esp_eddystone_result_t* res); - -/* Eddystone-URL scheme prefixes */ -static const char* eddystone_url_prefix[4] = { - "http://www.", - "https://www.", - "http://", - "https://" -}; - -/* Eddystone-URL HTTP URL encoding */ -static const char* eddystone_url_encoding[14] = { - ".com/", - ".org/", - ".edu/", - ".net/", - ".info/", - ".biz/", - ".gov/", - ".com", - ".org", - ".edu", - ".net", - ".info", - ".biz", - ".gov" - }; - -/****************** Eddystone-UID ************** -Byte offset Field Description - 0 Frame Type Value = 0x00 - 1 Ranging Data Calibrated Tx power at 0 m - 2 NID[0] 10-byte Namespace - 3 NID[1] - 4 NID[2] - 5 NID[3] - 6 NID[4] - 7 NID[5] - 8 NID[6] - 9 NID[7] - 10 NID[8] - 11 NID[9] - 12 BID[0] 6-byte Instance - 13 BID[1] - 14 BID[2] - 15 BID[3] - 16 BID[4] - 17 BID[5] - 18 RFU Reserved for future use, must be0x00 - 19 RFU Reserved for future use, must be0x00 -*********************************************/ -/* decode and store received UID */ -static esp_err_t esp_eddystone_uid_received(const uint8_t* buf, uint8_t len, esp_eddystone_result_t* res) -{ - uint8_t pos = 0; - //1-byte Ranging Data + 10-byte Namespace + 6-byte Instance - if((len != EDDYSTONE_UID_DATA_LEN) && (len != (EDDYSTONE_UID_RFU_LEN+EDDYSTONE_UID_DATA_LEN))) { - //ERROR:uid len wrong - return -1; - } - res->inform.uid.ranging_data = buf[pos++]; - for(int i=0; iinform.uid.namespace_id[i] = buf[pos++]; - } - for(int i=0; iinform.uid.instance_id[i] = buf[pos++]; - } - return 0; -} - -/* resolve received URL to url_res pointer */ -static char* esp_eddystone_resolve_url_scheme(const uint8_t *url_start, const uint8_t *url_end) -{ - int pos = 0; - static char url_buf[100] = {0}; - const uint8_t *p = url_start; - - pos += sprintf(&url_buf[pos], "%s", eddystone_url_prefix[*p++]); - - for (; p <= url_end; p++) { - if (esp_eddystone_is_char_invalid((*p))) { - pos += sprintf(&url_buf[pos], "%s", eddystone_url_encoding[*p]); - } else { - pos += sprintf(&url_buf[pos], "%c", *p); - } - } - return url_buf; -} - -/************************** Eddystone-URL ************* -Frame Specification - Byte offset Field Description - 0 Frame Type Value = 0x10 - 1 TX Power Calibrated Tx power at 0 m - 2 URL Scheme Encoded Scheme Prefix - 3+ Encoded URL Length 1-17 -*******************************************************/ -/* decode and store received URL, the pointer url_res points to the resolved url */ -static esp_err_t esp_eddystone_url_received(const uint8_t* buf, uint8_t len, esp_eddystone_result_t* res) -{ - char *url_res = NULL; - uint8_t pos = 0; - if(len-EDDYSTONE_URL_TX_POWER_LEN > EDDYSTONE_URL_MAX_LEN) { - //ERROR:too long url - return -1; - } - res->inform.url.tx_power = buf[pos++]; - url_res = esp_eddystone_resolve_url_scheme(buf+pos, buf+len-1); - memcpy(&res->inform.url.url, url_res, strlen(url_res)); - res->inform.url.url[strlen(url_res)] = '\0'; - return 0; -} - -/****************** eddystone-tlm *************** - * Unencrypted TLM Frame Specification -Byte offset Field Description - 0 Frame Type Value = 0x20 - 1 Version TLM version, value = 0x00 - 2 VBATT[0] Battery voltage, 1 mV/bit - 3 VBATT[1] - 4 TEMP[0] Beacon temperature - 5 TEMP[1] - 6 ADV_CNT[0] Advertising PDU count - 7 ADV_CNT[1] - 8 ADV_CNT[2] - 9 ADV_CNT[3] - 10 SEC_CNT[0] Time since power-on or reboot - 11 SEC_CNT[1] - 12 SEC_CNT[2] - 13 SEC_CNT[3] -************************************************/ -/* decode and store received TLM */ -static esp_err_t esp_eddystone_tlm_received(const uint8_t* buf, uint8_t len, esp_eddystone_result_t* res) -{ - uint8_t pos = 0; - if(len > EDDYSTONE_TLM_DATA_LEN) { - //ERROR:TLM too long - return -1; - } - res->inform.tlm.version = buf[pos++]; - res->inform.tlm.battery_voltage = big_endian_read_16(buf, pos); - pos += 2; - uint16_t temp = big_endian_read_16(buf, pos); - int8_t temp_integral = (int8_t)((temp >> 8) & 0xff); - float temp_decimal = (temp & 0xff) / 256.0; - res->inform.tlm.temperature = temp_integral + temp_decimal; - pos += 2; - res->inform.tlm.adv_count = big_endian_read_32(buf, pos); - pos += 4; - res->inform.tlm.time = big_endian_read_32(buf, pos); - return 0; -} - -static esp_err_t esp_eddystone_get_inform(const uint8_t* buf, uint8_t len, esp_eddystone_result_t* res) -{ - static esp_err_t ret=-1; - switch(res->common.frame_type) - { - case EDDYSTONE_FRAME_TYPE_UID: { - ret = esp_eddystone_uid_received(buf, len, res); - break; - } - case EDDYSTONE_FRAME_TYPE_URL: { - ret = esp_eddystone_url_received(buf, len, res); - break; - } - case EDDYSTONE_FRAME_TYPE_TLM: { - ret = esp_eddystone_tlm_received(buf, len, res); - break; - } - default: - break; - } - return ret; -} - -esp_err_t esp_eddystone_decode(const uint8_t* buf, uint8_t len, esp_eddystone_result_t* res) -{ - if (len == 0 || buf == NULL || res == NULL) { - return -1; - } - uint8_t pos=0; - while(res->common.srv_data_type != EDDYSTONE_SERVICE_UUID) - { - pos++; - if(pos >= len ) { - return -1; - } - uint8_t ad_type = buf[pos++]; - switch(ad_type) - { - case ESP_BLE_AD_TYPE_FLAG: { - res->common.flags = buf[pos++]; - break; - } - case ESP_BLE_AD_TYPE_16SRV_CMPL: { - uint16_t uuid = little_endian_read_16(buf, pos); - if(uuid != EDDYSTONE_SERVICE_UUID) { - return -1; - } - res->common.srv_uuid = uuid; - pos += 2; - break; - } - case ESP_BLE_AD_TYPE_SERVICE_DATA: { - uint16_t type = little_endian_read_16(buf, pos); - pos += 2; - uint8_t frame_type = buf[pos++]; - if(type != EDDYSTONE_SERVICE_UUID || !(frame_type == EDDYSTONE_FRAME_TYPE_UID || frame_type == EDDYSTONE_FRAME_TYPE_URL || - frame_type == EDDYSTONE_FRAME_TYPE_TLM)) { - return -1; - } - res->common.srv_data_type = type; - res->common.frame_type = frame_type; - break; - } - default: - break; - } - } - return esp_eddystone_get_inform(buf+pos, len-pos, res); -} diff --git a/examples/espidf-ble-eddystone/src/esp_eddystone_api.h b/examples/espidf-ble-eddystone/src/esp_eddystone_api.h deleted file mode 100644 index 752044f67..000000000 --- a/examples/espidf-ble-eddystone/src/esp_eddystone_api.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Unlicense OR CC0-1.0 - */ - - -#ifndef __ESP_EDDYSTONE_API_H__ -#define __ESP_EDDYSTONE_API_H__ - -typedef struct { - struct { - uint8_t flags; /* -#include -#include - -#include "esp_bt.h" -#include "nvs_flash.h" -#include "esp_log.h" -#include "esp_bt_defs.h" -#include "esp_bt_main.h" -#include "esp_gatt_defs.h" -#include "esp_gattc_api.h" -#include "esp_gap_ble_api.h" -#include "freertos/FreeRTOS.h" - -#include "esp_eddystone_protocol.h" -#include "esp_eddystone_api.h" - -static const char* DEMO_TAG = "EDDYSTONE_DEMO"; - -/* declare static functions */ -static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t* param); -static void esp_eddystone_show_inform(const esp_eddystone_result_t* res); - -static esp_ble_scan_params_t ble_scan_params = { - .scan_type = BLE_SCAN_TYPE_ACTIVE, - .own_addr_type = BLE_ADDR_TYPE_PUBLIC, - .scan_filter_policy = BLE_SCAN_FILTER_ALLOW_ALL, - .scan_interval = 0x50, - .scan_window = 0x30, - .scan_duplicate = BLE_SCAN_DUPLICATE_DISABLE -}; - -static void esp_eddystone_show_inform(const esp_eddystone_result_t* res) -{ - switch(res->common.frame_type) - { - case EDDYSTONE_FRAME_TYPE_UID: { - ESP_LOGI(DEMO_TAG, "Eddystone UID inform:"); - ESP_LOGI(DEMO_TAG, "Measured power(RSSI at 0m distance):%d dbm", res->inform.uid.ranging_data); - ESP_LOGI(DEMO_TAG, "EDDYSTONE_DEMO: Namespace ID:0x"); - esp_log_buffer_hex(DEMO_TAG, res->inform.uid.namespace_id, 10); - ESP_LOGI(DEMO_TAG, "EDDYSTONE_DEMO: Instance ID:0x"); - esp_log_buffer_hex(DEMO_TAG, res->inform.uid.instance_id, 6); - break; - } - case EDDYSTONE_FRAME_TYPE_URL: { - ESP_LOGI(DEMO_TAG, "Eddystone URL inform:"); - ESP_LOGI(DEMO_TAG, "Measured power(RSSI at 0m distance):%d dbm", res->inform.url.tx_power); - ESP_LOGI(DEMO_TAG, "URL: %s", res->inform.url.url); - break; - } - case EDDYSTONE_FRAME_TYPE_TLM: { - ESP_LOGI(DEMO_TAG, "Eddystone TLM inform:"); - ESP_LOGI(DEMO_TAG, "version: %d", res->inform.tlm.version); - ESP_LOGI(DEMO_TAG, "battery voltage: %d mV", res->inform.tlm.battery_voltage); - ESP_LOGI(DEMO_TAG, "beacon temperature in degrees Celsius: %6.1f", res->inform.tlm.temperature); - ESP_LOGI(DEMO_TAG, "adv pdu count since power-up: %d", res->inform.tlm.adv_count); - ESP_LOGI(DEMO_TAG, "time since power-up: %d s", (res->inform.tlm.time)/10); - break; - } - default: - break; - } -} - -static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t* param) -{ - esp_err_t err; - - switch(event) - { - case ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT: { - uint32_t duration = 0; - esp_ble_gap_start_scanning(duration); - break; - } - case ESP_GAP_BLE_SCAN_START_COMPLETE_EVT: { - if((err = param->scan_start_cmpl.status) != ESP_BT_STATUS_SUCCESS) { - ESP_LOGE(DEMO_TAG,"Scan start failed: %s", esp_err_to_name(err)); - } - else { - ESP_LOGI(DEMO_TAG,"Start scanning..."); - } - break; - } - case ESP_GAP_BLE_SCAN_RESULT_EVT: { - esp_ble_gap_cb_param_t* scan_result = (esp_ble_gap_cb_param_t*)param; - switch(scan_result->scan_rst.search_evt) - { - case ESP_GAP_SEARCH_INQ_RES_EVT: { - esp_eddystone_result_t eddystone_res; - memset(&eddystone_res, 0, sizeof(eddystone_res)); - esp_err_t ret = esp_eddystone_decode(scan_result->scan_rst.ble_adv, scan_result->scan_rst.adv_data_len, &eddystone_res); - if (ret) { - // error:The received data is not an eddystone frame packet or a correct eddystone frame packet. - // just return - return; - } else { - // The received adv data is a correct eddystone frame packet. - // Here, we get the eddystone infomation in eddystone_res, we can use the data in res to do other things. - // For example, just print them: - ESP_LOGI(DEMO_TAG, "--------Eddystone Found----------"); - esp_log_buffer_hex("EDDYSTONE_DEMO: Device address:", scan_result->scan_rst.bda, ESP_BD_ADDR_LEN); - ESP_LOGI(DEMO_TAG, "RSSI of packet:%d dbm", scan_result->scan_rst.rssi); - esp_eddystone_show_inform(&eddystone_res); - } - break; - } - default: - break; - } - break; - } - case ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT:{ - if((err = param->scan_stop_cmpl.status) != ESP_BT_STATUS_SUCCESS) { - ESP_LOGE(DEMO_TAG,"Scan stop failed: %s", esp_err_to_name(err)); - } - else { - ESP_LOGI(DEMO_TAG,"Stop scan successfully"); - } - break; - } - default: - break; - } -} - -void esp_eddystone_appRegister(void) -{ - esp_err_t status; - - ESP_LOGI(DEMO_TAG,"Register callback"); - - /*= 0x00 && ch <= 0x20) || (ch >= 0x7f && ch <= 0xff); -} - -#endif /* __ESP_EDDYSTONE_PROTOCOL_H__ */ diff --git a/examples/espidf-ble-eddystone/test/README b/examples/espidf-ble-eddystone/test/README deleted file mode 100644 index df5066e64..000000000 --- a/examples/espidf-ble-eddystone/test/README +++ /dev/null @@ -1,11 +0,0 @@ - -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 From a5c428408ce14640c5a0ff5621f09a976ad692f3 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Mon, 15 Jul 2024 14:37:57 +0200 Subject: [PATCH 2/8] changes for core 3.0.2 --- .github/stale.yml | 21 -- .github/workflows/examples.yml | 28 +- .github/workflows/tests.yml | 30 -- .gitignore | 1 + builder/frameworks/_embed_files.py | 6 +- builder/frameworks/arduino.py | 1 - builder/frameworks/espidf.py | 19 +- builder/frameworks/ulp.py | 11 +- builder/main.py | 99 +++--- examples/arduino-ble5-advertising/README.md | 27 -- .../arduino-ble5-advertising/platformio.ini | 14 - .../src/BLE5_periodic_advertising.ino | 72 ----- examples/arduino-blink/.travis.yml | 67 ----- examples/arduino-blink/README.md | 2 +- examples/arduino-blink/platformio.ini | 37 +-- examples/arduino-blink/src/Blink.cpp | 4 +- examples/arduino-rmt-blink/platformio.ini | 27 ++ .../src/RMTWriteNeoPixel.ino | 103 +++++++ examples/arduino-usb-keyboard/platformio.ini | 3 - examples/arduino-wifiscan/.travis.yml | 67 ----- examples/arduino-wifiscan/README.md | 2 +- examples/arduino-wifiscan/platformio.ini | 20 +- examples/espidf-arduino-blink/.travis.yml | 67 ----- examples/espidf-arduino-blink/CMakeLists.txt | 2 +- examples/espidf-arduino-blink/platformio.ini | 21 +- .../espidf-arduino-blink/sdkconfig.defaults | 152 ++++++++++ examples/espidf-arduino-blink/src/Blink.cpp | 2 +- examples/espidf-arduino-littlefs/.gitignore | 2 + .../espidf-arduino-littlefs/CMakeLists.txt | 3 + examples/espidf-arduino-littlefs/README.md | 1 + .../espidf-arduino-littlefs/data/file1.txt | 1 + .../data/testfolder/test2.txt | 1 + .../include/README | 0 .../lib/README | 0 .../partitions_custom.csv | 7 + .../espidf-arduino-littlefs/platformio.ini | 24 ++ .../sdkconfig.defaults | 9 + .../src/CMakeLists.txt | 6 + examples/espidf-arduino-littlefs/src/main.cpp | 282 ++++++++++++++++++ examples/espidf-arduino-wifiscan/.travis.yml | 67 ----- .../espidf-arduino-wifiscan/platformio.ini | 9 +- .../sdkconfig.defaults | 4 + .../.gitignore | 0 .../CMakeLists.txt | 2 +- .../README.md | 4 +- .../include/README | 0 examples/espidf-blink/lib/README | 77 +++++ examples/espidf-blink/platformio.ini | 39 +++ examples/espidf-blink/sdkconfig.defaults | 4 + examples/espidf-blink/src/CMakeLists.txt | 2 + examples/espidf-blink/src/blink.c | 91 ++++++ .../test/README | 0 examples/espidf-coap-server/.travis.yml | 67 ----- examples/espidf-coap-server/platformio.ini | 6 - examples/espidf-exceptions/.travis.yml | 67 ----- examples/espidf-exceptions/platformio.ini | 6 - examples/espidf-hello-world/.travis.yml | 67 ----- examples/espidf-hello-world/platformio.ini | 5 - .../sdkconfig.defaults.esp32c6 | 2 - examples/espidf-http-request/.travis.yml | 67 ----- examples/espidf-http-request/platformio.ini | 6 - examples/espidf-peripherals-uart/.travis.yml | 67 ----- .../espidf-peripherals-uart/platformio.ini | 6 - examples/espidf-peripherals-usb/.travis.yml | 67 ----- examples/espidf-storage-sdcard/.travis.yml | 67 ----- examples/espidf-storage-sdcard/platformio.ini | 6 - examples/espidf-storage-spiffs/.gitignore | 1 - examples/espidf-storage-spiffs/README.md | 24 -- examples/espidf-storage-spiffs/data/hello.txt | 1 - examples/espidf-storage-spiffs/lib/README | 46 --- .../partitions_example.csv | 6 - examples/espidf-storage-spiffs/platformio.ini | 15 - .../espidf-storage-spiffs/sdkconfig.defaults | 3 - .../espidf-storage-spiffs/src/CMakeLists.txt | 2 - .../src/Kconfig.projbuild | 9 - .../src/spiffs_example_main.c | 127 -------- examples/espidf-storage-spiffs/test/README | 11 - examples/espidf-ulp-adc/.gitignore | 1 - examples/espidf-ulp-adc/.travis.yml | 67 ----- examples/espidf-ulp-adc/include/README | 39 --- examples/espidf-ulp-adc/lib/README | 46 --- .../main/ulp_adc_example_main.c | 108 ------- examples/espidf-ulp-adc/test/README | 11 - examples/espidf-ulp-adc/ulp/adc.S | 120 -------- examples/espidf-ulp-adc/ulp/example_config.h | 16 - examples/espidf-ulp-pulse/.gitignore | 1 - examples/espidf-ulp-pulse/.travis.yml | 67 ----- examples/espidf-ulp-pulse/README.md | 27 -- examples/espidf-ulp-pulse/include/README | 39 --- examples/espidf-ulp-pulse/lib/README | 46 --- examples/espidf-ulp-pulse/test/README | 11 - examples/espidf-ulp-pulse/ulp/wake_up.S | 16 - .../CMakeLists.txt | 2 +- examples/espidf-ulp-riscv/README.md | 31 ++ examples/espidf-ulp-riscv/example_test.py | 48 +++ .../main/CMakeLists.txt | 24 +- .../main/ulp_riscv_example_main.c | 74 +++++ .../platformio.ini | 11 +- .../sdkconfig.defaults | 5 - .../sdkconfig.defaults.esp32s2 | 7 + .../sdkconfig.defaults.esp32s3 | 7 + examples/espidf-ulp-riscv/ulp/main.c | 41 +++ .../CMakeLists.txt | 2 +- examples/espidf-ulp/Makefile | 8 + examples/espidf-ulp/README.md | 57 ++++ examples/espidf-ulp/example_test.py | 45 +++ examples/espidf-ulp/image/ulp_power_graph.png | Bin 0 -> 39281 bytes .../src => espidf-ulp/main}/CMakeLists.txt | 4 +- .../main}/ulp_example_main.c | 19 +- .../platformio.ini | 15 +- .../sdkconfig.defaults | 0 examples/espidf-ulp/sdkconfig.defaults.esp32 | 3 + .../espidf-ulp/sdkconfig.defaults.esp32s2 | 3 + .../espidf-ulp/sdkconfig.defaults.esp32s3 | 3 + .../ulp/pulse_cnt.S | 0 examples/espidf-ulp/ulp/wake_up.S | 30 ++ 116 files changed, 1357 insertions(+), 1988 deletions(-) delete mode 100644 .github/stale.yml delete mode 100644 .github/workflows/tests.yml delete mode 100644 examples/arduino-ble5-advertising/README.md delete mode 100644 examples/arduino-ble5-advertising/platformio.ini delete mode 100644 examples/arduino-ble5-advertising/src/BLE5_periodic_advertising.ino delete mode 100644 examples/arduino-blink/.travis.yml create mode 100644 examples/arduino-rmt-blink/platformio.ini create mode 100644 examples/arduino-rmt-blink/src/RMTWriteNeoPixel.ino delete mode 100644 examples/arduino-wifiscan/.travis.yml delete mode 100644 examples/espidf-arduino-blink/.travis.yml create mode 100644 examples/espidf-arduino-littlefs/.gitignore create mode 100644 examples/espidf-arduino-littlefs/CMakeLists.txt create mode 100644 examples/espidf-arduino-littlefs/README.md create mode 100644 examples/espidf-arduino-littlefs/data/file1.txt create mode 100644 examples/espidf-arduino-littlefs/data/testfolder/test2.txt rename examples/{arduino-ble5-advertising => espidf-arduino-littlefs}/include/README (100%) rename examples/{arduino-ble5-advertising => espidf-arduino-littlefs}/lib/README (100%) create mode 100644 examples/espidf-arduino-littlefs/partitions_custom.csv create mode 100644 examples/espidf-arduino-littlefs/platformio.ini create mode 100644 examples/espidf-arduino-littlefs/sdkconfig.defaults create mode 100644 examples/espidf-arduino-littlefs/src/CMakeLists.txt create mode 100644 examples/espidf-arduino-littlefs/src/main.cpp delete mode 100644 examples/espidf-arduino-wifiscan/.travis.yml rename examples/{arduino-ble5-advertising => espidf-blink}/.gitignore (100%) rename examples/{espidf-ulp-pulse => espidf-blink}/CMakeLists.txt (74%) rename examples/{espidf-ulp-adc => espidf-blink}/README.md (91%) rename examples/{espidf-storage-spiffs => espidf-blink}/include/README (100%) create mode 100644 examples/espidf-blink/lib/README create mode 100644 examples/espidf-blink/platformio.ini create mode 100644 examples/espidf-blink/sdkconfig.defaults create mode 100644 examples/espidf-blink/src/CMakeLists.txt create mode 100644 examples/espidf-blink/src/blink.c rename examples/{arduino-ble5-advertising => espidf-blink}/test/README (100%) delete mode 100644 examples/espidf-coap-server/.travis.yml delete mode 100644 examples/espidf-exceptions/.travis.yml delete mode 100644 examples/espidf-hello-world/.travis.yml delete mode 100644 examples/espidf-hello-world/sdkconfig.defaults.esp32c6 delete mode 100644 examples/espidf-http-request/.travis.yml delete mode 100644 examples/espidf-peripherals-uart/.travis.yml delete mode 100644 examples/espidf-peripherals-usb/.travis.yml delete mode 100644 examples/espidf-storage-sdcard/.travis.yml delete mode 100644 examples/espidf-storage-spiffs/.gitignore delete mode 100644 examples/espidf-storage-spiffs/README.md delete mode 100644 examples/espidf-storage-spiffs/data/hello.txt delete mode 100644 examples/espidf-storage-spiffs/lib/README delete mode 100644 examples/espidf-storage-spiffs/partitions_example.csv delete mode 100644 examples/espidf-storage-spiffs/platformio.ini delete mode 100644 examples/espidf-storage-spiffs/sdkconfig.defaults delete mode 100644 examples/espidf-storage-spiffs/src/CMakeLists.txt delete mode 100644 examples/espidf-storage-spiffs/src/Kconfig.projbuild delete mode 100644 examples/espidf-storage-spiffs/src/spiffs_example_main.c delete mode 100644 examples/espidf-storage-spiffs/test/README delete mode 100644 examples/espidf-ulp-adc/.gitignore delete mode 100644 examples/espidf-ulp-adc/.travis.yml delete mode 100644 examples/espidf-ulp-adc/include/README delete mode 100644 examples/espidf-ulp-adc/lib/README delete mode 100644 examples/espidf-ulp-adc/main/ulp_adc_example_main.c delete mode 100644 examples/espidf-ulp-adc/test/README delete mode 100644 examples/espidf-ulp-adc/ulp/adc.S delete mode 100644 examples/espidf-ulp-adc/ulp/example_config.h delete mode 100644 examples/espidf-ulp-pulse/.gitignore delete mode 100644 examples/espidf-ulp-pulse/.travis.yml delete mode 100644 examples/espidf-ulp-pulse/README.md delete mode 100644 examples/espidf-ulp-pulse/include/README delete mode 100644 examples/espidf-ulp-pulse/lib/README delete mode 100644 examples/espidf-ulp-pulse/test/README delete mode 100644 examples/espidf-ulp-pulse/ulp/wake_up.S rename examples/{espidf-ulp-adc => espidf-ulp-riscv}/CMakeLists.txt (88%) create mode 100644 examples/espidf-ulp-riscv/README.md create mode 100644 examples/espidf-ulp-riscv/example_test.py rename examples/{espidf-ulp-adc => espidf-ulp-riscv}/main/CMakeLists.txt (52%) create mode 100644 examples/espidf-ulp-riscv/main/ulp_riscv_example_main.c rename examples/{espidf-ulp-adc => espidf-ulp-riscv}/platformio.ini (66%) rename examples/{espidf-ulp-pulse => espidf-ulp-riscv}/sdkconfig.defaults (53%) create mode 100644 examples/espidf-ulp-riscv/sdkconfig.defaults.esp32s2 create mode 100644 examples/espidf-ulp-riscv/sdkconfig.defaults.esp32s3 create mode 100644 examples/espidf-ulp-riscv/ulp/main.c rename examples/{espidf-storage-spiffs => espidf-ulp}/CMakeLists.txt (91%) create mode 100644 examples/espidf-ulp/Makefile create mode 100644 examples/espidf-ulp/README.md create mode 100644 examples/espidf-ulp/example_test.py create mode 100644 examples/espidf-ulp/image/ulp_power_graph.png rename examples/{espidf-ulp-pulse/src => espidf-ulp/main}/CMakeLists.txt (90%) mode change 100644 => 100755 rename examples/{espidf-ulp-pulse/src => espidf-ulp/main}/ulp_example_main.c (88%) mode change 100644 => 100755 rename examples/{espidf-ulp-pulse => espidf-ulp}/platformio.ini (59%) rename examples/{espidf-ulp-adc => espidf-ulp}/sdkconfig.defaults (100%) create mode 100644 examples/espidf-ulp/sdkconfig.defaults.esp32 create mode 100644 examples/espidf-ulp/sdkconfig.defaults.esp32s2 create mode 100644 examples/espidf-ulp/sdkconfig.defaults.esp32s3 rename examples/{espidf-ulp-pulse => espidf-ulp}/ulp/pulse_cnt.S (100%) mode change 100644 => 100755 create mode 100755 examples/espidf-ulp/ulp/wake_up.S diff --git a/.github/stale.yml b/.github/stale.yml deleted file mode 100644 index 4da62e844..000000000 --- a/.github/stale.yml +++ /dev/null @@ -1,21 +0,0 @@ -# Number of days of inactivity before an issue becomes stale -daysUntilStale: 30 -# Number of days of inactivity before a stale issue is closed -daysUntilClose: 7 -# Issues with these labels will never be considered stale -exemptLabels: - - bug - - known issue - - feature - - enhancement - - board request - - package update -# Label to use when marking an issue as stale -staleLabel: stale -# Comment to post when marking an issue as stale. Set to `false` to disable -markComment: > - This issue has been automatically marked as stale because it has not had - recent activity. Please provide more details or it will be closed if no - further activity occurs. Thank you for your contributions. -# Comment to post when closing a stale issue. Set to `false` to disable -closeComment: false diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 1e5c12efb..a9e035290 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -1,21 +1,26 @@ name: Examples -on: [push, pull_request] +on: + workflow_dispatch: # Manually start a workflow + push: + paths-ignore: + - '.github/**' # Ignore changes towards the .github directory + - '**.md' # Do no build if *.md files changes jobs: build: strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + os: [ubuntu-22.04, windows-2022, macos-14] example: - - "examples/arduino-ble5-advertising" - "examples/arduino-blink" + - "examples/arduino-rmt-blink" - "examples/arduino-usb-keyboard" - "examples/arduino-wifiscan" - "examples/espidf-arduino-blink" - - "examples/espidf-arduino-wifiscan" - - "examples/espidf-ble-eddystone" + - "examples/espidf-arduino-littlefs" + - "examples/espidf-blink" - "examples/espidf-coap-server" - "examples/espidf-exceptions" - "examples/espidf-hello-world" @@ -23,20 +28,21 @@ 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/espidf-ulp" + - "examples/espidf-ulp-riscv" runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: "recursive" - name: Set up Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: - python-version: "3.9" + python-version: "3.11" - name: Install dependencies run: | + python -m pip install --upgrade pip + pip install wheel pip install -U https://github.com/platformio/platformio/archive/develop.zip pio pkg install --global --platform symlink://. - name: Build examples diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index 446f8849c..000000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: "Unit Testing" - -on: [push, pull_request] - -jobs: - build: - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: [3.9] - example: - - "examples/espidf-hello-world" - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v2 - with: - submodules: "recursive" - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -U https://github.com/platformio/platformio/archive/develop.zip - pio pkg install --global --platform symlink://. - - name: Build test - run: | - pio test -d ${{ matrix.example }} --without-uploading --without-testing diff --git a/.gitignore b/.gitignore index 0d20b6487..0205d62f1 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.pyc +.DS_Store diff --git a/builder/frameworks/_embed_files.py b/builder/frameworks/_embed_files.py index c89dc4338..caa12c4c4 100644 --- a/builder/frameworks/_embed_files.py +++ b/builder/frameworks/_embed_files.py @@ -110,14 +110,14 @@ def transform_to_asm(target, source, env): " ".join( [ "riscv32-esp-elf-objcopy" - if mcu in ("esp32c3", "esp32c6") + if mcu in ("esp32c2","esp32c3","esp32c6","esp32h2") else "xtensa-%s-elf-objcopy" % mcu, "--input-target", "binary", "--output-target", - "elf32-littleriscv" if mcu in ("esp32c3","esp32c6") else "elf32-xtensa-le", + "elf32-littleriscv" if mcu in ("esp32c2","esp32c3","esp32c6","esp32h2") else "elf32-xtensa-le", "--binary-architecture", - "riscv" if mcu in ("esp32c3","esp32c6") else "xtensa", + "riscv" if mcu in ("esp32c2","esp32c3","esp32c6","esp32h2") else "xtensa", "--rename-section", ".data=.rodata.embedded", "$SOURCE", diff --git a/builder/frameworks/arduino.py b/builder/frameworks/arduino.py index 537f4b292..4af76df8b 100644 --- a/builder/frameworks/arduino.py +++ b/builder/frameworks/arduino.py @@ -36,4 +36,3 @@ SConscript( join(DefaultEnvironment().PioPlatform().get_package_dir( "framework-arduinoespressif32"), "tools", "platformio-build.py")) - env["INTEGRATION_EXTRA_DATA"].update({"application_offset": env.subst("$ESP32_APP_OFFSET")}) diff --git a/builder/frameworks/espidf.py b/builder/frameworks/espidf.py index 3b9850039..f6ef68b43 100644 --- a/builder/frameworks/espidf.py +++ b/builder/frameworks/espidf.py @@ -67,15 +67,7 @@ IDF_ENV_VERSION = "1.0.0" FRAMEWORK_DIR = platform.get_package_dir("framework-espidf") TOOLCHAIN_DIR = platform.get_package_dir( - "toolchain-riscv32-esp" - if mcu in ("esp32c3", "esp32c6") - else ( - ( - "toolchain-xtensa-esp-elf" - if "arduino" not in env.subst("$PIOFRAMEWORK") - else "toolchain-xtensa-%s" % mcu - ) - ) + "toolchain-%s" % ("riscv32-esp" if mcu in ("esp32c2", "esp32c3", "esp32c6", "esp32h2") else ("xtensa-%s" % mcu)) ) @@ -256,7 +248,7 @@ def populate_idf_env_vars(idf_env): os.path.dirname(get_python_exe()), ] - if mcu not in ("esp32c3", "esp32c6"): + if mcu not in ("esp32c2", "esp32c3", "esp32c6","esp32h2"): additional_packages.append( os.path.join(platform.get_package_dir("toolchain-esp32ulp"), "bin"), ) @@ -511,7 +503,7 @@ def extract_linker_script_fragments_backup(framework_components_dir, sdk_config) sys.stderr.write("Error: Failed to extract paths to linker script fragments\n") env.Exit(1) - if mcu in ("esp32c3", "esp32c6"): + if mcu in ("esp32c2", "esp32c3", "esp32c6", "esp32h2"): result.append(os.path.join(framework_components_dir, "riscv", "linker.lf")) # Add extra linker fragments @@ -1201,6 +1193,7 @@ def _get_installed_pip_packages(python_exe_path): return deps = { + "wheel": ">=0.35.1", # https://github.com/platformio/platformio-core/issues/4614 "urllib3": "<2", # https://github.com/platformio/platform-espressif32/issues/635 @@ -1606,7 +1599,7 @@ def _skip_prj_source_files(node): ( board.get( "upload.bootloader_offset", - "0x0" if mcu in ("esp32c3", "esp32c6", "esp32s3") else "0x1000", + "0x0" if mcu in ("esp32c2", "esp32c3", "esp32c6", "esp32s3", "esp32h2") else "0x1000", ), os.path.join("$BUILD_DIR", "bootloader.bin"), ), @@ -1717,7 +1710,7 @@ def _skip_prj_source_files(node): # ulp_dir = os.path.join(PROJECT_DIR, "ulp") -if os.path.isdir(ulp_dir) and os.listdir(ulp_dir) and mcu not in ("esp32c3", "esp32c6"): +if os.path.isdir(ulp_dir) and os.listdir(ulp_dir) and mcu not in ("esp32c2", "esp32c3", "esp32c6", "esp32h2"): env.SConscript("ulp.py", exports="env sdk_config project_config idf_variant") # diff --git a/builder/frameworks/ulp.py b/builder/frameworks/ulp.py index 1a66c2bc9..8cc922179 100644 --- a/builder/frameworks/ulp.py +++ b/builder/frameworks/ulp.py @@ -34,14 +34,11 @@ def prepare_ulp_env_vars(env): ulp_env.PrependENVPath("IDF_PATH", FRAMEWORK_DIR) - toolchain_path = platform.get_package_dir( - "toolchain-xtensa-esp-elf" - if "arduino" not in env.subst("$PIOFRAMEWORK") - else "toolchain-xtensa-%s" % idf_variant - ) - additional_packages = [ - toolchain_path, + os.path.join( + platform.get_package_dir("toolchain-xtensa-%s" % idf_variant), + "bin", + ), os.path.join( platform.get_package_dir("toolchain-esp32ulp"), "bin", diff --git a/builder/main.py b/builder/main.py index 98ae15526..91aa97eea 100644 --- a/builder/main.py +++ b/builder/main.py @@ -22,10 +22,14 @@ from platformio.util import get_serial_ports +env = DefaultEnvironment() +platform = env.PioPlatform() + # # Helpers # +FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoespressif32") def BeforeUpload(target, source, env): upload_options = {} @@ -58,7 +62,6 @@ def _get_board_memory_type(env): ), ) - def _normalize_frequency(frequency): frequency = str(frequency).replace("L", "") return str(int(int(frequency) / 1000000)) + "m" @@ -76,7 +79,6 @@ def _get_board_f_image(env): return _get_board_f_flash(env) - def _get_board_f_boot(env): board_config = env.BoardConfig() if "build.f_boot" in board_config: @@ -86,7 +88,7 @@ def _get_board_f_boot(env): def _get_board_flash_mode(env): - if ["arduino"] == env.get("PIOFRAMEWORK") and _get_board_memory_type(env) in ( + if _get_board_memory_type(env) in ( "opi_opi", "opi_qspi", ): @@ -101,7 +103,7 @@ def _get_board_flash_mode(env): def _get_board_boot_mode(env): memory_type = env.BoardConfig().get("build.arduino.memory_type", "") build_boot = env.BoardConfig().get("build.boot", "$BOARD_FLASH_MODE") - if ["arduino"] == env.get("PIOFRAMEWORK") and memory_type in ("opi_opi", "opi_qspi"): + if memory_type in ("opi_opi", "opi_qspi"): build_boot = "opi" return build_boot @@ -128,9 +130,8 @@ def _parse_partitions(env): return result = [] - # The first offset is 0x9000 because partition table is flashed to 0x8000 and - # occupies an entire flash sector, which size is 0x1000 - next_offset = 0x9000 + next_offset = 0 + bound = int(board.get("upload.offset_address", "0x10000"), 16) # default 0x10000 with open(partitions_csv) as fp: for line in fp.readlines(): line = line.strip() @@ -139,22 +140,23 @@ def _parse_partitions(env): tokens = [t.strip() for t in line.split(",")] if len(tokens) < 5: continue - - bound = 0x10000 if tokens[1] in ("0", "app") else 4 - calculated_offset = (next_offset + bound - 1) & ~(bound - 1) partition = { "name": tokens[0], "type": tokens[1], "subtype": tokens[2], - "offset": tokens[3] or calculated_offset, + "offset": tokens[3] or next_offset, "size": tokens[4], "flags": tokens[5] if len(tokens) > 5 else None } result.append(partition) - next_offset = _parse_size(partition["offset"]) + _parse_size( - partition["size"] - ) - + next_offset = _parse_size(partition["offset"]) + if (partition["subtype"] == "ota_0"): + bound = next_offset + next_offset = (next_offset + bound - 1) & ~(bound - 1) + # Configure application partition offset + env.Replace(ESP32_APP_OFFSET=str(hex(bound))) + # Propagate application offset to debug configurations + env["INTEGRATION_EXTRA_DATA"].update({"application_offset": str(hex(bound))}) return result @@ -181,17 +183,13 @@ def _update_max_upload_size(env): "table! Default partition will be used!" % custom_app_partition_name ) - # Otherwise, one of the `factory` or `ota_0` partitions is used to determine - # available memory size. If both partitions are set, we should prefer the `factory`, - # but there are cases (e.g. Adafruit's `partitions-4MB-tinyuf2.csv`) that uses the - # `factory` partition for their UF2 bootloader. So let's use the first match - # https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/partition-tables.html#subtype for p in partitions.values(): - if p["type"] in ("0", "app") and p["subtype"] in ("factory", "ota_0"): + if p["type"] in ("0", "app") and p["subtype"] in ("ota_0"): board.update("upload.maximum_size", _parse_size(p["size"])) break + def _to_unix_slashes(path): return path.replace("\\", "/") @@ -230,13 +228,11 @@ def __fetch_fs_size(target, source, env): return (target, source) -env = DefaultEnvironment() -platform = env.PioPlatform() board = env.BoardConfig() mcu = board.get("build.mcu", "esp32") toolchain_arch = "xtensa-%s" % mcu filesystem = board.get("build.filesystem", "spiffs") -if mcu in ("esp32c3", "esp32c6"): +if mcu in ("esp32c2", "esp32c3", "esp32c6", "esp32h2"): toolchain_arch = "riscv32-esp" if "INTEGRATION_EXTRA_DATA" not in env: @@ -257,15 +253,14 @@ def __fetch_fs_size(target, source, env): GDB=join( platform.get_package_dir( "tool-riscv32-esp-elf-gdb" - if mcu in ("esp32c3", "esp32c6") + if mcu in ("esp32c2", "esp32c3", "esp32c6") else "tool-xtensa-esp-elf-gdb" ) or "", "bin", "%s-elf-gdb" % toolchain_arch, - ) if env.get("PIOFRAMEWORK") == ["espidf"] else "%s-elf-gdb" % toolchain_arch, - OBJCOPY=join( - platform.get_package_dir("tool-esptoolpy") or "", "esptool.py"), + ), + OBJCOPY=join(platform.get_package_dir("tool-esptoolpy") or "", "esptool.py"), RANLIB="%s-elf-gcc-ranlib" % toolchain_arch, SIZETOOL="%s-elf-size" % toolchain_arch, @@ -302,7 +297,7 @@ def __fetch_fs_size(target, source, env): "ESP32_FS_IMAGE_NAME", env.get("ESP32_SPIFFS_IMAGE_NAME", filesystem) ), - ESP32_APP_OFFSET=board.get("upload.offset_address", "0x10000"), + ESP32_APP_OFFSET=env.get("INTEGRATION_EXTRA_DATA").get("application_offset"), PROGSUFFIX=".elf" ) @@ -315,7 +310,7 @@ def __fetch_fs_size(target, source, env): BUILDERS=dict( ElfToBin=Builder( action=env.VerboseAction(" ".join([ - '"$PYTHONEXE" "$OBJCOPY"', + '"$PYTHONEXE" "$OBJCOPY"', "--chip", mcu, "elf2image", "--flash_mode", "${__get_board_flash_mode(__env__)}", "--flash_freq", "${__get_board_f_image(__env__)}", @@ -335,7 +330,7 @@ def __fetch_fs_size(target, source, env): "-b", "$FS_BLOCK", ] - if filesystem in ("spiffs", "littlefs") + if filesystem in ("littlefs", "spiffs") else [] ) + ["$TARGET"] @@ -388,9 +383,6 @@ def __fetch_fs_size(target, source, env): env.VerboseAction( lambda source, target, env: _update_max_upload_size(env), "Retrieving maximum program size $SOURCES")) -# remove after PIO Core 3.6 release -elif set(["checkprogsize", "upload"]) & set(COMMAND_LINE_TARGETS): - _update_max_upload_size(env) # # Target: Print binary size @@ -432,9 +424,7 @@ def __fetch_fs_size(target, source, env): "See https://docs.platformio.org/page/platforms/" "espressif32.html#over-the-air-ota-update\n") env.Replace( - UPLOADER=join( - platform.get_package_dir("framework-arduinoespressif32") or "", - "tools", "espota.py"), + UPLOADER=join(FRAMEWORK_DIR,"tools", "espota.py"), UPLOADERFLAGS=["--debug", "--progress", "-i", "$UPLOAD_PORT"], UPLOADCMD='"$PYTHONEXE" "$UPLOADER" $UPLOADERFLAGS -f $SOURCE' ) @@ -455,7 +445,7 @@ def __fetch_fs_size(target, source, env): "write_flash", "-z", "--flash_mode", "${__get_board_flash_mode(__env__)}", "--flash_freq", "${__get_board_f_image(__env__)}", - "--flash_size", board.get("upload.flash_size", "detect") + "--flash_size", "detect" ], UPLOADCMD='"$PYTHONEXE" "$UPLOADER" $UPLOADERFLAGS $ESP32_APP_OFFSET $SOURCE' ) @@ -473,7 +463,7 @@ def __fetch_fs_size(target, source, env): "write_flash", "-z", "--flash_mode", "${__get_board_flash_mode(__env__)}", "--flash_freq", "${__get_board_f_image(__env__)}", - "--flash_size", board.get("upload.flash_size", "detect"), + "--flash_size", "detect", "$FS_START" ], UPLOADCMD='"$PYTHONEXE" "$UPLOADER" $UPLOADERFLAGS $SOURCE', @@ -484,7 +474,6 @@ def __fetch_fs_size(target, source, env): env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE") ] - elif upload_protocol == "dfu": hwids = board.get("build.hwids", [["0x2341", "0x0070"]]) @@ -508,6 +497,7 @@ def __fetch_fs_size(target, source, env): elif upload_protocol in debug_tools: + _parse_partitions(env) 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", [])) @@ -520,9 +510,7 @@ def __fetch_fs_size(target, source, env): % ( "$FS_START" if "uploadfs" in COMMAND_LINE_TARGETS - else board.get( - "upload.offset_address", "$ESP32_APP_OFFSET" - ) + else env.get("INTEGRATION_EXTRA_DATA").get("application_offset") ), ] ) @@ -562,6 +550,21 @@ def __fetch_fs_size(target, source, env): env.AddPlatformTarget( "uploadfsota", target_firm, upload_actions, "Upload Filesystem Image OTA") +# +# Target: Erase Flash and Upload +# + +env.AddPlatformTarget( + "erase_upload", + target_firm, + [ + env.VerboseAction(BeforeUpload, "Looking for upload port..."), + env.VerboseAction("$ERASECMD", "Erasing..."), + env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE") + ], + "Erase Flash and Upload", +) + # # Target: Erase Flash # @@ -570,20 +573,12 @@ def __fetch_fs_size(target, source, env): "erase", None, [ - env.VerboseAction(env.AutodetectUploadPort, "Looking for serial port..."), + env.VerboseAction(BeforeUpload, "Looking for upload port..."), env.VerboseAction("$ERASECMD", "Erasing...") ], "Erase Flash", ) -# -# Information about obsolete method of specifying linker scripts -# - -if any("-Wl,-T" in f for f in env.get("LINKFLAGS", [])): - print("Warning! '-Wl,-T' option for specifying linker scripts is deprecated. " - "Please use 'board_build.ldscript' option in your 'platformio.ini' file.") - # # Override memory inspection behavior # diff --git a/examples/arduino-ble5-advertising/README.md b/examples/arduino-ble5-advertising/README.md deleted file mode 100644 index f34cc0db8..000000000 --- a/examples/arduino-ble5-advertising/README.md +++ /dev/null @@ -1,27 +0,0 @@ -How to build PlatformIO based project -===================================== - -1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) -2. Download [development platform with examples](https://github.com/platformio/platform-espressif32/archive/develop.zip) -3. Extract ZIP archive -4. Run these commands: - -```shell -# Change directory to example -$ cd platform-espressif32/examples/arduino-ble5-advertising - -# Build project -$ pio run - -# Upload firmware -$ pio run --target upload - -# Build specific environment -$ pio run -e esp32-c3-devkitm-1 - -# Upload firmware for the specific environment -$ pio run -e esp32-c3-devkitm-1 --target upload - -# Clean build files -$ pio run --target clean -``` \ No newline at end of file diff --git a/examples/arduino-ble5-advertising/platformio.ini b/examples/arduino-ble5-advertising/platformio.ini deleted file mode 100644 index 638c205b6..000000000 --- a/examples/arduino-ble5-advertising/platformio.ini +++ /dev/null @@ -1,14 +0,0 @@ -; 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 -; https://docs.platformio.org/page/projectconf.html - -[env:esp32-c3-devkitm-1] -platform = espressif32 -board = esp32-c3-devkitm-1 -framework = arduino -monitor_speed = 115200 diff --git a/examples/arduino-ble5-advertising/src/BLE5_periodic_advertising.ino b/examples/arduino-ble5-advertising/src/BLE5_periodic_advertising.ino deleted file mode 100644 index 1b36bbb8b..000000000 --- a/examples/arduino-ble5-advertising/src/BLE5_periodic_advertising.ino +++ /dev/null @@ -1,72 +0,0 @@ -/* - Simple BLE5 multi advertising example on esp32 C3/S3 - only ESP_BLE_GAP_SET_EXT_ADV_PROP_NONCONN_NONSCANNABLE_UNDIRECTED can be used for periodic advertising - - author: chegewara -*/ - -#include -#include - - -esp_ble_gap_ext_adv_params_t ext_adv_params_2M = { - .type = ESP_BLE_GAP_SET_EXT_ADV_PROP_NONCONN_NONSCANNABLE_UNDIRECTED, - .interval_min = 0x40, - .interval_max = 0x40, - .channel_map = ADV_CHNL_ALL, - .own_addr_type = BLE_ADDR_TYPE_RANDOM, - .filter_policy = ADV_FILTER_ALLOW_SCAN_ANY_CON_ANY, - .primary_phy = ESP_BLE_GAP_PHY_1M, - .max_skip = 0, - .secondary_phy = ESP_BLE_GAP_PHY_2M, - .sid = 1, - .scan_req_notif = false, -}; - -static uint8_t raw_scan_rsp_data_2m[] = { - 0x02, 0x01, 0x06, - 0x02, 0x0a, 0xeb, - 0x12, 0x09, 'E', 'S', 'P', '_', 'M', 'U', 'L', 'T', 'I', '_', 'A', - 'D', 'V', '_', '2', 'M', 0X0 -}; - -static esp_ble_gap_periodic_adv_params_t periodic_adv_params = { - .interval_min = 0x320, // 1000 ms interval - .interval_max = 0x640, - .properties = 0, // Do not include TX power -}; - -static uint8_t periodic_adv_raw_data[] = { - 0x02, 0x01, 0x06, - 0x02, 0x0a, 0xeb, - 0x03, 0x03, 0xab, 0xcd, - 0x11, 0x09, 'E', 'S', 'P', '_', 'P', 'E', 'R', 'I', 'O', 'D', 'I', - 'C', '_', 'A', 'D', 'V' -}; - - -uint8_t addr_2m[6] = {0xc0, 0xde, 0x52, 0x00, 0x00, 0x02}; - -BLEMultiAdvertising advert(1); // max number of advertisement data - -void setup() { - Serial.begin(115200); - Serial.println("Multi-Advertising..."); - - BLEDevice::init(""); - - advert.setAdvertisingParams(0, &ext_adv_params_2M); - advert.setAdvertisingData(0, sizeof(raw_scan_rsp_data_2m), &raw_scan_rsp_data_2m[0]); - advert.setInstanceAddress(0, addr_2m); - advert.setDuration(0, 0, 0); - - delay(100); - advert.start(); - advert.setPeriodicAdvertisingParams(0, &periodic_adv_params); - advert.setPeriodicAdvertisingData(0, sizeof(periodic_adv_raw_data), &periodic_adv_raw_data[0]); - advert.startPeriodicAdvertising(0); -} - -void loop() { - delay(2000); -} diff --git a/examples/arduino-blink/.travis.yml b/examples/arduino-blink/.travis.yml deleted file mode 100644 index 7c486f183..000000000 --- a/examples/arduino-blink/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# 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/arduino-blink/README.md b/examples/arduino-blink/README.md index 8f42ed5c7..1573f15cd 100644 --- a/examples/arduino-blink/README.md +++ b/examples/arduino-blink/README.md @@ -1,7 +1,7 @@ How to build PlatformIO based project ===================================== -1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) +1. [Install PlatformIO Core](http://docs.platformio.org/page/core.html) 2. Download [development platform with examples](https://github.com/platformio/platform-espressif32/archive/develop.zip) 3. Extract ZIP archive 4. Run these commands: diff --git a/examples/arduino-blink/platformio.ini b/examples/arduino-blink/platformio.ini index fa67ab603..03eaf2cbd 100644 --- a/examples/arduino-blink/platformio.ini +++ b/examples/arduino-blink/platformio.ini @@ -5,7 +5,7 @@ ; Library options: dependencies, extra library storages ; ; Please visit documentation for the other options and examples -; https://docs.platformio.org/page/projectconf.html +; http://docs.platformio.org/page/projectconf.html [env:esp-wrover-kit] platform = espressif32 @@ -13,39 +13,16 @@ framework = arduino board = esp-wrover-kit monitor_speed = 115200 build_flags = - ; https://docs.espressif.com/projects/esp-idf/en/latest/get-started/get-started-wrover-kit.html#rgb-led - -D LED_BUILTIN=2 - -[env:esp32doit-devkit-v1] -platform = espressif32 -framework = arduino -board = esp32doit-devkit-v1 -monitor_speed = 115200 - -[env:lolin32] + -DLED_BUILTIN=2 + +[env:esp32-c6-devkitc-1] platform = espressif32 framework = arduino -board = lolin32 +board = esp32-c6-devkitc-1 monitor_speed = 115200 -[env:lolin_c3_mini] +[env:esp32-h2-devkitm-1] platform = espressif32 framework = arduino -board = lolin_c3_mini +board = esp32-h2-devkitm-1 monitor_speed = 115200 - -[env:esp32-s3-devkitc-1] -platform = espressif32 -framework = arduino -board = esp32-s3-devkitc-1 -monitor_speed = 115200 - -[env:arduino_nano_esp32] -platform = espressif32 -framework = arduino -board = arduino_nano_esp32 - -[env:adafruit_qtpy_esp32s3_n4r2] -platform = espressif32 -board = adafruit_qtpy_esp32s3_n4r2 -framework = arduino diff --git a/examples/arduino-blink/src/Blink.cpp b/examples/arduino-blink/src/Blink.cpp index 5981d69d3..1b1c30f8d 100644 --- a/examples/arduino-blink/src/Blink.cpp +++ b/examples/arduino-blink/src/Blink.cpp @@ -7,9 +7,7 @@ #include // Set LED_BUILTIN if it is not defined by Arduino framework -#ifndef LED_BUILTIN - #define LED_BUILTIN 2 -#endif +// #define LED_BUILTIN 2 void setup() { diff --git a/examples/arduino-rmt-blink/platformio.ini b/examples/arduino-rmt-blink/platformio.ini new file mode 100644 index 000000000..e3c6beacd --- /dev/null +++ b/examples/arduino-rmt-blink/platformio.ini @@ -0,0 +1,27 @@ +[env:esp32-s2] +platform = espressif32 +framework = arduino +board = esp32-s2-saola-1 +build_flags = -DBUILTIN_RGBLED_PIN=18 + -DNR_OF_LEDS=1 + +[env:esp32-s3] +platform = espressif32 +framework = arduino +board = esp32-s3-devkitc-1 +build_flags = -DBUILTIN_RGBLED_PIN=48 + -DNR_OF_LEDS=1 + +[env:esp32-c3] +platform = espressif32 +framework = arduino +board = esp32-c3-devkitm-1 +build_flags = -DBUILTIN_RGBLED_PIN=8 + -DNR_OF_LEDS=1 + +[env:esp32-c6] +platform = espressif32 +framework = arduino +board = esp32-c6-devkitm-1 +build_flags = -DBUILTIN_RGBLED_PIN=8 + -DNR_OF_LEDS=1 diff --git a/examples/arduino-rmt-blink/src/RMTWriteNeoPixel.ino b/examples/arduino-rmt-blink/src/RMTWriteNeoPixel.ino new file mode 100644 index 000000000..dbc183884 --- /dev/null +++ b/examples/arduino-rmt-blink/src/RMTWriteNeoPixel.ino @@ -0,0 +1,103 @@ +// Copyright 2023 Espressif Systems (Shanghai) PTE LTD +// +// 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. + +/** + * @brief This example demonstrates usage of RGB LED driven by RMT + * + * The output is a visual WS2812 RGB LED color moving in a 8 x 4 LED matrix + * Parameters can be changed by the user. In a single LED circuit, it will just blink. + */ + +// The effect seen in ESP32C3, ESP32S2 and ESP32S3 is like a Blink of RGB LED +//#if CONFIG_IDF_TARGET_ESP32S2 +//#define BUILTIN_RGBLED_PIN 18 +//#elif CONFIG_IDF_TARGET_ESP32S3 +//#define BUILTIN_RGBLED_PIN 48 // 48 or 38 +//#elif CONFIG_IDF_TARGET_ESP32C3 +//#define BUILTIN_RGBLED_PIN 8 +//#else +//#define BUILTIN_RGBLED_PIN 21 // ESP32 has no builtin RGB LED +//#endif + +//#define NR_OF_LEDS 8*4 +#define NR_OF_ALL_BITS 24*NR_OF_LEDS + +// +// Note: This example uses Neopixel LED board, 32 LEDs chained one +// after another, each RGB LED has its 24 bit value +// for color configuration (8b for each color) +// +// Bits encoded as pulses as follows: +// +// "0": +// +-------+ +-- +// | | | +// | | | +// | | | +// ---| |--------------| +// + + + +// | 0.4us | 0.85 0us | +// +// "1": +// +-------------+ +-- +// | | | +// | | | +// | | | +// | | | +// ---+ +-------+ +// | 0.8us | 0.4us | + +rmt_data_t led_data[NR_OF_ALL_BITS]; + +void setup() { + Serial.begin(115200); + if (!rmtInit(BUILTIN_RGBLED_PIN, RMT_TX_MODE, RMT_MEM_NUM_BLOCKS_1, 10000000)) { + Serial.println("init sender failed\n"); + } + Serial.println("real tick set to: 100ns"); +} + +int color[] = { 0x55, 0x11, 0x77 }; // Green Red Blue values +int led_index = 0; + +void loop() { + // Init data with only one led ON + int led, col, bit; + int i=0; + for (led=0; led=NR_OF_LEDS) { + led_index = 0; + } + // Send the data and wait until it is done + rmtWrite(BUILTIN_RGBLED_PIN, led_data, NR_OF_ALL_BITS, RMT_WAIT_FOR_EVER); + delay(100); +} diff --git a/examples/arduino-usb-keyboard/platformio.ini b/examples/arduino-usb-keyboard/platformio.ini index 3f51b8378..434e1a6f3 100644 --- a/examples/arduino-usb-keyboard/platformio.ini +++ b/examples/arduino-usb-keyboard/platformio.ini @@ -14,6 +14,3 @@ monitor_speed = 115200 [env:esp32-s2-saola-1] board = esp32-s2-saola-1 - -[env:esp32-s2-kaluga-1] -board = esp32-s2-kaluga-1 \ No newline at end of file diff --git a/examples/arduino-wifiscan/.travis.yml b/examples/arduino-wifiscan/.travis.yml deleted file mode 100644 index 7c486f183..000000000 --- a/examples/arduino-wifiscan/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# 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/arduino-wifiscan/README.md b/examples/arduino-wifiscan/README.md index 35564a6b9..785231de3 100644 --- a/examples/arduino-wifiscan/README.md +++ b/examples/arduino-wifiscan/README.md @@ -1,7 +1,7 @@ How to build PlatformIO based project ===================================== -1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) +1. [Install PlatformIO Core](http://docs.platformio.org/page/core.html) 2. Download [development platform with examples](https://github.com/platformio/platform-espressif32/archive/develop.zip) 3. Extract ZIP archive 4. Run these commands: diff --git a/examples/arduino-wifiscan/platformio.ini b/examples/arduino-wifiscan/platformio.ini index 2b88d2a7d..38cd6b894 100644 --- a/examples/arduino-wifiscan/platformio.ini +++ b/examples/arduino-wifiscan/platformio.ini @@ -5,28 +5,10 @@ ; Library options: dependencies, extra library storages ; ; Please visit documentation for the other options and examples -; https://docs.platformio.org/page/projectconf.html - -[env:esp32dev] -platform = espressif32 -framework = arduino -board = esp32dev -monitor_speed = 115200 +; http://docs.platformio.org/page/projectconf.html [env:esp-wrover-kit] platform = espressif32 framework = arduino board = esp-wrover-kit monitor_speed = 115200 - -[env:espea32] -platform = espressif32 -framework = arduino -board = espea32 -monitor_speed = 115200 - -[env:esp320] -platform = espressif32 -framework = arduino -board = esp320 -monitor_speed = 115200 diff --git a/examples/espidf-arduino-blink/.travis.yml b/examples/espidf-arduino-blink/.travis.yml deleted file mode 100644 index 7c486f183..000000000 --- a/examples/espidf-arduino-blink/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# 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-arduino-blink/CMakeLists.txt b/examples/espidf-arduino-blink/CMakeLists.txt index 650d1b97d..6d4f2430b 100644 --- a/examples/espidf-arduino-blink/CMakeLists.txt +++ b/examples/espidf-arduino-blink/CMakeLists.txt @@ -1,3 +1,3 @@ cmake_minimum_required(VERSION 3.16.0) include($ENV{IDF_PATH}/tools/cmake/project.cmake) -project(espidf-arduino-wifiscan) +project(espidf-arduino-blink) diff --git a/examples/espidf-arduino-blink/platformio.ini b/examples/espidf-arduino-blink/platformio.ini index b92c49577..0399901d7 100644 --- a/examples/espidf-arduino-blink/platformio.ini +++ b/examples/espidf-arduino-blink/platformio.ini @@ -11,14 +11,19 @@ platform = espressif32 framework = arduino, espidf build_flags = - -D CONFIG_BLINK_GPIO=2 + -DCONFIG_BLINK_GPIO=2 monitor_speed = 115200 +board_build.embed_txtfiles = + managed_components/espressif__esp_insights/server_certs/https_server.crt + managed_components/espressif__esp_rainmaker/server_certs/rmaker_mqtt_server.crt + managed_components/espressif__esp_rainmaker/server_certs/rmaker_claim_service_server.crt + managed_components/espressif__esp_rainmaker/server_certs/rmaker_ota_server.crt -[env:esp32dev] -board = esp32dev - -[env:espea32] -board = espea32 +[env:esp32-s3] +board = 4d_systems_esp32s3_gen4_r8n16 +build_flags = + -DCONFIG_BLINK_GPIO=2 + -DARDUINO_PARTITION_esp_sr_16 -[env:esp320] -board = esp320 +[env:esp32-c6-devkitm-1] +board = esp32-c6-devkitm-1 diff --git a/examples/espidf-arduino-blink/sdkconfig.defaults b/examples/espidf-arduino-blink/sdkconfig.defaults index 1af06b975..54ef4be5d 100644 --- a/examples/espidf-arduino-blink/sdkconfig.defaults +++ b/examples/espidf-arduino-blink/sdkconfig.defaults @@ -1,5 +1,157 @@ +CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y + +# +# SPI RAM config +# +CONFIG_SPIRAM_MODE_OCT=y +CONFIG_SPIRAM_TYPE_AUTO=y +CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY=y +CONFIG_SPIRAM_SPEED_80M=y +CONFIG_SPIRAM_SPEED=80 +CONFIG_SPIRAM_USE_MALLOC=y +CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=4096 +CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y +CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=0 + CONFIG_AUTOSTART_ARDUINO=y # CONFIG_WS2812_LED_ENABLE is not set +CONFIG_ARDUHAL_ESP_LOG=y +CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y +CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP=y +CONFIG_BT_BLE_BLUFI_ENABLE=y +CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y +CONFIG_BT_BTC_TASK_STACK_SIZE=8192 +CONFIG_BT_BTU_TASK_STACK_SIZE=8192 +CONFIG_BLE_MESH=y +CONFIG_COMPILER_OPTIMIZATION_SIZE=y +CONFIG_COMPILER_CXX_EXCEPTIONS=y +CONFIG_COMPILER_STACK_CHECK_MODE_NORM=y +CONFIG_COMPILER_WARN_WRITE_STRINGS=y +CONFIG_ESP_HTTPS_SERVER_ENABLE=y +CONFIG_ESP_HTTP_CLIENT_ENABLE_BASIC_AUTH=y +CONFIG_ESP_INT_WDT_TIMEOUT_MS=300 +CONFIG_ESP_IPC_TASK_STACK_SIZE=1024 +CONFIG_ESP_MAIN_TASK_STACK_SIZE=4096 +CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2048 +CONFIG_ESP_TASK_WDT_PANIC=y +CONFIG_ESP_TIMER_TASK_STACK_SIZE=4096 +CONFIG_ESP_WIFI_FTM_ENABLE=y +CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=8 +CONFIG_ESP_WIFI_STATIC_TX_BUFFER_NUM=8 +CONFIG_ESP_WIFI_CACHE_TX_BUFFER_NUM=16 +CONFIG_ESP_WIFI_CSI_ENABLED=y +CONFIG_ESP_WIFI_ENABLE_WPA3_SAE=y +# CONFIG_ESP_WIFI_IRAM_OPT is not set +# CONFIG_ESP_WIFI_RX_IRAM_OPT is not set +CONFIG_ETH_SPI_ETHERNET_DM9051=y +CONFIG_ETH_SPI_ETHERNET_W5500=y +CONFIG_ETH_SPI_ETHERNET_KSZ8851SNL=y +CONFIG_FATFS_CODEPAGE_850=y +CONFIG_FATFS_LFN_STACK=y +# CONFIG_FATFS_API_ENCODING_ANSI_OEM is not set +CONFIG_FATFS_API_ENCODING_UTF_8=y +CONFIG_FATFS_USE_LABEL=y +# CONFIG_FMB_CONTROLLER_SLAVE_ID_SUPPORT is not set +CONFIG_FMB_TIMER_PORT_ENABLED=y CONFIG_FREERTOS_HZ=1000 +CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY=y +# CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION is not set +CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1024 +CONFIG_HEAP_POISONING_LIGHT=y +CONFIG_HTTPD_MAX_REQ_HDR_LEN=1024 +CONFIG_HTTPD_WS_SUPPORT=y +# CONFIG_LOG_COLORS is not set +CONFIG_LWIP_ETHARP_TRUST_IP_MAC=y +# CONFIG_LWIP_DHCP_DOES_ARP_CHECK is not set +CONFIG_LWIP_TCP_SYNMAXRTX=6 +CONFIG_LWIP_TCP_MSS=1436 +CONFIG_LWIP_TCP_RTO_TIME=3000 +CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=4096 +CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU0=y +CONFIG_LWIP_MAX_SOCKETS=16 +CONFIG_LWIP_IP_FORWARD=y +CONFIG_LWIP_IPV4_NAPT=y +CONFIG_LWIP_DHCP_RESTORE_LAST_IP=n +CONFIG_LWIP_DHCP_OPTIONS_LEN=128 +CONFIG_LWIP_SNTP_MAX_SERVERS=3 +CONFIG_LWIP_SNTP_UPDATE_DELAY=10800000 +CONFIG_LWIP_DHCP_GET_NTP_SRV=y +CONFIG_LWIP_IPV6_AUTOCONFIG=y +CONFIG_LWIP_IPV6_DHCP6=y +CONFIG_LWIP_IPV6_RDNSS_MAX_DNS_SERVERS=2 +CONFIG_LWIP_PPP_SUPPORT=y +CONFIG_LWIP_PPP_NOTIFY_PHASE_SUPPORT=y +CONFIG_LWIP_PPP_PAP_SUPPORT=y +CONFIG_LWIP_PPP_ENABLE_IPV6=n CONFIG_MBEDTLS_PSK_MODES=y CONFIG_MBEDTLS_KEY_EXCHANGE_PSK=y +CONFIG_MBEDTLS_CAMELLIA_C=y +# CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN is not set +CONFIG_MBEDTLS_SSL_PROTO_DTLS=y +CONFIG_OPENSSL_ASSERT_DO_NOTHING=y +CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=2048 +CONFIG_SPI_FLASH_YIELD_DURING_ERASE=y +CONFIG_SPI_FLASH_ERASE_YIELD_DURATION_MS=10 +CONFIG_SPI_FLASH_ERASE_YIELD_TICKS=2 +CONFIG_SPI_FLASH_WRITE_CHUNK_SIZE=4096 +# CONFIG_SPI_MASTER_ISR_IN_IRAM is not set +# CONFIG_SPI_SLAVE_ISR_IN_IRAM is not set +CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=4096 +CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=0 +CONFIG_ESP_RMAKER_SKIP_VERSION_CHECK=y +CONFIG_ESP_RMAKER_USER_ID_CHECK=y +CONFIG_ESP_INSIGHTS_ENABLED=y +CONFIG_ESP_INSIGHTS_COREDUMP_ENABLE=n +CONFIG_ESP_INSIGHTS_TRANSPORT_HTTPS=y +CONFIG_DIAG_LOG_DROP_WIFI_LOGS=y +CONFIG_DIAG_ENABLE_METRICS=y +CONFIG_DIAG_ENABLE_HEAP_METRICS=y +CONFIG_DIAG_ENABLE_WIFI_METRICS=y +CONFIG_DIAG_ENABLE_VARIABLES=y +CONFIG_DIAG_ENABLE_NETWORK_VARIABLES=y +CONFIG_ESP_COREDUMP_ENABLE=y +CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH=n +CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF=y +CONFIG_ESP_COREDUMP_CHECKSUM_CRC32=y +CONFIG_ESP_COREDUMP_MAX_TASKS_NUM=64 +CONFIG_ESP_COREDUMP_STACK_SIZE=1024 +CONFIG_MBEDTLS_DYNAMIC_BUFFER=y +CONFIG_MBEDTLS_DYNAMIC_FREE_PEER_CERT=y +CONFIG_MBEDTLS_DYNAMIC_FREE_CONFIG_DATA=y + +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_SR_WN_WN9_HIESP=y +CONFIG_SR_MN_CN_NONE=y +CONFIG_SR_MN_EN_MULTINET5_SINGLE_RECOGNITION_QUANT8=y +CONFIG_EN_SPEECH_COMMAND_ID0="" +CONFIG_EN_SPEECH_COMMAND_ID1="" +CONFIG_EN_SPEECH_COMMAND_ID2="" +CONFIG_EN_SPEECH_COMMAND_ID3="" +CONFIG_EN_SPEECH_COMMAND_ID4="" +CONFIG_EN_SPEECH_COMMAND_ID5="" +CONFIG_EN_SPEECH_COMMAND_ID6="" +CONFIG_EN_SPEECH_COMMAND_ID7="" +CONFIG_EN_SPEECH_COMMAND_ID8="" +CONFIG_EN_SPEECH_COMMAND_ID9="" +CONFIG_EN_SPEECH_COMMAND_ID10="" +CONFIG_EN_SPEECH_COMMAND_ID11="" +CONFIG_EN_SPEECH_COMMAND_ID12="" +CONFIG_EN_SPEECH_COMMAND_ID13="" +CONFIG_EN_SPEECH_COMMAND_ID14="" +CONFIG_EN_SPEECH_COMMAND_ID15="" +CONFIG_EN_SPEECH_COMMAND_ID16="" +CONFIG_EN_SPEECH_COMMAND_ID17="" +CONFIG_EN_SPEECH_COMMAND_ID18="" +CONFIG_EN_SPEECH_COMMAND_ID19="" +CONFIG_EN_SPEECH_COMMAND_ID20="" +CONFIG_EN_SPEECH_COMMAND_ID21="" +CONFIG_EN_SPEECH_COMMAND_ID22="" +CONFIG_EN_SPEECH_COMMAND_ID23="" +CONFIG_EN_SPEECH_COMMAND_ID24="" +CONFIG_EN_SPEECH_COMMAND_ID25="" +CONFIG_EN_SPEECH_COMMAND_ID26="" +CONFIG_EN_SPEECH_COMMAND_ID27="" +CONFIG_EN_SPEECH_COMMAND_ID28="" +CONFIG_EN_SPEECH_COMMAND_ID29="" +CONFIG_EN_SPEECH_COMMAND_ID30="" +CONFIG_EN_SPEECH_COMMAND_ID31="" diff --git a/examples/espidf-arduino-blink/src/Blink.cpp b/examples/espidf-arduino-blink/src/Blink.cpp index c69fd30f5..b584a2c73 100644 --- a/examples/espidf-arduino-blink/src/Blink.cpp +++ b/examples/espidf-arduino-blink/src/Blink.cpp @@ -29,7 +29,7 @@ void blink_task(void *pvParameter) Technical Reference for a list of pads and their default functions.) */ - gpio_pad_select_gpio(BLINK_GPIO); + esp_rom_gpio_pad_select_gpio(BLINK_GPIO); /* Set the GPIO as a push/pull output */ gpio_set_direction(BLINK_GPIO, GPIO_MODE_OUTPUT); while(1) { diff --git a/examples/espidf-arduino-littlefs/.gitignore b/examples/espidf-arduino-littlefs/.gitignore new file mode 100644 index 000000000..b9f3806a2 --- /dev/null +++ b/examples/espidf-arduino-littlefs/.gitignore @@ -0,0 +1,2 @@ +.pio +.vscode diff --git a/examples/espidf-arduino-littlefs/CMakeLists.txt b/examples/espidf-arduino-littlefs/CMakeLists.txt new file mode 100644 index 000000000..1c734fcfb --- /dev/null +++ b/examples/espidf-arduino-littlefs/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.16.0) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(espidf-arduino-littlefs) diff --git a/examples/espidf-arduino-littlefs/README.md b/examples/espidf-arduino-littlefs/README.md new file mode 100644 index 000000000..8e58b4a04 --- /dev/null +++ b/examples/espidf-arduino-littlefs/README.md @@ -0,0 +1 @@ +# Arduino_IDF_LittleFS diff --git a/examples/espidf-arduino-littlefs/data/file1.txt b/examples/espidf-arduino-littlefs/data/file1.txt new file mode 100644 index 000000000..7c4a013e5 --- /dev/null +++ b/examples/espidf-arduino-littlefs/data/file1.txt @@ -0,0 +1 @@ +aaa \ No newline at end of file diff --git a/examples/espidf-arduino-littlefs/data/testfolder/test2.txt b/examples/espidf-arduino-littlefs/data/testfolder/test2.txt new file mode 100644 index 000000000..01f02e32c --- /dev/null +++ b/examples/espidf-arduino-littlefs/data/testfolder/test2.txt @@ -0,0 +1 @@ +bbb \ No newline at end of file diff --git a/examples/arduino-ble5-advertising/include/README b/examples/espidf-arduino-littlefs/include/README similarity index 100% rename from examples/arduino-ble5-advertising/include/README rename to examples/espidf-arduino-littlefs/include/README diff --git a/examples/arduino-ble5-advertising/lib/README b/examples/espidf-arduino-littlefs/lib/README similarity index 100% rename from examples/arduino-ble5-advertising/lib/README rename to examples/espidf-arduino-littlefs/lib/README diff --git a/examples/espidf-arduino-littlefs/partitions_custom.csv b/examples/espidf-arduino-littlefs/partitions_custom.csv new file mode 100644 index 000000000..960469b82 --- /dev/null +++ b/examples/espidf-arduino-littlefs/partitions_custom.csv @@ -0,0 +1,7 @@ +# Name, Type, SubType, Offset, Size, Flags +nvs, data, nvs, 0x9000, 0x5000, +otadata, data, ota, 0xe000, 0x2000, +app0, app, ota_0, 0x10000, 0x140000, +app1, app, ota_1, 0x150000,0x140000, +spiffs, data, spiffs, 0x290000,0x160000, +coredump, data, coredump,0x3F0000,0x10000, diff --git a/examples/espidf-arduino-littlefs/platformio.ini b/examples/espidf-arduino-littlefs/platformio.ini new file mode 100644 index 000000000..d0c70385c --- /dev/null +++ b/examples/espidf-arduino-littlefs/platformio.ini @@ -0,0 +1,24 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[env] +platform = espressif32 +framework = arduino, espidf +monitor_speed = 115200 +board_build.embed_txtfiles = + managed_components/espressif__esp_insights/server_certs/https_server.crt + managed_components/espressif__esp_rainmaker/server_certs/rmaker_mqtt_server.crt + managed_components/espressif__esp_rainmaker/server_certs/rmaker_claim_service_server.crt + managed_components/espressif__esp_rainmaker/server_certs/rmaker_ota_server.crt + +[env:esp32dev] +board = esp32dev +board_build.filesystem = littlefs +board_build.partitions = partitions_custom.csv diff --git a/examples/espidf-arduino-littlefs/sdkconfig.defaults b/examples/espidf-arduino-littlefs/sdkconfig.defaults new file mode 100644 index 000000000..a8f9a5467 --- /dev/null +++ b/examples/espidf-arduino-littlefs/sdkconfig.defaults @@ -0,0 +1,9 @@ +CONFIG_AUTOSTART_ARDUINO=y +# CONFIG_WS2812_LED_ENABLE is not set +CONFIG_FREERTOS_HZ=1000 +CONFIG_MBEDTLS_PSK_MODES=y +CONFIG_MBEDTLS_KEY_EXCHANGE_PSK=y +CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y +CONFIG_COMPILER_OPTIMIZATION_SIZE=y +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y +CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE=y diff --git a/examples/espidf-arduino-littlefs/src/CMakeLists.txt b/examples/espidf-arduino-littlefs/src/CMakeLists.txt new file mode 100644 index 000000000..483bc0cfc --- /dev/null +++ b/examples/espidf-arduino-littlefs/src/CMakeLists.txt @@ -0,0 +1,6 @@ +# This file was automatically generated for projects +# without default 'CMakeLists.txt' file. + +FILE(GLOB_RECURSE app_sources ${CMAKE_SOURCE_DIR}/src/*.*) + +idf_component_register(SRCS ${app_sources}) diff --git a/examples/espidf-arduino-littlefs/src/main.cpp b/examples/espidf-arduino-littlefs/src/main.cpp new file mode 100644 index 000000000..67bbc3234 --- /dev/null +++ b/examples/espidf-arduino-littlefs/src/main.cpp @@ -0,0 +1,282 @@ +#include +#include "FS.h" +#include +#include + +/* You only need to format LittleFS the first time you run a + test or else use the LITTLEFS plugin to create a partition + https://github.com/lorol/arduino-esp32littlefs-plugin */ + +#define FORMAT_LITTLEFS_IF_FAILED true + +void listDir(fs::FS &fs, const char * dirname, uint8_t levels){ + Serial.printf("Listing directory: %s\r\n", dirname); + + File root = fs.open(dirname); + if(!root){ + Serial.println("- failed to open directory"); + return; + } + if(!root.isDirectory()){ + Serial.println(" - not a directory"); + return; + } + + File file = root.openNextFile(); + while(file){ + if(file.isDirectory()){ + Serial.print(" DIR : "); + + Serial.print(file.name()); + time_t t= file.getLastWrite(); + struct tm * tmstruct = localtime(&t); + Serial.printf(" LAST WRITE: %d-%02d-%02d %02d:%02d:%02d\n",(tmstruct->tm_year)+1900,( tmstruct->tm_mon)+1, tmstruct->tm_mday,tmstruct->tm_hour , tmstruct->tm_min, tmstruct->tm_sec); + + if(levels){ + listDir(fs, file.name(), levels -1); + } + } else { + Serial.print(" FILE: "); + Serial.print(file.name()); + Serial.print(" SIZE: "); + + Serial.print(file.size()); + time_t t= file.getLastWrite(); + struct tm * tmstruct = localtime(&t); + Serial.printf(" LAST WRITE: %d-%02d-%02d %02d:%02d:%02d\n",(tmstruct->tm_year)+1900,( tmstruct->tm_mon)+1, tmstruct->tm_mday,tmstruct->tm_hour , tmstruct->tm_min, tmstruct->tm_sec); + } + file = root.openNextFile(); + } +} + +void createDir(fs::FS &fs, const char * path){ + Serial.printf("Creating Dir: %s\n", path); + if(fs.mkdir(path)){ + Serial.println("Dir created"); + } else { + Serial.println("mkdir failed"); + } +} + +void removeDir(fs::FS &fs, const char * path){ + Serial.printf("Removing Dir: %s\n", path); + if(fs.rmdir(path)){ + Serial.println("Dir removed"); + } else { + Serial.println("rmdir failed"); + } +} + +void readFile(fs::FS &fs, const char * path){ + Serial.printf("Reading file: %s\r\n", path); + + File file = fs.open(path); + if(!file || file.isDirectory()){ + Serial.println("- failed to open file for reading"); + return; + } + + Serial.println("- read from file:"); + while(file.available()){ + Serial.write(file.read()); + } + file.close(); +} + +void writeFile(fs::FS &fs, const char * path, const char * message){ + Serial.printf("Writing file: %s\r\n", path); + + File file = fs.open(path, FILE_WRITE); + if(!file){ + Serial.println("- failed to open file for writing"); + return; + } + if(file.print(message)){ + Serial.println("- file written"); + } else { + Serial.println("- write failed"); + } + file.close(); +} + +void appendFile(fs::FS &fs, const char * path, const char * message){ + Serial.printf("Appending to file: %s\r\n", path); + + File file = fs.open(path, FILE_APPEND); + if(!file){ + Serial.println("- failed to open file for appending"); + return; + } + if(file.print(message)){ + Serial.println("- message appended"); + } else { + Serial.println("- append failed"); + } + file.close(); +} + +void renameFile(fs::FS &fs, const char * path1, const char * path2){ + Serial.printf("Renaming file %s to %s\r\n", path1, path2); + if (fs.rename(path1, path2)) { + Serial.println("- file renamed"); + } else { + Serial.println("- rename failed"); + } +} + +void deleteFile(fs::FS &fs, const char * path){ + Serial.printf("Deleting file: %s\r\n", path); + if(fs.remove(path)){ + Serial.println("- file deleted"); + } else { + Serial.println("- delete failed"); + } +} + +// SPIFFS-like write and delete file + +// See: https://github.com/esp8266/Arduino/blob/master/libraries/LittleFS/src/LittleFS.cpp#L60 +void writeFile2(fs::FS &fs, const char * path, const char * message){ + if(!fs.exists(path)){ + if (strchr(path, '/')) { + Serial.printf("Create missing folders of: %s\r\n", path); + char *pathStr = strdup(path); + if (pathStr) { + char *ptr = strchr(pathStr, '/'); + while (ptr) { + *ptr = 0; + fs.mkdir(pathStr); + *ptr = '/'; + ptr = strchr(ptr+1, '/'); + } + } + free(pathStr); + } + } + + Serial.printf("Writing file to: %s\r\n", path); + File file = fs.open(path, FILE_WRITE); + if(!file){ + Serial.println("- failed to open file for writing"); + return; + } + if(file.print(message)){ + Serial.println("- file written"); + } else { + Serial.println("- write failed"); + } + file.close(); +} + +// See: https://github.com/esp8266/Arduino/blob/master/libraries/LittleFS/src/LittleFS.h#L149 +void deleteFile2(fs::FS &fs, const char * path){ + Serial.printf("Deleting file and empty folders on path: %s\r\n", path); + + if(fs.remove(path)){ + Serial.println("- file deleted"); + } else { + Serial.println("- delete failed"); + } + + char *pathStr = strdup(path); + if (pathStr) { + char *ptr = strrchr(pathStr, '/'); + if (ptr) { + Serial.printf("Removing all empty folders on path: %s\r\n", path); + } + while (ptr) { + *ptr = 0; + fs.rmdir(pathStr); + ptr = strrchr(pathStr, '/'); + } + free(pathStr); + } +} + +void testFileIO(fs::FS &fs, const char * path){ + Serial.printf("Testing file I/O with %s\r\n", path); + + static uint8_t buf[512]; + size_t len = 0; + File file = fs.open(path, FILE_WRITE); + if(!file){ + Serial.println("- failed to open file for writing"); + return; + } + + size_t i; + Serial.print("- writing" ); + uint32_t start = millis(); + for(i=0; i<2048; i++){ + if ((i & 0x001F) == 0x001F){ + Serial.print("."); + } + file.write(buf, 512); + } + Serial.println(""); + uint32_t end = millis() - start; + Serial.printf(" - %u bytes written in %u ms\r\n", 2048 * 512, (unsigned int)end); + file.close(); + + file = fs.open(path); + start = millis(); + end = start; + i = 0; + if(file && !file.isDirectory()){ + len = file.size(); + size_t flen = len; + start = millis(); + Serial.print("- reading" ); + while(len){ + size_t toRead = len; + if(toRead > 512){ + toRead = 512; + } + file.read(buf, toRead); + if ((i++ & 0x001F) == 0x001F){ + Serial.print("."); + } + len -= toRead; + } + Serial.println(""); + end = millis() - start; + Serial.printf("- %u bytes read in %u ms\r\n", flen, (unsigned int)end); + file.close(); + } else { + Serial.println("- failed to open file for reading"); + } +} + +void setup(){ + Serial.begin(115200); + if(!LittleFS.begin(FORMAT_LITTLEFS_IF_FAILED)){ + Serial.println("LittleFS Mount Failed"); + return; + } + + listDir(LittleFS, "/", 0); + createDir(LittleFS, "/mydir"); + writeFile(LittleFS, "/mydir/hello2.txt", "Hello2"); + //writeFile(LittleFS, "/mydir/newdir2/newdir3/hello3.txt", "Hello3"); + writeFile2(LittleFS, "/mydir/newdir2/newdir3/hello3.txt", "Hello3"); + listDir(LittleFS, "/", 3); + deleteFile(LittleFS, "/mydir/hello2.txt"); + //deleteFile(LittleFS, "/mydir/newdir2/newdir3/hello3.txt"); + deleteFile2(LittleFS, "/mydir/newdir2/newdir3/hello3.txt"); + removeDir(LittleFS, "/mydir"); + listDir(LittleFS, "/", 3); + writeFile(LittleFS, "/hello.txt", "Hello "); + appendFile(LittleFS, "/hello.txt", "World!\r\n"); + readFile(LittleFS, "/hello.txt"); + renameFile(LittleFS, "/hello.txt", "/foo.txt"); + readFile(LittleFS, "/foo.txt"); + deleteFile(LittleFS, "/foo.txt"); + testFileIO(LittleFS, "/test.txt"); + deleteFile(LittleFS, "/test.txt"); + + Serial.println( "Test complete" ); +} + +void loop(){ + +} diff --git a/examples/espidf-arduino-wifiscan/.travis.yml b/examples/espidf-arduino-wifiscan/.travis.yml deleted file mode 100644 index 7c486f183..000000000 --- a/examples/espidf-arduino-wifiscan/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# 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-arduino-wifiscan/platformio.ini b/examples/espidf-arduino-wifiscan/platformio.ini index 6f6d15335..3dea0eabf 100644 --- a/examples/espidf-arduino-wifiscan/platformio.ini +++ b/examples/espidf-arduino-wifiscan/platformio.ini @@ -11,9 +11,12 @@ platform = espressif32 framework = arduino, espidf monitor_speed = 115200 - -[env:esp32dev] -board = esp32dev +board_build.esp-idf.preserve_source_file_extension = yes +board_build.embed_txtfiles = + managed_components/espressif__esp_insights/server_certs/https_server.crt + managed_components/espressif__esp_rainmaker/server_certs/rmaker_mqtt_server.crt + managed_components/espressif__esp_rainmaker/server_certs/rmaker_claim_service_server.crt + managed_components/espressif__esp_rainmaker/server_certs/rmaker_ota_server.crt [env:esp-wrover-kit] board = esp-wrover-kit diff --git a/examples/espidf-arduino-wifiscan/sdkconfig.defaults b/examples/espidf-arduino-wifiscan/sdkconfig.defaults index f67b30bf1..b902509e1 100644 --- a/examples/espidf-arduino-wifiscan/sdkconfig.defaults +++ b/examples/espidf-arduino-wifiscan/sdkconfig.defaults @@ -3,6 +3,10 @@ CONFIG_AUTOSTART_ARDUINO=y CONFIG_FREERTOS_HZ=1000 CONFIG_MBEDTLS_PSK_MODES=y CONFIG_MBEDTLS_KEY_EXCHANGE_PSK=y +CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y +CONFIG_COMPILER_OPTIMIZATION_SIZE=y +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y +CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE=y # Example config CONFIG_EXAMPLE_WIFI_SSID="MYSSID" CONFIG_EXAMPLE_WIFI_PASSWORD="MYPASS" diff --git a/examples/arduino-ble5-advertising/.gitignore b/examples/espidf-blink/.gitignore similarity index 100% rename from examples/arduino-ble5-advertising/.gitignore rename to examples/espidf-blink/.gitignore diff --git a/examples/espidf-ulp-pulse/CMakeLists.txt b/examples/espidf-blink/CMakeLists.txt similarity index 74% rename from examples/espidf-ulp-pulse/CMakeLists.txt rename to examples/espidf-blink/CMakeLists.txt index f0c74a151..a347b9736 100644 --- a/examples/espidf-ulp-pulse/CMakeLists.txt +++ b/examples/espidf-blink/CMakeLists.txt @@ -1,3 +1,3 @@ cmake_minimum_required(VERSION 3.16.0) include($ENV{IDF_PATH}/tools/cmake/project.cmake) -project(espidf-ulp-pulse-new) +project(espidf-blink) diff --git a/examples/espidf-ulp-adc/README.md b/examples/espidf-blink/README.md similarity index 91% rename from examples/espidf-ulp-adc/README.md rename to examples/espidf-blink/README.md index abe2df482..1fbbba65a 100644 --- a/examples/espidf-ulp-adc/README.md +++ b/examples/espidf-blink/README.md @@ -8,7 +8,7 @@ How to build PlatformIO based project ```shell # Change directory to example -$ cd platform-espressif32/examples/espidf-ulp-adc +$ cd platform-espressif32/examples/espidf-blink # Build project $ pio run @@ -24,4 +24,4 @@ $ pio run -e esp32dev --target upload # Clean build files $ pio run --target clean -``` +``` \ No newline at end of file diff --git a/examples/espidf-storage-spiffs/include/README b/examples/espidf-blink/include/README similarity index 100% rename from examples/espidf-storage-spiffs/include/README rename to examples/espidf-blink/include/README diff --git a/examples/espidf-blink/lib/README b/examples/espidf-blink/lib/README new file mode 100644 index 000000000..bb6727c81 --- /dev/null +++ b/examples/espidf-blink/lib/README @@ -0,0 +1,77 @@ +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | + +# Blink Example + +(See the README.md file in the upper level 'examples' directory for more information about examples.) + +This example demonstrates how to blink a LED using GPIO or using the [led_strip](https://components.espressif.com/component/espressif/led_strip) component for the addressable LED, i.e. [WS2812](http://www.world-semi.com/Certifications/WS2812B.html). + +The `led_strip` is installed via [component manager](main/idf_component.yml). + +## How to Use Example + +Before project configuration and build, be sure to set the correct chip target using `idf.py set-target `. + +### Hardware Required + +* A development board with Espressif SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.) +* A USB cable for Power supply and programming + +Some development boards use an addressable LED instead of a regular one. These development boards include: + +| Board | LED type | Pin | +| -------------------- | -------------------- | -------------------- | +| ESP32-C3-DevKitC-1 | Addressable | GPIO8 | +| ESP32-C3-DevKitM-1 | Addressable | GPIO8 | +| ESP32-S2-DevKitM-1 | Addressable | GPIO18 | +| ESP32-S2-Saola-1 | Addressable | GPIO18 | +| ESP32-S3-DevKitC-1 | Addressable | GPIO48 | + +See [Development Boards](https://www.espressif.com/en/products/devkits) for more information about it. + +### Configure the Project + +Open the project configuration menu (`idf.py menuconfig`). + +In the `Example Configuration` menu: + +* Select the LED type in the `Blink LED type` option. + * Use `GPIO` for regular LED blink. +* Set the GPIO number used for the signal in the `Blink GPIO number` option. +* Set the blinking period in the `Blink period in ms` option. + +### Build and Flash + +Run `idf.py -p PORT flash monitor` to build, flash and monitor the project. + +(To exit the serial monitor, type ``Ctrl-]``.) + +See the [Getting Started Guide](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/index.html) for full steps to configure and use ESP-IDF to build projects. + +## Example Output + +As you run the example, you will see the LED blinking, according to the previously defined period. For the addressable LED, you can also change the LED color by setting the `led_strip_set_pixel(led_strip, 0, 16, 16, 16);` (LED Strip, Pixel Number, Red, Green, Blue) with values from 0 to 255 in the [source file](main/blink_example_main.c). + +```text +I (315) example: Example configured to blink addressable LED! +I (325) example: Turning the LED OFF! +I (1325) example: Turning the LED ON! +I (2325) example: Turning the LED OFF! +I (3325) example: Turning the LED ON! +I (4325) example: Turning the LED OFF! +I (5325) example: Turning the LED ON! +I (6325) example: Turning the LED OFF! +I (7325) example: Turning the LED ON! +I (8325) example: Turning the LED OFF! +``` + +Note: The color order could be different according to the LED model. + +The pixel number indicates the pixel position in the LED strip. For a single LED, use 0. + +## Troubleshooting + +* If the LED isn't blinking, check the GPIO or the LED type selection in the `Example Configuration` menu. + +For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon. \ No newline at end of file diff --git a/examples/espidf-blink/platformio.ini b/examples/espidf-blink/platformio.ini new file mode 100644 index 000000000..44b4ff9a1 --- /dev/null +++ b/examples/espidf-blink/platformio.ini @@ -0,0 +1,39 @@ +; 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 +; https://docs.platformio.org/page/projectconf.html + +[env:esp32dev] +platform = espressif32 +framework = espidf +board = esp32dev +monitor_speed = 115200 +build_flags = + ; https://docs.espressif.com/projects/esp-idf/en/latest/get-started/get-started-wrover-kit.html#rgb-led + -D CONFIG_BLINK_GPIO=2 + -D CONFIG_BLINK_LED_GPIO=2 + -D CONFIG_BLINK_PERIOD=1000 + +[env:esp32-c2-devkitm-1] +platform = espressif32 +framework = espidf +board = esp32-c2-devkitm-1 +monitor_speed = 115200 +build_flags = + -D CONFIG_BLINK_GPIO=8 + -D CONFIG_BLINK_LED_GPIO=8 + -D CONFIG_BLINK_PERIOD=1000 + +[env:esp32-c6-devkitc-1] +platform = espressif32 +framework = espidf +board = esp32-c6-devkitc-1 +monitor_speed = 115200 +build_flags = + -D CONFIG_BLINK_GPIO=2 + -D CONFIG_BLINK_LED_GPIO=2 + -D CONFIG_BLINK_PERIOD=1000 diff --git a/examples/espidf-blink/sdkconfig.defaults b/examples/espidf-blink/sdkconfig.defaults new file mode 100644 index 000000000..eda3b11f3 --- /dev/null +++ b/examples/espidf-blink/sdkconfig.defaults @@ -0,0 +1,4 @@ +CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y +CONFIG_COMPILER_OPTIMIZATION_SIZE=y +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y +CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE=y diff --git a/examples/espidf-blink/src/CMakeLists.txt b/examples/espidf-blink/src/CMakeLists.txt new file mode 100644 index 000000000..413c3b514 --- /dev/null +++ b/examples/espidf-blink/src/CMakeLists.txt @@ -0,0 +1,2 @@ +idf_component_register(SRCS "blink.c" + INCLUDE_DIRS ".") \ No newline at end of file diff --git a/examples/espidf-blink/src/blink.c b/examples/espidf-blink/src/blink.c new file mode 100644 index 000000000..a4cde01e7 --- /dev/null +++ b/examples/espidf-blink/src/blink.c @@ -0,0 +1,91 @@ +/* Blink 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 "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "driver/gpio.h" +#include "esp_log.h" +//#include "led_strip.h" +#include "sdkconfig.h" + +static const char *TAG = "example"; + +/* Use project configuration menu (idf.py menuconfig) to choose the GPIO to blink, + or you can edit the following line and set a number here. +*/ +#define BLINK_GPIO CONFIG_BLINK_GPIO + +static uint8_t s_led_state = 0; + +#ifdef CONFIG_BLINK_LED_RMT + +static led_strip_handle_t led_strip; + +static void blink_led(void) +{ + /* If the addressable LED is enabled */ + if (s_led_state) { + /* Set the LED pixel using RGB from 0 (0%) to 255 (100%) for each color */ + led_strip_set_pixel(led_strip, 0, 16, 16, 16); + /* Refresh the strip to send data */ + led_strip_refresh(led_strip); + } else { + /* Set all LED off to clear all pixels */ + led_strip_clear(led_strip); + } +} + +static void configure_led(void) +{ + ESP_LOGI(TAG, "Example configured to blink addressable LED!"); + /* LED strip initialization with the GPIO and pixels number*/ + led_strip_config_t strip_config = { + .strip_gpio_num = BLINK_GPIO, + .max_leds = 1, // at least one LED on board + }; + led_strip_rmt_config_t rmt_config = { + .resolution_hz = 10 * 1000 * 1000, // 10MHz + }; + ESP_ERROR_CHECK(led_strip_new_rmt_device(&strip_config, &rmt_config, &led_strip)); + /* Set all LED off to clear all pixels */ + led_strip_clear(led_strip); +} + +#elif CONFIG_BLINK_LED_GPIO + +static void blink_led(void) +{ + /* Set the GPIO level according to the state (LOW or HIGH)*/ + gpio_set_level(BLINK_GPIO, s_led_state); +} + +static void configure_led(void) +{ + ESP_LOGI(TAG, "Example configured to blink GPIO LED!"); + gpio_reset_pin(BLINK_GPIO); + /* Set the GPIO as a push/pull output */ + gpio_set_direction(BLINK_GPIO, GPIO_MODE_OUTPUT); +} + +#endif + +void app_main(void) +{ + + /* Configure the peripheral according to the LED type */ + configure_led(); + + while (1) { + ESP_LOGI(TAG, "Turning the LED %s!", s_led_state == true ? "ON" : "OFF"); + blink_led(); + /* Toggle the LED state */ + s_led_state = !s_led_state; + vTaskDelay(CONFIG_BLINK_PERIOD / portTICK_PERIOD_MS); + } +} diff --git a/examples/arduino-ble5-advertising/test/README b/examples/espidf-blink/test/README similarity index 100% rename from examples/arduino-ble5-advertising/test/README rename to examples/espidf-blink/test/README diff --git a/examples/espidf-coap-server/.travis.yml b/examples/espidf-coap-server/.travis.yml deleted file mode 100644 index 7c486f183..000000000 --- a/examples/espidf-coap-server/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# 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-coap-server/platformio.ini b/examples/espidf-coap-server/platformio.ini index 78383c341..c26b3222a 100644 --- a/examples/espidf-coap-server/platformio.ini +++ b/examples/espidf-coap-server/platformio.ini @@ -16,11 +16,5 @@ board_build.embed_txtfiles = src/certs/coap_server.crt src/certs/coap_server.key -[env:nano32] -board = nano32 - [env:esp-wrover-kit] board = esp-wrover-kit - -[env:esp32dev] -board = esp32dev diff --git a/examples/espidf-exceptions/.travis.yml b/examples/espidf-exceptions/.travis.yml deleted file mode 100644 index 7c486f183..000000000 --- a/examples/espidf-exceptions/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# 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-exceptions/platformio.ini b/examples/espidf-exceptions/platformio.ini index a6c3cff92..a4031d38f 100644 --- a/examples/espidf-exceptions/platformio.ini +++ b/examples/espidf-exceptions/platformio.ini @@ -12,11 +12,5 @@ platform = espressif32 framework = espidf monitor_speed = 115200 -[env:esp32dev] -board = esp32dev - [env:esp-wrover-kit] board = esp-wrover-kit - -[env:lolin32] -board = lolin32 diff --git a/examples/espidf-hello-world/.travis.yml b/examples/espidf-hello-world/.travis.yml deleted file mode 100644 index 7c486f183..000000000 --- a/examples/espidf-hello-world/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# 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-hello-world/platformio.ini b/examples/espidf-hello-world/platformio.ini index 44102cc88..226510eb1 100644 --- a/examples/espidf-hello-world/platformio.ini +++ b/examples/espidf-hello-world/platformio.ini @@ -20,8 +20,3 @@ board = esp32-s2-kaluga-1 [env:esp32-c3-devkitm-1] board = esp32-c3-devkitm-1 - -[env:esp32-c6-devkitc-1] -board = esp32-c6-devkitc-1 -board_build.cmake_extra_args = - -DSDKCONFIG_DEFAULTS="sdkconfig.defaults.esp32c6" diff --git a/examples/espidf-hello-world/sdkconfig.defaults.esp32c6 b/examples/espidf-hello-world/sdkconfig.defaults.esp32c6 deleted file mode 100644 index 6c73965bc..000000000 --- a/examples/espidf-hello-world/sdkconfig.defaults.esp32c6 +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y -CONFIG_ESPTOOLPY_FLASHSIZE="8MB" diff --git a/examples/espidf-http-request/.travis.yml b/examples/espidf-http-request/.travis.yml deleted file mode 100644 index 7c486f183..000000000 --- a/examples/espidf-http-request/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# 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-http-request/platformio.ini b/examples/espidf-http-request/platformio.ini index 38756e618..75537f7a6 100644 --- a/examples/espidf-http-request/platformio.ini +++ b/examples/espidf-http-request/platformio.ini @@ -15,11 +15,5 @@ monitor_speed = 115200 [env:esp32dev] board = esp32dev -[env:nano32] -board = nano32 - -[env:espea32] -board = espea32 - [env:esp32-s2-saola-1] board = esp32-s2-saola-1 diff --git a/examples/espidf-peripherals-uart/.travis.yml b/examples/espidf-peripherals-uart/.travis.yml deleted file mode 100644 index 7c486f183..000000000 --- a/examples/espidf-peripherals-uart/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# 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-peripherals-uart/platformio.ini b/examples/espidf-peripherals-uart/platformio.ini index 84e7f72d8..b004a1b2f 100644 --- a/examples/espidf-peripherals-uart/platformio.ini +++ b/examples/espidf-peripherals-uart/platformio.ini @@ -12,11 +12,5 @@ platform = espressif32 framework = espidf monitor_speed = 115200 -[env:pocket_32] -board = pocket_32 - [env:odroid_esp32] board = odroid_esp32 - -[env:featheresp32] -board = featheresp32 diff --git a/examples/espidf-peripherals-usb/.travis.yml b/examples/espidf-peripherals-usb/.travis.yml deleted file mode 100644 index 7c486f183..000000000 --- a/examples/espidf-peripherals-usb/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# 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-storage-sdcard/.travis.yml b/examples/espidf-storage-sdcard/.travis.yml deleted file mode 100644 index 7c486f183..000000000 --- a/examples/espidf-storage-sdcard/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# 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-storage-sdcard/platformio.ini b/examples/espidf-storage-sdcard/platformio.ini index 112293123..66f1b78d2 100644 --- a/examples/espidf-storage-sdcard/platformio.ini +++ b/examples/espidf-storage-sdcard/platformio.ini @@ -12,11 +12,5 @@ platform = espressif32 framework = espidf monitor_speed = 115200 -[env:esp32thing] -board = esp32thing - -[env:esp32-gateway] -board = esp32-gateway - [env:heltec_wifi_kit_32] board = heltec_wifi_kit_32 diff --git a/examples/espidf-storage-spiffs/.gitignore b/examples/espidf-storage-spiffs/.gitignore deleted file mode 100644 index 03f4a3c19..000000000 --- a/examples/espidf-storage-spiffs/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pio diff --git a/examples/espidf-storage-spiffs/README.md b/examples/espidf-storage-spiffs/README.md deleted file mode 100644 index 214f9ba67..000000000 --- a/examples/espidf-storage-spiffs/README.md +++ /dev/null @@ -1,24 +0,0 @@ -How to build PlatformIO based project -===================================== - -1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) -2. Download [development platform with examples](https://github.com/platformio/platform-espressif32/archive/develop.zip) -3. Extract ZIP archive -4. Run these commands: - -```shell -# Change directory to example -$ cd platform-espressif32/examples/espidf-storage-spiffs - -# Build project -$ pio run - -# Upload firmware -$ pio run --target upload - -# Upload SPIFFS image -$ pio run --target uploadfs - -# Clean build files -$ pio run --target clean -``` diff --git a/examples/espidf-storage-spiffs/data/hello.txt b/examples/espidf-storage-spiffs/data/hello.txt deleted file mode 100644 index 5a8367719..000000000 --- a/examples/espidf-storage-spiffs/data/hello.txt +++ /dev/null @@ -1 +0,0 @@ -Hello World from SPIFFS. diff --git a/examples/espidf-storage-spiffs/lib/README b/examples/espidf-storage-spiffs/lib/README deleted file mode 100644 index 6debab1e8..000000000 --- a/examples/espidf-storage-spiffs/lib/README +++ /dev/null @@ -1,46 +0,0 @@ - -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 deleted file mode 100644 index 92db904e0..000000000 --- a/examples/espidf-storage-spiffs/partitions_example.csv +++ /dev/null @@ -1,6 +0,0 @@ -# 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 deleted file mode 100644 index 9185e89ba..000000000 --- a/examples/espidf-storage-spiffs/platformio.ini +++ /dev/null @@ -1,15 +0,0 @@ -; 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 -; https://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 deleted file mode 100644 index b9bb0c0a5..000000000 --- a/examples/espidf-storage-spiffs/sdkconfig.defaults +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index c480915ab..000000000 --- a/examples/espidf-storage-spiffs/src/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -idf_component_register(SRCS "spiffs_example_main.c" - INCLUDE_DIRS ".") diff --git a/examples/espidf-storage-spiffs/src/Kconfig.projbuild b/examples/espidf-storage-spiffs/src/Kconfig.projbuild deleted file mode 100644 index eadd67909..000000000 --- a/examples/espidf-storage-spiffs/src/Kconfig.projbuild +++ /dev/null @@ -1,9 +0,0 @@ -menu "SPIFFS Example menu" - - config EXAMPLE_SPIFFS_CHECK_ON_START - bool "Run SPIFFS_check on every start-up" - default y - help - If this config item is set, esp_spiffs_check() will be run on every start-up. - Slow on large flash sizes. -endmenu diff --git a/examples/espidf-storage-spiffs/src/spiffs_example_main.c b/examples/espidf-storage-spiffs/src/spiffs_example_main.c deleted file mode 100644 index 32cc17686..000000000 --- a/examples/espidf-storage-spiffs/src/spiffs_example_main.c +++ /dev/null @@ -1,127 +0,0 @@ -/* 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; - } - -#ifdef CONFIG_EXAMPLE_SPIFFS_CHECK_ON_START - ESP_LOGI(TAG, "Performing SPIFFS_check()."); - ret = esp_spiffs_check(conf.partition_label); - if (ret != ESP_OK) { - ESP_LOGE(TAG, "SPIFFS_check() failed (%s)", esp_err_to_name(ret)); - return; - } else { - ESP_LOGI(TAG, "SPIFFS_check() successful"); - } -#endif - - 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). Formatting...", esp_err_to_name(ret)); - esp_spiffs_format(conf.partition_label); - return; - } else { - ESP_LOGI(TAG, "Partition size: total: %d, used: %d", total, used); - } - -# - // Check consistency of reported partiton size info. - if (used > total) { - ESP_LOGW(TAG, "Number of used bytes cannot be larger than total. Performing SPIFFS_check()."); - ret = esp_spiffs_check(conf.partition_label); - // Could be also used to mend broken files, to clean unreferenced pages, etc. - // More info at https://github.com/pellepl/spiffs/wiki/FAQ#powerlosses-contd-when-should-i-run-spiffs_check - if (ret != ESP_OK) { - ESP_LOGE(TAG, "SPIFFS_check() failed (%s)", esp_err_to_name(ret)); - return; - } else { - ESP_LOGI(TAG, "SPIFFS_check() successful"); - } - } - - // Use POSIX and C standard library functions to work with files. - // First create a file. - ESP_LOGI(TAG, "Opening file"); - FILE* f = fopen("/spiffs/hello.txt", "w"); - if (f == NULL) { - ESP_LOGE(TAG, "Failed to open file for writing"); - return; - } - fprintf(f, "Hello World!\n"); - fclose(f); - ESP_LOGI(TAG, "File written"); - - // Check if destination file exists before renaming - struct stat st; - if (stat("/spiffs/foo.txt", &st) == 0) { - // Delete it if it exists - unlink("/spiffs/foo.txt"); - } - - // Rename original file - ESP_LOGI(TAG, "Renaming file"); - if (rename("/spiffs/hello.txt", "/spiffs/foo.txt") != 0) { - ESP_LOGE(TAG, "Rename failed"); - return; - } - - // Open renamed file for reading - ESP_LOGI(TAG, "Reading file"); - f = fopen("/spiffs/foo.txt", "r"); - if (f == NULL) { - ESP_LOGE(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 deleted file mode 100644 index df5066e64..000000000 --- a/examples/espidf-storage-spiffs/test/README +++ /dev/null @@ -1,11 +0,0 @@ - -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/.gitignore b/examples/espidf-ulp-adc/.gitignore deleted file mode 100644 index 03f4a3c19..000000000 --- a/examples/espidf-ulp-adc/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pio diff --git a/examples/espidf-ulp-adc/.travis.yml b/examples/espidf-ulp-adc/.travis.yml deleted file mode 100644 index 7c486f183..000000000 --- a/examples/espidf-ulp-adc/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# 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/include/README b/examples/espidf-ulp-adc/include/README deleted file mode 100644 index 194dcd432..000000000 --- a/examples/espidf-ulp-adc/include/README +++ /dev/null @@ -1,39 +0,0 @@ - -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 deleted file mode 100644 index 6debab1e8..000000000 --- a/examples/espidf-ulp-adc/lib/README +++ /dev/null @@ -1,46 +0,0 @@ - -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/main/ulp_adc_example_main.c b/examples/espidf-ulp-adc/main/ulp_adc_example_main.c deleted file mode 100644 index 882128329..000000000 --- a/examples/espidf-ulp-adc/main/ulp_adc_example_main.c +++ /dev/null @@ -1,108 +0,0 @@ -/* 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 -#include "esp_sleep.h" -#include "soc/rtc_cntl_reg.h" -#include "soc/sens_reg.h" -#include "driver/gpio.h" -#include "driver/rtc_io.h" -#include "ulp.h" -#include "ulp_main.h" -#include "esp_adc/adc_oneshot.h" -#include "ulp/example_config.h" -#include "ulp_adc.h" - -#include "freertos/FreeRTOS.h" -#include "freertos/task.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(void); - -/* 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); - -void app_main(void) -{ - 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 %"PRIu32" measurements since last reset\n", ulp_sample_counter & UINT16_MAX); - printf("Thresholds: low=%"PRIu32" high=%"PRIu32"\n", ulp_low_thr, ulp_high_thr); - ulp_last_result &= UINT16_MAX; - printf("Value=%"PRIu32" 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() ); - -#if !CONFIG_IDF_TARGET_ESP32 - /* RTC peripheral power domain needs to be kept on to keep SAR ADC related configs during sleep */ - esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON); -#endif - - esp_deep_sleep_start(); -} - -static void init_ulp_program(void) -{ - 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); - - ulp_adc_cfg_t cfg = { - .adc_n = EXAMPLE_ADC_UNIT, - .channel = EXAMPLE_ADC_CHANNEL, - .width = EXAMPLE_ADC_WIDTH, - .atten = EXAMPLE_ADC_ATTEN, - .ulp_mode = ADC_ULP_MODE_FSM, - }; - - ESP_ERROR_CHECK(ulp_adc_init(&cfg)); - - ulp_low_thr = EXAMPLE_ADC_LOW_TRESHOLD; - ulp_high_thr = EXAMPLE_ADC_HIGH_TRESHOLD; - - /* Set ULP wake up period to 20ms */ - ulp_set_wakeup_period(0, 20000); - -#if CONFIG_IDF_TARGET_ESP32 - /* Disconnect GPIO12 and GPIO15 to remove current drain through - * pullup/pulldown resistors on modules which have these (e.g. ESP32-WROVER) - * GPIO12 may be pulled high to select flash voltage. - */ - rtc_gpio_isolate(GPIO_NUM_12); - rtc_gpio_isolate(GPIO_NUM_15); -#endif // CONFIG_IDF_TARGET_ESP32 - - esp_deep_sleep_disable_rom_logging(); // suppress boot messages -} - -static void start_ulp_program(void) -{ - /* 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 deleted file mode 100644 index df5066e64..000000000 --- a/examples/espidf-ulp-adc/test/README +++ /dev/null @@ -1,11 +0,0 @@ - -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 deleted file mode 100644 index b96f51c3b..000000000 --- a/examples/espidf-ulp-adc/ulp/adc.S +++ /dev/null @@ -1,120 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Unlicense OR CC0-1.0 - */ -/* 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" -#include "example_config.h" - - .set adc_channel, EXAMPLE_ADC_CHANNEL - - /* 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-adc/ulp/example_config.h b/examples/espidf-ulp-adc/ulp/example_config.h deleted file mode 100644 index baa86dd84..000000000 --- a/examples/espidf-ulp-adc/ulp/example_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Unlicense OR CC0-1.0 - */ -#pragma once - -/* Ints are used here to be able to include the file in assembly as well */ -#define EXAMPLE_ADC_CHANNEL 6 // ADC_CHANNEL_6, GPIO34 on ESP32, GPIO7 on ESP32-S3 -#define EXAMPLE_ADC_UNIT 0 // ADC_UNIT_1 -#define EXAMPLE_ADC_ATTEN 3 // ADC_ATTEN_DB_11 -#define EXAMPLE_ADC_WIDTH 0 // ADC_BITWIDTH_DEFAULT - -/* Set low and high thresholds, approx. 1.35V - 1.75V*/ -#define EXAMPLE_ADC_LOW_TRESHOLD 1500 -#define EXAMPLE_ADC_HIGH_TRESHOLD 2000 diff --git a/examples/espidf-ulp-pulse/.gitignore b/examples/espidf-ulp-pulse/.gitignore deleted file mode 100644 index 03f4a3c19..000000000 --- a/examples/espidf-ulp-pulse/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pio diff --git a/examples/espidf-ulp-pulse/.travis.yml b/examples/espidf-ulp-pulse/.travis.yml deleted file mode 100644 index 7c486f183..000000000 --- a/examples/espidf-ulp-pulse/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# 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.md b/examples/espidf-ulp-pulse/README.md deleted file mode 100644 index 96ffb18c1..000000000 --- a/examples/espidf-ulp-pulse/README.md +++ /dev/null @@ -1,27 +0,0 @@ -How to build PlatformIO based project -===================================== - -1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) -2. Download [development platform with examples](https://github.com/platformio/platform-espressif32/archive/develop.zip) -3. Extract ZIP archive -4. Run these commands: - -```shell -# Change directory to example -$ cd platform-espressif32/examples/espidf-ulp-pulse - -# Build project -$ pio run - -# Upload firmware -$ pio run --target upload - -# Build specific environment -$ pio run -e esp32dev - -# Upload firmware for the specific environment -$ pio run -e esp32dev --target upload - -# Clean build files -$ pio run --target clean -``` diff --git a/examples/espidf-ulp-pulse/include/README b/examples/espidf-ulp-pulse/include/README deleted file mode 100644 index 194dcd432..000000000 --- a/examples/espidf-ulp-pulse/include/README +++ /dev/null @@ -1,39 +0,0 @@ - -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 deleted file mode 100644 index 6debab1e8..000000000 --- a/examples/espidf-ulp-pulse/lib/README +++ /dev/null @@ -1,46 +0,0 @@ - -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/test/README b/examples/espidf-ulp-pulse/test/README deleted file mode 100644 index df5066e64..000000000 --- a/examples/espidf-ulp-pulse/test/README +++ /dev/null @@ -1,11 +0,0 @@ - -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/wake_up.S b/examples/espidf-ulp-pulse/ulp/wake_up.S deleted file mode 100644 index 34b80b411..000000000 --- a/examples/espidf-ulp-pulse/ulp/wake_up.S +++ /dev/null @@ -1,16 +0,0 @@ -/* 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" - - .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/examples/espidf-ulp-adc/CMakeLists.txt b/examples/espidf-ulp-riscv/CMakeLists.txt similarity index 88% rename from examples/espidf-ulp-adc/CMakeLists.txt rename to examples/espidf-ulp-riscv/CMakeLists.txt index 7037f86d8..d49885b79 100644 --- a/examples/espidf-ulp-adc/CMakeLists.txt +++ b/examples/espidf-ulp-riscv/CMakeLists.txt @@ -3,4 +3,4 @@ cmake_minimum_required(VERSION 3.5) include($ENV{IDF_PATH}/tools/cmake/project.cmake) -project(ulp-adc-example) \ No newline at end of file +project(ulp_riscv_example) diff --git a/examples/espidf-ulp-riscv/README.md b/examples/espidf-ulp-riscv/README.md new file mode 100644 index 000000000..bfe9e639b --- /dev/null +++ b/examples/espidf-ulp-riscv/README.md @@ -0,0 +1,31 @@ +| Supported Targets | ESP32-S2 | ESP32-S3 | +| ----------------- | -------- | -------- | + +# ULP-RISC-V simple example with GPIO Polling: + +This example demonstrates how to program the ULP-RISC-V coprocessor to poll a gpio and wakeup the main CPU when it changes its state; + +ULP program written in C can be found across `ulp/main.c`. The build system compiles and links this program, converts it into binary format, and embeds it into the .rodata section of the ESP-IDF application. + +At runtime, the application running inside the main CPU loads ULP program into the `RTC_SLOW_MEM` memory region using `ulp_riscv_load_binary` function. The main code then configures the ULP wakeup period and starts the coprocessor by using `ulp_riscv_run`. Once the ULP program is started, it runs periodically, with the period set by the main program. The main program enables ULP wakeup source and puts the chip into deep sleep mode. + +When the ULP program finds an state changing in the pin, it saves the current state and sends a wakeup signal to the main CPU. + +Upon wakeup, the main program prints the current level of the measured gpio and go back to the deep sleep. + +In this example the input signal is connected to GPIO0. Note that this pin was chosen because most development boards have a button connected to it, so the pulses to be counted can be generated by pressing the button. For real world applications this is not a good choice of a pin, because GPIO0 also acts as a bootstrapping pin. To change the pin number, check the ESP32-S2 Chip Pin List document and adjust `gpio_num` and `ulp_io_number` variables in main.c. + + +## Example output + +``` +Not a ULP wakeup, initializing it! +Entering in deep sleep + +... + +ULP-RISC-V woke up the main CPU! +ULP-RISC-V read changes in GPIO_0 current is: High +Entering in deep sleep + +``` \ No newline at end of file diff --git a/examples/espidf-ulp-riscv/example_test.py b/examples/espidf-ulp-riscv/example_test.py new file mode 100644 index 000000000..cce2c6e01 --- /dev/null +++ b/examples/espidf-ulp-riscv/example_test.py @@ -0,0 +1,48 @@ +from __future__ import unicode_literals + +import re +import time + +import tiny_test_fw +import ttfw_idf +from tiny_test_fw import DUT + + +@ttfw_idf.idf_example_test(env_tag='Example_GENERIC', target=['esp32s2', 'esp32s3']) +def test_examples_ulp_riscv(env, extra_data): # type: (tiny_test_fw.Env.Env, None) -> None # pylint: disable=unused-argument + dut = env.get_dut('ulp_riscv', 'examples/system/ulp_riscv/gpio') + dut.start_app() + + dut.expect_all('Not a ULP-RISC-V wakeup, initializing it!', + 'Entering in deep sleep', + timeout=30) + + # Give the chip time to enter deepsleep + time.sleep(1) + + # Run two times to make sure device sleep + # and wake up properly + for i in range(0, 2): + # Set GPIO0 using DTR + dut.port_inst.setDTR(i % 2 == 0) + + dut.expect('ULP-RISC-V woke up the main CPU!', timeout=5) + + # Check GPIO state + state = 'Low' if i % 2 == 0 else 'High' + dut.expect(re.compile(r'ULP-RISC-V read changes in GPIO_0 current is: %s' % state), timeout=5) + + # Go back to sleep + dut.expect('Entering in deep sleep', timeout=5) + + try: + # We expect a timeout here, otherwise it means that + # the main CPU woke up unexpectedly! + dut.expect('ULP-RISC-V woke up the main CPU!', timeout=20) + raise Exception('Main CPU woke up unexpectedly!') + except DUT.ExpectTimeout: + pass + + +if __name__ == '__main__': + test_examples_ulp_riscv() diff --git a/examples/espidf-ulp-adc/main/CMakeLists.txt b/examples/espidf-ulp-riscv/main/CMakeLists.txt similarity index 52% rename from examples/espidf-ulp-adc/main/CMakeLists.txt rename to examples/espidf-ulp-riscv/main/CMakeLists.txt index d8758a909..b2f277f2e 100644 --- a/examples/espidf-ulp-adc/main/CMakeLists.txt +++ b/examples/espidf-ulp-riscv/main/CMakeLists.txt @@ -1,23 +1,27 @@ -idf_component_register(SRCS "ulp_adc_example_main.c" - INCLUDE_DIRS "" - REQUIRES soc nvs_flash ulp driver esp_adc) +# Set usual component variables +set(COMPONENT_SRCS "ulp_riscv_example_main.c") +set(COMPONENT_ADD_INCLUDEDIRS "") +set(COMPONENT_REQUIRES soc nvs_flash ulp driver) + +register_component() + # # ULP support additions to component CMakeLists.txt. # # 1. The ULP app name must be unique (if multiple components use ULP). -set(ulp_app_name ulp_main) +set(ulp_app_name ulp_${COMPONENT_NAME}) # -# 2. Specify all assembly source files. +# 2. Specify all C and Assembly source files. # Files should be placed into a separate directory (in this case, ulp/), # which should not be added to COMPONENT_SRCS. -set(ulp_s_sources "../ulp/adc.S") +set(ulp_riscv_sources "../ulp/main.c") + # # 3. List all the component source files which include automatically # generated ULP export file, ${ulp_app_name}.h: -set(ulp_exp_dep_srcs "ulp_adc_example_main.c") +set(ulp_exp_dep_srcs "ulp_riscv_example_main.c") + # # 4. Call function to build ULP binary and embed in project using the argument # values above. -ulp_embed_binary(${ulp_app_name} "${ulp_s_sources}" "${ulp_exp_dep_srcs}") - -target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format") +ulp_embed_binary(${ulp_app_name} "${ulp_riscv_sources}" "${ulp_exp_dep_srcs}") diff --git a/examples/espidf-ulp-riscv/main/ulp_riscv_example_main.c b/examples/espidf-ulp-riscv/main/ulp_riscv_example_main.c new file mode 100644 index 000000000..42fb16b11 --- /dev/null +++ b/examples/espidf-ulp-riscv/main/ulp_riscv_example_main.c @@ -0,0 +1,74 @@ +/* ULP riscv DS18B20 1wire temperature sensor 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 "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 "ulp_riscv.h" +#include "ulp_main.h" +#include "freertos/FreeRTOS.h" +#include "freertos/task.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(void); + +void app_main(void) +{ + /* Initialize selected GPIO as RTC IO, enable input, disable pullup and pulldown */ + rtc_gpio_init(GPIO_NUM_0); + rtc_gpio_set_direction(GPIO_NUM_0, RTC_GPIO_MODE_INPUT_ONLY); + rtc_gpio_pulldown_dis(GPIO_NUM_0); + rtc_gpio_pullup_dis(GPIO_NUM_0); + rtc_gpio_hold_en(GPIO_NUM_0); + + esp_sleep_wakeup_cause_t cause = esp_sleep_get_wakeup_cause(); + /* not a wakeup from ULP, load the firmware */ + if (cause != ESP_SLEEP_WAKEUP_ULP) { + printf("Not a ULP-RISC-V wakeup, initializing it! \n"); + init_ulp_program(); + } + + /* ULP Risc-V read and detected a change in GPIO_0, prints */ + if (cause == ESP_SLEEP_WAKEUP_ULP) { + printf("ULP-RISC-V woke up the main CPU! \n"); + printf("ULP-RISC-V read changes in GPIO_0 current is: %s \n", + (bool)(ulp_gpio_level_previous == 0) ? "Low" : "High" ); + + } + + /* Go back to sleep, only the ULP Risc-V will run */ + printf("Entering in deep sleep\n\n"); + + /* Small delay to ensure the messages are printed */ + vTaskDelay(100); + + ESP_ERROR_CHECK( esp_sleep_enable_ulp_wakeup()); + esp_deep_sleep_start(); +} + +static void init_ulp_program(void) +{ + esp_err_t err = ulp_riscv_load_binary(ulp_main_bin_start, (ulp_main_bin_end - ulp_main_bin_start)); + ESP_ERROR_CHECK(err); + + /* The first argument is the period index, which is not used by the ULP-RISC-V timer + * The second argument is the period in microseconds, which gives a wakeup time period of: 20ms + */ + ulp_set_wakeup_period(0, 20000); + + /* Start the program */ + err = ulp_riscv_run(); + ESP_ERROR_CHECK(err); +} \ No newline at end of file diff --git a/examples/espidf-ulp-adc/platformio.ini b/examples/espidf-ulp-riscv/platformio.ini similarity index 66% rename from examples/espidf-ulp-adc/platformio.ini rename to examples/espidf-ulp-riscv/platformio.ini index 9d7ba651a..2cc98730b 100644 --- a/examples/espidf-ulp-adc/platformio.ini +++ b/examples/espidf-ulp-riscv/platformio.ini @@ -5,12 +5,17 @@ ; Library options: dependencies, extra library storages ; ; Please visit documentation for the other options and examples -; https://docs.platformio.org/page/projectconf.html +; http://docs.platformio.org/page/projectconf.html [platformio] src_dir = main -[env:esp32dev] +[env:esp32-s2] platform = espressif32 framework = espidf -board = esp32dev +board = esp32-s2-saola-1 + +[env:esp32-s3] +platform = espressif32 +framework = espidf +board = esp32-s3-devkitc-1 diff --git a/examples/espidf-ulp-pulse/sdkconfig.defaults b/examples/espidf-ulp-riscv/sdkconfig.defaults similarity index 53% rename from examples/espidf-ulp-pulse/sdkconfig.defaults rename to examples/espidf-ulp-riscv/sdkconfig.defaults index 1dffd2c78..302c87aa9 100644 --- a/examples/espidf-ulp-pulse/sdkconfig.defaults +++ b/examples/espidf-ulp-riscv/sdkconfig.defaults @@ -1,10 +1,5 @@ -# Enable ULP -CONFIG_ULP_COPROC_ENABLED=y -CONFIG_ULP_COPROC_TYPE_FSM=y -CONFIG_ULP_COPROC_RESERVE_MEM=1024 # Set log level to Warning to produce clean output CONFIG_BOOTLOADER_LOG_LEVEL_WARN=y CONFIG_BOOTLOADER_LOG_LEVEL=2 CONFIG_LOG_DEFAULT_LEVEL_WARN=y CONFIG_LOG_DEFAULT_LEVEL=2 -CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP=y diff --git a/examples/espidf-ulp-riscv/sdkconfig.defaults.esp32s2 b/examples/espidf-ulp-riscv/sdkconfig.defaults.esp32s2 new file mode 100644 index 000000000..039f3584c --- /dev/null +++ b/examples/espidf-ulp-riscv/sdkconfig.defaults.esp32s2 @@ -0,0 +1,7 @@ +# Enable ULP +CONFIG_ESP32S2_ULP_COPROC_ENABLED=y +CONFIG_ESP32S2_ULP_COPROC_RISCV=y +CONFIG_ESP32S2_ULP_COPROC_RESERVE_MEM=4096 +CONFIG_ULP_COPROC_ENABLED=y +CONFIG_ULP_COPROC_RESERVE_MEM=4096 +CONFIG_ULP_COPROC_TYPE_RISCV=y \ No newline at end of file diff --git a/examples/espidf-ulp-riscv/sdkconfig.defaults.esp32s3 b/examples/espidf-ulp-riscv/sdkconfig.defaults.esp32s3 new file mode 100644 index 000000000..df96a349d --- /dev/null +++ b/examples/espidf-ulp-riscv/sdkconfig.defaults.esp32s3 @@ -0,0 +1,7 @@ +# Enable ULP +CONFIG_ESP32S3_ULP_COPROC_ENABLED=y +CONFIG_ESP32S3_ULP_COPROC_RISCV=y +CONFIG_ESP32S3_ULP_COPROC_RESERVE_MEM=4096 +CONFIG_ULP_COPROC_ENABLED=y +CONFIG_ULP_COPROC_RESERVE_MEM=4096 +CONFIG_ULP_COPROC_TYPE_RISCV=y diff --git a/examples/espidf-ulp-riscv/ulp/main.c b/examples/espidf-ulp-riscv/ulp/main.c new file mode 100644 index 000000000..91e8a3d22 --- /dev/null +++ b/examples/espidf-ulp-riscv/ulp/main.c @@ -0,0 +1,41 @@ +/* ULP-RISC-V 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. + + This code runs on ULP-RISC-V coprocessor +*/ + +#include +#include +#include +#include "ulp_riscv.h" +#include "ulp_riscv_utils.h" +#include "ulp_riscv_gpio.h" + +static bool gpio_level = false; + +/* this variable will be exported as a public symbol, visible from main CPU: */ +bool gpio_level_previous = false; + +int main (void) +{ + gpio_level = (bool)ulp_riscv_gpio_get_level(GPIO_NUM_0); + gpio_level_previous = gpio_level; + + while(1) { + gpio_level = (bool)ulp_riscv_gpio_get_level(GPIO_NUM_0); + + /* Wakes up the main CPU if pin changed its state */ + if(gpio_level != gpio_level_previous) { + gpio_level_previous = gpio_level; + ulp_riscv_wakeup_main_processor(); + break; + } + } + /* ulp_riscv_halt() is called automatically when main exits */ + return 0; +} diff --git a/examples/espidf-storage-spiffs/CMakeLists.txt b/examples/espidf-ulp/CMakeLists.txt similarity index 91% rename from examples/espidf-storage-spiffs/CMakeLists.txt rename to examples/espidf-ulp/CMakeLists.txt index 1894b31ca..13c487bc5 100644 --- a/examples/espidf-storage-spiffs/CMakeLists.txt +++ b/examples/espidf-ulp/CMakeLists.txt @@ -3,4 +3,4 @@ cmake_minimum_required(VERSION 3.5) include($ENV{IDF_PATH}/tools/cmake/project.cmake) -project(spiffs) +project(ulp_example) diff --git a/examples/espidf-ulp/Makefile b/examples/espidf-ulp/Makefile new file mode 100644 index 000000000..b9b17e5ef --- /dev/null +++ b/examples/espidf-ulp/Makefile @@ -0,0 +1,8 @@ +# +# This is a project Makefile. It is assumed the directory this Makefile resides in is a +# project subdirectory. +# + +PROJECT_NAME := ulp_example + +include $(IDF_PATH)/make/project.mk diff --git a/examples/espidf-ulp/README.md b/examples/espidf-ulp/README.md new file mode 100644 index 000000000..afb7c6c45 --- /dev/null +++ b/examples/espidf-ulp/README.md @@ -0,0 +1,57 @@ +| Supported Targets | ESP32 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | + +# ULP Pulse Counting Example + +This example demonstrates how to program the ULP FSM coprocessor to count pulses on an IO while the main CPUs are either running some other code or are in deep sleep. See the README.md file in the upper level 'examples' directory for more information about examples. + +ULP program written in assembly can be found across `ulp/pulse_cnt.S` and `ulp/wake_up.S` (demonstrating multiple ULP source files). The build system assembles and links this program, converts it into binary format, and embeds it into the .rodata section of the ESP-IDF application. + +At runtime, the main code running on the ESP32 (found in main.c) loads ULP program into the `RTC_SLOW_MEM` memory region using `ulp_load_binary` function. Main code configures the ULP program by setting up values of some variables and then starts it using `ulp_run`. Once the ULP program is started, it runs periodically, with the period set by the main program. The main program enables ULP wakeup source and puts the chip into deep sleep mode. + +When the ULP program finds an edge in the input signal, it performs debouncing and increments the variable maintaining the total edge count. Once the edge count reaches certain value (set by the main program), ULP triggers wake up from deep sleep. Note that the ULP program keeps running and monitoring the input signal even when the SoC is woken up. + +Upon wakeup, the main program saves total edge count into NVS and returns to deep sleep. + +In this example the input signal is connected to GPIO0. Note that this pin was chosen because most development boards have a button connected to it, so the pulses to be counted can be generated by pressing the button. For real world applications this is not a good choice of a pin, because GPIO0 also acts as a bootstrapping pin. To change the pin number, check the ESP32 Chip Pin List document and adjust `gpio_num` and `ulp_io_number` variables in main.c. + +In this example, the `CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP` Kconfig option is used, which allows you to reduce the boot time of the bootloader during waking up from deep sleep. The bootloader stores in rtc memory the address of a running partition and uses it when it wakes up. This example allows you to skip all image checks and speed up the boot. + +## Example output + +``` +Not ULP wakeup, initializing ULP +Entering deep sleep + +ULP wakeup, saving pulse count +Read pulse count from NVS: 384 +Pulse count from ULP: 5 +Wrote updated pulse count to NVS: 389 +Entering deep sleep + +ULP wakeup, saving pulse count +Read pulse count from NVS: 389 +Pulse count from ULP: 5 +Wrote updated pulse count to NVS: 394 +Entering deep sleep + +ULP wakeup, saving pulse count +Read pulse count from NVS: 394 +Pulse count from ULP: 6 +Wrote updated pulse count to NVS: 400 +Entering deep sleep + +ULP wakeup, saving pulse count +Read pulse count from NVS: 400 +Pulse count from ULP: 5 +Wrote updated pulse count to NVS: 405 +Entering deep sleep +``` + +Note that in one case the pulse count captured by the ULP program is 6, even though the `edge_count_to_wake_up` variable is set to 10 by the main program. This shows that the ULP program keeps track of pulses while the main CPUs are starting up, so when pulses are sent rapidly it is possible to register more pulses between wake up and entry into app_main. + +With the default configuration (20ms ULP wakeup period), average current consumption in deep sleep mode is 16uA. + +## Typical current consumption + +![CurrentConsumption](image/ulp_power_graph.png) diff --git a/examples/espidf-ulp/example_test.py b/examples/espidf-ulp/example_test.py new file mode 100644 index 000000000..4c7840e71 --- /dev/null +++ b/examples/espidf-ulp/example_test.py @@ -0,0 +1,45 @@ +from __future__ import unicode_literals + +import re +import time + +import ttfw_idf +from tiny_test_fw import Utility + + +@ttfw_idf.idf_example_test(env_tag='Example_GENERIC', target=['esp32']) +def test_examples_ulp(env, extra_data): + + dut = env.get_dut('ulp', 'examples/system/ulp_fsm/ulp') + dut.start_app() + + dut.expect_all('Not ULP wakeup, initializing ULP', + 'Entering deep sleep', + timeout=30) + + def generate_gpio0_events(): + for _ in range(5): + dut.port_inst.setDTR(True) # Pulling GPIO0 low using DTR + time.sleep(0.25) + dut.port_inst.setDTR(False) + time.sleep(0.25) + + nvs_value = None + for _ in range(5): + generate_gpio0_events() + dut.expect('ULP wakeup, saving pulse count', timeout=5) + Utility.console_log('Woke up...') + init_count = int(dut.expect(re.compile(r'Read pulse count from NVS:\s+(\d+)'), timeout=5)[0], 10) + assert nvs_value in (init_count, None), ('Read count is {} and previously written value is {}' + ''.format(init_count, nvs_value)) + inc = int(dut.expect(re.compile(r'Pulse count from ULP:\s+(\d+)'), timeout=5)[0], 10) + assert inc in (5, 6), 'pulse count is {}'.format(inc) + new_count = int(dut.expect(re.compile(r'Wrote updated pulse count to NVS:\s+(\d+)'), timeout=5)[0], 10) + assert init_count + inc == new_count, '{} + {} != {}'.format(init_count, inc, new_count) + nvs_value = new_count + Utility.console_log('Pulse count written to NVS: {}. Entering deep sleep...'.format(nvs_value)) + dut.expect('Entering deep sleep', timeout=5) + + +if __name__ == '__main__': + test_examples_ulp() diff --git a/examples/espidf-ulp/image/ulp_power_graph.png b/examples/espidf-ulp/image/ulp_power_graph.png new file mode 100644 index 0000000000000000000000000000000000000000..79dfb10dd79a59f3ad52fbb9bcc696142d24a6a4 GIT binary patch literal 39281 zcmdqJcRZJU8$SL)DH4V3hzcRQ$WF>0+1Yzxq8OhGh-g}eH_q^(U z?&taa^ZV!f-}iYvz3$>OuIv4NpXYg;$8nsOpPY>7Wo$BR6bf}&TuekBg+lj4q0lBS zV!}`Eb&t%zf6mzpiz{A)|G8Z>cnkl=vJrb`k3!+;B7e{_1k+97huqH}t3Fq-HhS)) zYiEeE)O~JaVg1~~RPTnPp`E>{wG{_58#6o84U^~3ZFpE%{`-4oYdd3>+x|%sDAWy< zxX44r7qKg&&KiWfXBRdGv})_^=u8ox=!=kM_%JHOibT#D?V2oxeHM8QLY#p84D!rwXId| zacoCjWosh2NbP+^_-)^nm~wRZ%SGx>E>F?LkRR$9(xcr%epJBz5rq%G@m3|3Kw%*- z|BQ3n^UsTwees2m-&|pQgmvT32Zbe_dyjlf!wOgk8~_6A555T9UXTtVMD3d-Yr5LoXe3bN{C)Pm)Y~(&!l&>a{&ie8%06 zF6%c1)GhU8OKVEk5n`Vodog|avt~tquhN~H0s@qG?%X+E?(J1gCaIQUgtAXJ;E5n=aSr+m~>0pV-*2o*j;q*+=p^F~9cmVzZn1&c3ZMC3^Ad zI~ggjNX!(4+OqIu(z$f`T zbDas=Mr!i%_#!k{l|QSZq2w6CA_YAJ$nINQqQt^9FM3%2%I1GZ7LIO;zoUc~w;K!ur$D(8#H(sv4Em9B*BM zd&MZz2#UUEj;!hT@84O?)Gt!^`MbdBsN{G3o#=jY2*2=p8ZKzkb%WDl@QOdtUE!8& zSw)6xF27g&y1L|;G|LI$E>WI0MS~Jyc}#lJF4Nq+NloN`m4Ltt?rO4A@T@_SrRr1h z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tCs`B;@QHEZ0Q8oY+a*@WTV=w2UWtT6f3fad`t`4?-up z&0Dq{TC?X$P~4a||44GM&O?4h!<7DmxXO4{)<%QJkMe`i{}m4Wfz1D(KYl|mInn+K zojG1s74Y!VWC3K~9gJ=d%2LBCptxm$i!xcc#L)!nXx}O&KHd_>xGE+dUa#|LIr%0m zY)48s;O|z%`H#Dsvvj&nz z0m7_brZ&8P$*v!0G0}upU2>rLnnQ!fCn#8y>|Se4Q~z_DOE z+VcQPQT(qidfsgk6jb9C;e9ENxW-ct_XG!yj69G;j)UjkD-OdOK^*dPeLQgA%t`an z*98twL>5}7_WRaPE&Of&FJe;T3R90!xkX{(@+kXKH#Go)iP*-{vLpBENhd(@%(wjg_1%e!+>2r^25)MD6V5(g}@ zIkXCJwKxOY0+24u+rO=Ai^Ty#N|@)K#SL^8LRL|c9%9m(cjutRFl&%)D7)|M3?k3^1#)uDbVq5{@fKi*X2Uy=?D_EZxiAA1s!5XmK|m zZwi|`7E|kRdoe8;3_+3vN7W{r&EYh@f zU=YJ^urEvi5eaz&#q?qzmZ3WK#ef_IcnfrJ1ztDw4cO3TY6BAHbTA zG5fhsBgrg#d=kAAbdg}K+NH;cK0)O0kgf2rP2s5c&vu)ctxnj#;$+jN`?=ArU(^y@ zzr1xgP3N|C8C_g1wuQ|1OmsQ?2rfO};9IaEu5#Pxq*SemsHJAe_h0;qcXH1awpqNZHbzt! z7IsLpoVx31i0YFs7e6+cYelPdq#XUeTe~nr=1kf|6iU*F$MeWnM@qYlPvl*cP literal 0 HcmV?d00001 diff --git a/examples/espidf-ulp-pulse/src/CMakeLists.txt b/examples/espidf-ulp/main/CMakeLists.txt old mode 100644 new mode 100755 similarity index 90% rename from examples/espidf-ulp-pulse/src/CMakeLists.txt rename to examples/espidf-ulp/main/CMakeLists.txt index cea7e85e2..6ded342e1 --- a/examples/espidf-ulp-pulse/src/CMakeLists.txt +++ b/examples/espidf-ulp/main/CMakeLists.txt @@ -5,7 +5,7 @@ idf_component_register(SRCS "ulp_example_main.c" # ULP support additions to component CMakeLists.txt. # # 1. The ULP app name must be unique (if multiple components use ULP). -set(ulp_app_name ulp_main) +set(ulp_app_name ulp_${COMPONENT_NAME}) # # 2. Specify all assembly source files. # Files should be placed into a separate directory (in this case, ulp/), @@ -19,5 +19,3 @@ set(ulp_exp_dep_srcs "ulp_example_main.c") # 4. Call function to build ULP binary and embed in project using the argument # values above. ulp_embed_binary(${ulp_app_name} "${ulp_s_sources}" "${ulp_exp_dep_srcs}") - -target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format") diff --git a/examples/espidf-ulp-pulse/src/ulp_example_main.c b/examples/espidf-ulp/main/ulp_example_main.c old mode 100644 new mode 100755 similarity index 88% rename from examples/espidf-ulp-pulse/src/ulp_example_main.c rename to examples/espidf-ulp/main/ulp_example_main.c index c7cac8783..226ebef2e --- a/examples/espidf-ulp-pulse/src/ulp_example_main.c +++ b/examples/espidf-ulp/main/ulp_example_main.c @@ -8,6 +8,7 @@ */ #include +#include #include "esp_sleep.h" #include "nvs.h" #include "nvs_flash.h" @@ -16,7 +17,13 @@ #include "soc/rtc_periph.h" #include "driver/gpio.h" #include "driver/rtc_io.h" -#include "ulp.h" +#if CONFIG_IDF_TARGET_ESP32 +#include "esp32/ulp.h" +#elif CONFIG_IDF_TARGET_ESP32S2 +#include "esp32s2/ulp.h" +#elif CONFIG_IDF_TARGET_ESP32S3 +#include "esp32s3/ulp.h" +#endif #include "ulp_main.h" extern const uint8_t ulp_main_bin_start[] asm("_binary_ulp_main_bin_start"); @@ -97,27 +104,27 @@ static void init_ulp_program(void) static void update_pulse_count(void) { - const char* namespace = "plusecnt"; + const char* nvs_namespace = "plusecnt"; const char* count_key = "count"; ESP_ERROR_CHECK( nvs_flash_init() ); nvs_handle_t handle; - ESP_ERROR_CHECK( nvs_open(namespace, NVS_READWRITE, &handle)); + ESP_ERROR_CHECK( nvs_open(nvs_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); + printf("Read pulse count from NVS: %5" PRIu32"\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); + printf("Pulse count from ULP: %5" PRIu32"\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); + printf("Wrote updated pulse count to NVS: %5" PRIu32"\n", pulse_count); } diff --git a/examples/espidf-ulp-pulse/platformio.ini b/examples/espidf-ulp/platformio.ini similarity index 59% rename from examples/espidf-ulp-pulse/platformio.ini rename to examples/espidf-ulp/platformio.ini index cb1573370..55cf15bb7 100644 --- a/examples/espidf-ulp-pulse/platformio.ini +++ b/examples/espidf-ulp/platformio.ini @@ -5,9 +5,22 @@ ; Library options: dependencies, extra library storages ; ; Please visit documentation for the other options and examples -; https://docs.platformio.org/page/projectconf.html +; http://docs.platformio.org/page/projectconf.html + +[platformio] +src_dir = main [env:esp32dev] platform = espressif32 framework = espidf board = esp32dev + +[env:esp32-s2] +platform = espressif32 +framework = espidf +board = esp32-s2-saola-1 + +[env:esp32-s3] +platform = espressif32 +framework = espidf +board = esp32-s3-devkitc-1 diff --git a/examples/espidf-ulp-adc/sdkconfig.defaults b/examples/espidf-ulp/sdkconfig.defaults similarity index 100% rename from examples/espidf-ulp-adc/sdkconfig.defaults rename to examples/espidf-ulp/sdkconfig.defaults diff --git a/examples/espidf-ulp/sdkconfig.defaults.esp32 b/examples/espidf-ulp/sdkconfig.defaults.esp32 new file mode 100644 index 000000000..be391d8c4 --- /dev/null +++ b/examples/espidf-ulp/sdkconfig.defaults.esp32 @@ -0,0 +1,3 @@ +# Enable ULP +CONFIG_ESP32_ULP_COPROC_ENABLED=y +CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=1024 diff --git a/examples/espidf-ulp/sdkconfig.defaults.esp32s2 b/examples/espidf-ulp/sdkconfig.defaults.esp32s2 new file mode 100644 index 000000000..5175d2b6c --- /dev/null +++ b/examples/espidf-ulp/sdkconfig.defaults.esp32s2 @@ -0,0 +1,3 @@ +# Enable ULP +CONFIG_ESP32S2_ULP_COPROC_ENABLED=y +CONFIG_ESP32S2_ULP_COPROC_RESERVE_MEM=1024 diff --git a/examples/espidf-ulp/sdkconfig.defaults.esp32s3 b/examples/espidf-ulp/sdkconfig.defaults.esp32s3 new file mode 100644 index 000000000..f63dcae20 --- /dev/null +++ b/examples/espidf-ulp/sdkconfig.defaults.esp32s3 @@ -0,0 +1,3 @@ +# Enable ULP +CONFIG_ESP32S3_ULP_COPROC_ENABLED=y +CONFIG_ESP32S3_ULP_COPROC_RESERVE_MEM=1024 diff --git a/examples/espidf-ulp-pulse/ulp/pulse_cnt.S b/examples/espidf-ulp/ulp/pulse_cnt.S old mode 100644 new mode 100755 similarity index 100% rename from examples/espidf-ulp-pulse/ulp/pulse_cnt.S rename to examples/espidf-ulp/ulp/pulse_cnt.S diff --git a/examples/espidf-ulp/ulp/wake_up.S b/examples/espidf-ulp/ulp/wake_up.S new file mode 100755 index 000000000..f6bf8fa3b --- /dev/null +++ b/examples/espidf-ulp/ulp/wake_up.S @@ -0,0 +1,30 @@ +/* + * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Unlicense OR CC0-1.0 + */ +/* 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" +#include "sdkconfig.h" + + .global wake_up +wake_up: + /* Check if the system is in sleep mode */ +#if CONFIG_IDF_TARGET_ESP32 + READ_RTC_REG(RTC_CNTL_LOW_POWER_ST_REG, 27, 1) +#else + READ_RTC_FIELD(RTC_CNTL_LOW_POWER_ST_REG, RTC_CNTL_MAIN_STATE_IN_IDLE) +#endif + move r1, r0 + /* Check if the system can be woken up */ + READ_RTC_FIELD(RTC_CNTL_LOW_POWER_ST_REG, RTC_CNTL_RDY_FOR_WAKEUP) + /* If the system is in normal mode or if the system is in sleep mode with ready for wakeup set, we can signal the main CPU to wakeup */ + or r0, r0, r1 + jump wake_up, eq + + /* Wake up the SoC, end program */ + wake + halt From 2b4db3215b763ffa0475790e5e3b87bdec3c0cac Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Mon, 15 Jul 2024 14:39:07 +0200 Subject: [PATCH 3/8] more changes --- README.md | 16 +--- platform.json | 81 ++++++++--------- platform.py | 244 +++++++------------------------------------------- 3 files changed, 74 insertions(+), 267 deletions(-) diff --git a/README.md b/README.md index 4cc9c51a9..61f6b6314 100644 --- a/README.md +++ b/README.md @@ -12,24 +12,12 @@ ESP32 is a series of low-cost, low-power system on a chip microcontrollers with 1. [Install PlatformIO](https://platformio.org) 2. Create PlatformIO project and configure a platform option in [platformio.ini](https://docs.platformio.org/page/projectconf.html) file: -## Stable version - -See `platform` [documentation](https://docs.platformio.org/en/latest/projectconf/sections/env/options/platform/platform.html#projectconf-env-platform) for details. - -```ini -[env:stable] -; recommended to pin to a version, see https://github.com/platformio/platform-espressif32/releases -; platform = espressif32 @ ^6.0.1 -platform = espressif32 -board = ... -... -``` - ## Development version ```ini [env:development] -platform = https://github.com/platformio/platform-espressif32.git +platform = https://github.com/jason2866/platform-espressif32.git#Arduino/IDF5_org + board = ... ... ``` diff --git a/platform.json b/platform.json index 78cc059cf..e2eb929a2 100644 --- a/platform.json +++ b/platform.json @@ -1,7 +1,7 @@ { "name": "espressif32", "title": "Espressif 32", - "description": "ESP32 is a series of low-cost, low-power system on a chip microcontrollers with integrated Wi-Fi and Bluetooth. ESP32 integrates an antenna switch, RF balun, power amplifier, low-noise receive amplifier, filters, and power management modules.", + "description": "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.", "homepage": "https://espressif.com/", "license": "Apache-2.0", "keywords": [ @@ -12,16 +12,15 @@ "RISC-V" ], "engines": { - "platformio": "^6" + "platformio": ">=6.1.15" }, "repository": { "type": "git", - "url": "https://github.com/platformio/platform-espressif32.git" + "url": "https://github.com/tasmota/platform-espressif32.git" }, - "version": "6.7.0", + "version": "2024.00.99", "frameworks": { "arduino": { - "package": "framework-arduinoespressif32", "script": "builder/frameworks/arduino.py" }, "espidf": { @@ -30,35 +29,47 @@ } }, "packages": { + "framework-arduinoespressif32": { + "type": "framework", + "optional": true, + "owner": "espressif", + "version": "https://github.com/espressif/arduino-esp32/archive/refs/heads/master.zip" + }, + "framework-arduinoespressif32-libs": { + "type": "framework", + "optional": true, + "owner": "espressif", + "version": "https://github.com/espressif/esp32-arduino-libs/archive/refs/heads/idf-release/v5.1.zip" + }, + "framework-espidf": { + "type": "framework", + "optional": true, + "owner": "jason2866", + "version": "https://github.com/Jason2866/esp-idf/releases/download/v5.1.4.240625/esp-idf-v5.1.4.zip" + }, "toolchain-xtensa-esp32": { "type": "toolchain", + "optional": true, "owner": "espressif", - "version": "8.4.0+2021r2-patch5" + "version": "12.2.0+20230208" }, "toolchain-xtensa-esp32s2": { "type": "toolchain", "optional": true, "owner": "espressif", - "version": "8.4.0+2021r2-patch5" + "version": "12.2.0+20230208" }, - "toolchain-xtensa-esp32s3": { + "toolchain-xtensa-esp32s3": { "type": "toolchain", "optional": true, "owner": "espressif", - "version": "8.4.0+2021r2-patch5" + "version": "12.2.0+20230208" }, "toolchain-riscv32-esp": { "type": "toolchain", "optional": true, "owner": "espressif", - "version": "8.4.0+2021r2-patch5", - "optionalVersions": ["13.2.0+20230928"] - }, - "toolchain-xtensa-esp-elf": { - "type": "toolchain", - "optional": true, - "owner": "platformio", - "version": "13.2.0+20230928" + "version": "12.2.0+20230208" }, "toolchain-esp32ulp": { "type": "toolchain", @@ -66,7 +77,7 @@ "owner": "platformio", "version": "~1.23500.0" }, - "tool-xtensa-esp-elf-gdb": { + "tool-xtensa-esp-elf-gdb": { "type": "debugger", "optional": true, "owner": "espressif", @@ -78,23 +89,10 @@ "owner": "espressif", "version": "~12.1.0" }, - "framework-arduinoespressif32": { - "type": "framework", - "optional": true, - "owner": "platformio", - "version": "~3.20017.0" - }, - "framework-espidf": { - "type": "framework", - "optional": true, - "owner": "platformio", - "version": "~3.50202.0", - "optionalVersions": ["~3.40407.0"] - }, "tool-esptoolpy": { "type": "uploader", - "owner": "platformio", - "version": "~1.40501.0" + "owner": "tasmota", + "version": "https://github.com/tasmota/esptool/releases/download/v4.7.3/esptool.zip" }, "tool-dfuutil-arduino": { "type": "uploader", @@ -108,28 +106,27 @@ "owner": "platformio", "version": "~2.1100.0" }, - "tool-mkspiffs": { + "tool-mklittlefs": { "type": "uploader", - "optional": true, - "owner": "platformio", - "version": "~2.230.0" + "owner": "tasmota", + "version": "^3.2.0" }, - "tool-mklittlefs": { + "tool-mkfatfs": { "type": "uploader", "optional": true, "owner": "platformio", - "version": "~1.203.0" + "version": "~2.0.0" }, - "tool-mkfatfs": { + "tool-mkspiffs": { "type": "uploader", "optional": true, "owner": "platformio", - "version": "~2.0.0" + "version": "~2.230.0" }, "tool-cmake": { "optional": true, "owner": "platformio", - "version": "~3.16.0" + "version": "~3.21.0" }, "tool-ninja": { "optional": true, diff --git a/platform.py b/platform.py index e0537875e..ff3397b00 100644 --- a/platform.py +++ b/platform.py @@ -17,6 +17,7 @@ import sys import json import re +import requests from platformio.public import PlatformBase, to_unix_path @@ -33,8 +34,12 @@ def configure_default_packages(self, variables, targets): mcu = variables.get("board_build.mcu", board_config.get("build.mcu", "esp32")) frameworks = variables.get("pioframework", []) + if "arduino" in frameworks: + self.packages["framework-arduinoespressif32"]["optional"] = False + self.packages["framework-arduinoespressif32-libs"]["optional"] = False + if "buildfs" in targets: - filesystem = variables.get("board_build.filesystem", "spiffs") + filesystem = variables.get("board_build.filesystem", "littlefs") if filesystem == "littlefs": self.packages["tool-mklittlefs"]["optional"] = False elif filesystem == "fatfs": @@ -46,111 +51,46 @@ def configure_default_packages(self, variables, targets): if os.path.isdir("ulp"): self.packages["toolchain-esp32ulp"]["optional"] = False + if "downloadfs" in targets: + filesystem = variables.get("board_build.filesystem", "littlefs") + if filesystem == "littlefs": + # Use Tasmota mklittlefs v4.0.0 to unpack, older version is incompatible + self.packages["tool-mklittlefs"]["version"] = "~4.0.0" + # Currently only Arduino Nano ESP32 uses the dfuutil tool as uploader if variables.get("board") == "arduino_nano_esp32": self.packages["tool-dfuutil-arduino"]["optional"] = False else: del self.packages["tool-dfuutil-arduino"] - build_core = variables.get( - "board_build.core", board_config.get("build.core", "arduino") - ).lower() - - if frameworks == ["arduino"] and build_core == "esp32": - # In case the upstream Arduino framework is specified in the configuration - # file then we need to dynamically extract toolchain versions from the - # Arduino index file. This feature can be disabled via a special option: - if ( - variables.get( - "board_build.arduino.upstream_packages", - board_config.get("build.arduino.upstream_packages", "yes"), - ).lower() - == "yes" - ): - package_version = self.packages["framework-arduinoespressif32"][ - "version" - ] - - url_items = urllib.parse.urlparse(package_version) - # Only GitHub repositories support dynamic packages - if ( - url_items.scheme in ("http", "https") - and url_items.netloc.startswith("github") - and url_items.path.endswith(".git") - ): - try: - self.configure_upstream_arduino_packages(url_items) - except Exception as e: - sys.stderr.write( - "Error! Failed to extract upstream toolchain" - "configurations:\n%s\n" % str(e) - ) - sys.stderr.write( - "You can disable this feature via the " - "`board_build.arduino.upstream_packages = no` setting in " - "your `platformio.ini` file.\n" - ) - sys.exit(1) - + # Starting from v12, Espressif's toolchains are shipped without + # bundled GDB. Instead, it's distributed as separate packages for Xtensa + # and RISC-V targets. + for gdb_package in ("tool-xtensa-esp-elf-gdb", "tool-riscv32-esp-elf-gdb"): + self.packages[gdb_package]["optional"] = False + if IS_WINDOWS: + # Note: On Windows GDB v12 is not able to + # launch a GDB server in pipe mode while v11 works fine + self.packages[gdb_package]["version"] = "~11.2.0" + + # Common packages for IDF and mixed Arduino+IDF projects if "espidf" in frameworks: - if frameworks == ["espidf"]: - # Starting from v12, Espressif's toolchains are shipped without - # bundled GDB. Instead, it's distributed as separate packages for Xtensa - # and RISC-V targets. Currently only IDF depends on the latest toolchain - for gdb_package in ("tool-xtensa-esp-elf-gdb", "tool-riscv32-esp-elf-gdb"): - self.packages[gdb_package]["optional"] = False - if IS_WINDOWS: - # Note: On Windows GDB v12 is not able to - # launch a GDB server in pipe mode while v11 works fine - self.packages[gdb_package]["version"] = "~11.2.0" - - # Common packages for IDF and mixed Arduino+IDF projects + self.packages["toolchain-esp32ulp"]["optional"] = False for p in self.packages: - if p in ("tool-cmake", "tool-ninja", "toolchain-esp32ulp"): + if p in ("tool-cmake", "tool-ninja"): self.packages[p]["optional"] = False elif p in ("tool-mconf", "tool-idf") and IS_WINDOWS: self.packages[p]["optional"] = False - if "arduino" in frameworks: - # Downgrade the IDF version for mixed Arduino+IDF projects - self.packages["framework-espidf"]["version"] = "~3.40407.0" - # Delete the latest toolchain packages from config - self.packages.pop("toolchain-xtensa-esp-elf", None) + for available_mcu in ("esp32", "esp32s2", "esp32s3"): + if available_mcu == mcu: + self.packages["toolchain-xtensa-%s" % mcu]["optional"] = False else: - # Disable old toolchain packages and use the latest - # available for IDF v5.0 - for target in ( - "xtensa-esp32", - "xtensa-esp32s2", - "xtensa-esp32s3", - ): - self.packages.pop("toolchain-%s" % target, None) - - if mcu in ("esp32c3", "esp32c6"): - self.packages.pop("toolchain-xtensa-esp-elf", None) - else: - self.packages["toolchain-xtensa-esp-elf"][ - "optional" - ] = False - - # Pull the latest RISC-V toolchain from PlatformIO organization - self.packages["toolchain-riscv32-esp"]["owner"] = "platformio" - self.packages["toolchain-riscv32-esp"][ - "version" - ] = "13.2.0+20230928" - - if "arduino" in frameworks: - # Disable standalone GDB packages for Arduino and Arduino/IDF projects - for gdb_package in ("tool-xtensa-esp-elf-gdb", "tool-riscv32-esp-elf-gdb"): - self.packages.pop(gdb_package, None) - - for available_mcu in ("esp32", "esp32s2", "esp32s3"): - if available_mcu == mcu: - self.packages["toolchain-xtensa-%s" % mcu]["optional"] = False - else: - self.packages.pop("toolchain-xtensa-%s" % available_mcu, None) + self.packages.pop("toolchain-xtensa-%s" % available_mcu, None) - if mcu in ("esp32s2", "esp32s3", "esp32c3", "esp32c6"): + if mcu in ("esp32s2", "esp32s3", "esp32c2", "esp32c3", "esp32c6", "esp32h2"): + if mcu in ("esp32c2", "esp32c3", "esp32c6", "esp32h2"): + self.packages.pop("toolchain-esp32ulp", None) # RISC-V based toolchain for ESP32C3, ESP32C6 ESP32S2, ESP32S3 ULP self.packages["toolchain-riscv32-esp"]["optional"] = False @@ -191,11 +131,7 @@ def _add_dynamic_options(self, board): "tumpa", ] - # A special case for the Kaluga board that has a separate interface config - if board.id == "esp32-s2-kaluga-1": - supported_debug_tools.append("ftdi") - - if board.get("build.mcu", "") in ("esp32c3", "esp32c6", "esp32s3"): + if board.get("build.mcu", "") in ("esp32c3", "esp32c6", "esp32s3", "esp32h2"): supported_debug_tools.append("esp-builtin") upload_protocol = board.manifest.get("upload", {}).get("protocol") @@ -265,10 +201,6 @@ def _add_dynamic_options(self, board): "default": link == debug.get("default_tool"), } - # Avoid erasing Arduino Nano bootloader by preloading app binary - if board.id == "arduino_nano_esp32": - debug["tools"][link]["load_cmds"] = "preload" - board.manifest["debug"] = debug return board @@ -304,113 +236,3 @@ def configure_debug_session(self, debug_config): ) ) debug_config.load_cmds = load_cmds - - @staticmethod - def extract_toolchain_versions(tool_deps): - def _parse_version(original_version): - assert original_version - version_patterns = ( - r"^gcc(?P\d+)_(?P\d+)_(?P\d+)-esp-(?P.+)$", - r"^esp-(?P.+)-(?P\d+)\.(?P\d+)\.?(?P\d+)$", - r"^esp-(?P\d+)\.(?P\d+)\.(?P\d+)(_(?P.+))?$", - ) - for pattern in version_patterns: - match = re.search(pattern, original_version) - if match: - result = "%s.%s.%s" % ( - match.group("MAJOR"), - match.group("MINOR"), - match.group("PATCH"), - ) - if match.group("EXTRA"): - result = result + "+%s" % match.group("EXTRA") - return result - - raise ValueError("Bad package version `%s`" % original_version) - - if not tool_deps: - raise ValueError( - ("Failed to extract tool dependencies from the remote package file") - ) - - toolchain_remap = { - "xtensa-esp32-elf-gcc": "toolchain-xtensa-esp32", - "xtensa-esp32s2-elf-gcc": "toolchain-xtensa-esp32s2", - "xtensa-esp32s3-elf-gcc": "toolchain-xtensa-esp32s3", - "riscv32-esp-elf-gcc": "toolchain-riscv32-esp", - } - - result = dict() - for tool in tool_deps: - if tool["name"] in toolchain_remap: - result[toolchain_remap[tool["name"]]] = _parse_version(tool["version"]) - - return result - - @staticmethod - def parse_tool_dependencies(index_data): - for package in index_data.get("packages", []): - if package["name"] == "esp32": - for platform in package["platforms"]: - if platform["name"] == "esp32": - return platform["toolsDependencies"] - - return [] - - @staticmethod - def download_remote_package_index(url_items): - def _prepare_url_for_index_file(url_items): - tag = "master" - if url_items.fragment: - tag = url_items.fragment - return ( - "https://raw.githubusercontent.com/%s/" - "%s/package/package_esp32_index.template.json" - % (url_items.path.replace(".git", ""), tag) - ) - - index_file_url = _prepare_url_for_index_file(url_items) - - try: - from platformio.public import fetch_http_content - content = fetch_http_content(index_file_url) - except ImportError: - import requests - content = requests.get(index_file_url, timeout=5).text - - return json.loads(content) - - def configure_arduino_toolchains(self, package_index): - if not package_index: - return - - toolchain_packages = self.extract_toolchain_versions( - self.parse_tool_dependencies(package_index) - ) - for toolchain_package, version in toolchain_packages.items(): - if toolchain_package not in self.packages: - self.packages[toolchain_package] = dict() - self.packages[toolchain_package]["version"] = version - self.packages[toolchain_package]["owner"] = "espressif" - self.packages[toolchain_package]["type"] = "toolchain" - - def configure_upstream_arduino_packages(self, url_items): - framework_index_file = os.path.join( - self.get_package_dir("framework-arduinoespressif32") or "", - "package", - "package_esp32_index.template.json", - ) - - # Detect whether the remote is already cloned - if os.path.isfile(framework_index_file) and os.path.isdir( - os.path.join( - self.get_package_dir("framework-arduinoespressif32") or "", ".git" - ) - ): - with open(framework_index_file) as fp: - self.configure_arduino_toolchains(json.load(fp)) - else: - print("Configuring toolchain packages from a remote source...") - self.configure_arduino_toolchains( - self.download_remote_package_index(url_items) - ) From e8a070561e467431840ed9932bfc973512f58f29 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Mon, 15 Jul 2024 14:42:19 +0200 Subject: [PATCH 4/8] Arduino 3.0.2 based on IDF 5.1.4 (#2) --- boards/4d_systems_esp32s3_gen4_r8n16.json | 3 +- boards/esp32-c2-devkitm-1.json | 30 ++++++++++++++++++ boards/esp32-c6-devkitc-1.json | 7 ++++- boards/esp32-c6-devkitm-1.json | 1 + boards/esp32-h2-devkitm-1.json | 38 +++++++++++++++++++++++ boards/esp32-solo1.json | 37 ++++++++++++++++++++++ 6 files changed, 113 insertions(+), 3 deletions(-) create mode 100644 boards/esp32-c2-devkitm-1.json create mode 100644 boards/esp32-h2-devkitm-1.json create mode 100644 boards/esp32-solo1.json diff --git a/boards/4d_systems_esp32s3_gen4_r8n16.json b/boards/4d_systems_esp32s3_gen4_r8n16.json index 4418be557..753980a74 100644 --- a/boards/4d_systems_esp32s3_gen4_r8n16.json +++ b/boards/4d_systems_esp32s3_gen4_r8n16.json @@ -1,9 +1,8 @@ { "build": { "arduino": { - "ldscript": "esp32s3_out.ld", "memory_type": "qio_opi", - "partitions": "default_16MB.csv" + "partitions": "esp_sr_16.csv" }, "core": "esp32", "extra_flags": [ diff --git a/boards/esp32-c2-devkitm-1.json b/boards/esp32-c2-devkitm-1.json new file mode 100644 index 000000000..eb3a58c50 --- /dev/null +++ b/boards/esp32-c2-devkitm-1.json @@ -0,0 +1,30 @@ +{ + "build": { + "core": "esp32", + "f_cpu": "120000000L", + "f_flash": "60000000L", + "flash_mode": "qio", + "mcu": "esp32c2", + "variant": "esp32c2" + }, + "connectivity": [ + "wifi" + ], + "debug": { + "openocd_target": "esp32c2.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "Espressif ESP32-C2-DevKitM-1", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 278528, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp8684/esp8684-devkitm-1/user_guide.html", + "vendor": "Espressif" +} diff --git a/boards/esp32-c6-devkitc-1.json b/boards/esp32-c6-devkitc-1.json index 18a76dcc7..b82e07f8d 100644 --- a/boards/esp32-c6-devkitc-1.json +++ b/boards/esp32-c6-devkitc-1.json @@ -4,12 +4,17 @@ "f_cpu": "160000000L", "f_flash": "80000000L", "flash_mode": "qio", - "mcu": "esp32c6" + "mcu": "esp32c6", + "variant": "esp32c6" }, "connectivity": [ "wifi" ], + "debug": { + "openocd_target": "esp32c6.cfg" + }, "frameworks": [ + "arduino", "espidf" ], "name": "Espressif ESP32-C6-DevKitC-1", diff --git a/boards/esp32-c6-devkitm-1.json b/boards/esp32-c6-devkitm-1.json index c30687fa9..069d0d791 100644 --- a/boards/esp32-c6-devkitm-1.json +++ b/boards/esp32-c6-devkitm-1.json @@ -14,6 +14,7 @@ "openocd_target": "esp32c6.cfg" }, "frameworks": [ + "arduino", "espidf" ], "name": "Espressif ESP32-C6-DevKitM-1", diff --git a/boards/esp32-h2-devkitm-1.json b/boards/esp32-h2-devkitm-1.json new file mode 100644 index 000000000..519f61b22 --- /dev/null +++ b/boards/esp32-h2-devkitm-1.json @@ -0,0 +1,38 @@ +{ + "build": { + "core": "esp32", + "f_cpu": "96000000L", + "f_flash": "64000000L", + "f_image": "48000000L", + "flash_mode": "qio", + "mcu": "esp32h2", + "variant": "esp32h2", + "hwids": [ + [ + "0x303A", + "0x1001" + ] + ] + }, + "connectivity": [ + "bluetooth", + "zigbee" + ], + "debug": { + "openocd_target": "esp32h2.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "Espressif ESP32-H2-DevKit", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp32h2/esp32-h2-devkitm-1/index.html", + "vendor": "Espressif" +} diff --git a/boards/esp32-solo1.json b/boards/esp32-solo1.json new file mode 100644 index 000000000..e87b7e13d --- /dev/null +++ b/boards/esp32-solo1.json @@ -0,0 +1,37 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32_out.ld" + }, + "core": "esp32", + "extra_flags": "-DARDUINO_ESP32_DEV -DARDUINO_USB_CDC_ON_BOOT=0 -DCORE32SOLO1", + "f_cpu": "80000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "esp32" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "debug": { + "openocd_target": "esp32-solo-1.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "Espressif Generic ESP32-solo1 4M Flash", + "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": "Espressif" +} From fac09f4b9273a637826320256a8cfb0d47cbaa73 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Mon, 15 Jul 2024 16:12:34 +0200 Subject: [PATCH 5/8] owner pioarduino --- README.md | 21 ++++++++++++++++----- platform.json | 16 ++++++++-------- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 61f6b6314..41ab65c5b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Espressif 32: development platform for [PlatformIO](https://platformio.org) +# Fork of Platformio Espressif 32: development platform for [PlatformIO](https://platformio.org) -[![Build Status](https://github.com/platformio/platform-espressif32/workflows/Examples/badge.svg)](https://github.com/platformio/platform-espressif32/actions) +[![Build Status](https://github.com/pioarduino/platform-espressif32/workflows/Examples/badge.svg)](https://github.com/pioarduino/platform-espressif32/actions) ESP32 is a series of low-cost, low-power system on a chip microcontrollers with integrated Wi-Fi and Bluetooth. ESP32 integrates an antenna switch, RF balun, power amplifier, low-noise receive amplifier, filters, and power management modules. @@ -12,16 +12,27 @@ ESP32 is a series of low-cost, low-power system on a chip microcontrollers with 1. [Install PlatformIO](https://platformio.org) 2. Create PlatformIO project and configure a platform option in [platformio.ini](https://docs.platformio.org/page/projectconf.html) file: +## Stable version +espressif Arduino 3.0.2 and IDF 5.1.4 + +See `platform` [documentation](https://docs.platformio.org/en/latest/projectconf/sections/env/options/platform/platform.html#projectconf-env-platform) for details. + +```ini +[env:stable] +platform = https://github.com/pioarduino/platform-espressif32/releases/download/2024.07.00/platform-espressif32.zip +board = ... +... +``` + ## Development version ```ini [env:development] -platform = https://github.com/jason2866/platform-espressif32.git#Arduino/IDF5_org - +platform = https://github.com/pioarduino/platform-espressif32.git#Arduino/IDF51 board = ... ... ``` # Configuration -Please navigate to [documentation](https://docs.platformio.org/page/platforms/espressif32.html). +Please navigate to [documentation](https://docs.platformio.org/page/platforms/espressif32.html). \ No newline at end of file diff --git a/platform.json b/platform.json index e2eb929a2..5c93bdfc4 100644 --- a/platform.json +++ b/platform.json @@ -16,9 +16,9 @@ }, "repository": { "type": "git", - "url": "https://github.com/tasmota/platform-espressif32.git" + "url": "https://github.com/pioarduino/platform-espressif32.git" }, - "version": "2024.00.99", + "version": "2024.07.00", "frameworks": { "arduino": { "script": "builder/frameworks/arduino.py" @@ -33,19 +33,19 @@ "type": "framework", "optional": true, "owner": "espressif", - "version": "https://github.com/espressif/arduino-esp32/archive/refs/heads/master.zip" + "version": "https://github.com/espressif/arduino-esp32/releases/download/3.0.2/esp32-3.0.2.zip" }, "framework-arduinoespressif32-libs": { "type": "framework", "optional": true, "owner": "espressif", - "version": "https://github.com/espressif/esp32-arduino-libs/archive/refs/heads/idf-release/v5.1.zip" + "version": "https://github.com/espressif/arduino-esp32/releases/download/3.0.2/esp32-arduino-libs-3.0.2.zip" }, "framework-espidf": { "type": "framework", "optional": true, - "owner": "jason2866", - "version": "https://github.com/Jason2866/esp-idf/releases/download/v5.1.4.240625/esp-idf-v5.1.4.zip" + "owner": "pioarduino", + "version": "https://github.com/pioarduino/esp-idf/releases/download/v5.1.4.240708/esp-idf-v5.1.4.zip" }, "toolchain-xtensa-esp32": { "type": "toolchain", @@ -91,8 +91,8 @@ }, "tool-esptoolpy": { "type": "uploader", - "owner": "tasmota", - "version": "https://github.com/tasmota/esptool/releases/download/v4.7.3/esptool.zip" + "owner": "pioarduino", + "version": "https://github.com/pioarduino/esptool/releases/download/v4.7.5/esptool.zip" }, "tool-dfuutil-arduino": { "type": "uploader", From c42a5f77fa353b71a56229ad0707f5680f34f0ae Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Mon, 15 Jul 2024 16:21:28 +0200 Subject: [PATCH 6/8] test fix failure --- builder/frameworks/espidf.py | 2 +- platform.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builder/frameworks/espidf.py b/builder/frameworks/espidf.py index f6ef68b43..61fe711b7 100644 --- a/builder/frameworks/espidf.py +++ b/builder/frameworks/espidf.py @@ -83,7 +83,7 @@ ): print("Warning! Debugging an IDF project requires PlatformIO Core >= 6.1.11!") -# Arduino framework as a component is not compatible with ESP-IDF >=4.1 +# Arduino framework as a component is not compatible with ESP-IDF >5.2 if "arduino" in env.subst("$PIOFRAMEWORK"): ARDUINO_FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoespressif32") # Possible package names in 'package@version' format is not compatible with CMake diff --git a/platform.json b/platform.json index 5c93bdfc4..3288a87ef 100644 --- a/platform.json +++ b/platform.json @@ -45,7 +45,7 @@ "type": "framework", "optional": true, "owner": "pioarduino", - "version": "https://github.com/pioarduino/esp-idf/releases/download/v5.1.4.240708/esp-idf-v5.1.4.zip" + "version": "https://github.com/Jason2866/esp-idf/releases/download/v5.1.4.240625/esp-idf-v5.1.4.zip" }, "toolchain-xtensa-esp32": { "type": "toolchain", From 421523dc485f55c24339c04e9f031f6bd760eeb2 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Mon, 15 Jul 2024 16:27:22 +0200 Subject: [PATCH 7/8] Arduino release is missing yaml file --- platform.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform.json b/platform.json index 3288a87ef..d734d081c 100644 --- a/platform.json +++ b/platform.json @@ -33,7 +33,7 @@ "type": "framework", "optional": true, "owner": "espressif", - "version": "https://github.com/espressif/arduino-esp32/releases/download/3.0.2/esp32-3.0.2.zip" + "version": "https://github.com/espressif/arduino-esp32/archive/refs/heads/master.zip" }, "framework-arduinoespressif32-libs": { "type": "framework", @@ -45,7 +45,7 @@ "type": "framework", "optional": true, "owner": "pioarduino", - "version": "https://github.com/Jason2866/esp-idf/releases/download/v5.1.4.240625/esp-idf-v5.1.4.zip" + "version": "https://github.com/pioarduino/esp-idf/releases/download/v5.1.4.240708/esp-idf-v5.1.4.zip" }, "toolchain-xtensa-esp32": { "type": "toolchain", From 92cf8341f4ccdd47941bcf827f5761dad9b3047f Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Mon, 15 Jul 2024 16:34:23 +0200 Subject: [PATCH 8/8] Use tagged 3.0.2 as source --- platform.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.json b/platform.json index d734d081c..4c1b58b28 100644 --- a/platform.json +++ b/platform.json @@ -33,7 +33,7 @@ "type": "framework", "optional": true, "owner": "espressif", - "version": "https://github.com/espressif/arduino-esp32/archive/refs/heads/master.zip" + "version": "https://github.com/espressif/arduino-esp32/archive/refs/tags/3.0.2.zip" }, "framework-arduinoespressif32-libs": { "type": "framework",