Skip to content

Commit

Permalink
Merge branch 'master' into release/v3.1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasssvaz committed Dec 10, 2024
2 parents 9660e66 + 19e4d0d commit 3d8014b
Show file tree
Hide file tree
Showing 36 changed files with 629 additions and 559 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/Issue-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ body:
attributes:
label: IDE Name
description: What IDE are you using?
placeholder: eg. Arduino IDE, PlatformIO, Sloeber...
placeholder: eg. Arduino IDE, VSCode, Sloeber...
validations:
required: true
- type: input
Expand Down
454 changes: 454 additions & 0 deletions boards.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cores/esp32/Esp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ const char *EspClass::getChipModel(void) {
return "ESP32-D0WD";
}
case EFUSE_RD_CHIP_VER_PKG_ESP32D2WDQ5: return "ESP32-D2WD";
case EFUSE_RD_CHIP_VER_PKG_ESP32PICOD2: return "ESP32-PICO-D2";
case EFUSE_RD_CHIP_VER_PKG_ESP32U4WDH: return "ESP32-U4WDH";
case EFUSE_RD_CHIP_VER_PKG_ESP32PICOD4: return "ESP32-PICO-D4";
case EFUSE_RD_CHIP_VER_PKG_ESP32PICOV302: return "ESP32-PICO-V3-02";
case EFUSE_RD_CHIP_VER_PKG_ESP32D0WDR2V3: return "ESP32-D0WDR2-V3";
Expand Down
Binary file removed docs/_static/logo_pio.png
Binary file not shown.
11 changes: 5 additions & 6 deletions docs/en/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,13 @@ Supported IDEs

Here is the list of supported IDE for Arduino ESP32 support integration.

+-------------------+-------------------+
| |arduino-logo| | |pio-logo| |
+-------------------+-------------------+
| Arduino IDE | PlatformIO |
+-------------------+-------------------+
+-------------------+
| |arduino-logo| |
+-------------------+
| Arduino IDE |
+-------------------+

.. |arduino-logo| image:: ../_static/logo_arduino.png
.. |pio-logo| image:: ../_static/logo_pio.png

See `Installing Guides <installing.html>`_ for more details on how to install the Arduino ESP32 support.

Expand Down
87 changes: 0 additions & 87 deletions docs/en/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,92 +63,6 @@ To start the installation process using the Boards Manager, follow these steps:

- Restart Arduino IDE.

Installing using PlatformIO
---------------------------

.. figure:: ../_static/logo_pio.png
:align: center
:width: 200
:figclass: align-center

PlatformIO is a professional collaborative platform for embedded development. It has out-of-the-box support for ESP32 SoCs and allows working with Arduino ESP32 as well as ESP-IDF from Espressif without changing your development environment. PlatformIO includes lots of instruments for the most common development tasks such as debugging, unit testing, and static code analysis.

.. warning:: Integration of the Arduino Core ESP32 project in PlatformIO is maintained by PlatformIO developers. Arduino Core ESP32 Project Team cannot support PlatformIO-specific issues. Please report these issues in official `PlatformIO repositories <https://github.com/platformio>`_.

A detailed overview of the PlatformIO ecosystem and its philosophy can be found in `the official documentation <https://docs.platformio.org/en/latest/core/index.html>`_.

PlatformIO can be used in two flavors:

- `PlatformIO IDE <https://platformio.org/platformio-ide>`_ is a toolset for embedded C/C++ development available on Windows, macOS and Linux platforms

- `PlatformIO Core (CLI) <https://docs.platformio.org/en/latest/core/index.html>`_ is a command-line tool that consists of a multi-platform build system, platform and library managers and other integration components. It can be used with a variety of code development environments and allows integration with cloud platforms and web services

To install PlatformIO, you can follow this Getting Started, provided at `docs.platformio.org`_.

Using the stable code
*********************

.. note::
A detailed overview of supported development boards, examples and frameworks can be found on `the official Espressif32 dev-platform page <https://registry.platformio.org/platforms/platformio/espressif32>`_ in the PlatformIO Registry.

The most reliable and easiest way to get started is to use the latest stable version of the ESP32 development platform that passed all tests/verifications and can be used in production.

Create a new project and select one of the available boards. You can change after by changing the `platformio.ini <https://docs.platformio.org/en/latest/projectconf/index.html>`_ file.

- For ESP32

.. code-block:: bash
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
- For ESP32-S2 (ESP32-S2-Saola-1 board)

.. code-block:: bash
[env:esp32-s2-saola-1]
platform = espressif32
board = esp32-s2-saola-1
framework = arduino
- For ESP32-C3 (ESP32-C3-DevKitM-1 board)

.. code-block:: bash
[env:esp32-c3-devkitm-1]
platform = espressif32
board = esp32-c3-devkitm-1
framework = arduino
How to update to the latest code
********************************

To test the latest Arduino ESP32, you need to change your project *platformio.ini* accordingly.
The following configuration uses the upstream version of the Espressif development platform and the latest Arduino core directly from the Espressif GitHub repository:

.. code-block:: bash
[env:esp32-c3-devkitm-1]
platform = https://github.com/platformio/platform-espressif32.git
board = esp32-c3-devkitm-1
framework = arduino
platform_packages =
framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32#master
To get more information about PlatformIO, see the following links:

- `PlatformIO Core (CLI) <https://docs.platformio.org/en/latest/core/index.html>`_

- `PlatformIO Home <https://docs.platformio.org/en/latest/home/index.html>`_

- `Tutorials and Examples <https://docs.platformio.org/en/latest/tutorials/index.html>`_

- `Library Management <https://docs.platformio.org/en/latest/librarymanager/index.html>`_


Windows (manual installation)
-----------------------------

Expand Down Expand Up @@ -360,4 +274,3 @@ Where ``~/Documents/Arduino`` represents your sketch book location as per "Ardui
- Restart Arduino IDE.

.. _Arduino.cc: https://www.arduino.cc/en/Main/Software
.. _docs.platformio.org: https://docs.platformio.org/en/latest/integration/ide/pioide.html
3 changes: 1 addition & 2 deletions docs/en/tutorials/blink.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Introduction

This is the interactive blink tutorial using `Wokwi`_. For this tutorial, you don't need the ESP32 board or the Arduino toolchain.

.. note:: If you don't want to use this tutorial with the simulation, you can copy and paste the :ref:`blink_example_code` from `Wokwi`_ editor and use it on the `Arduino IDE`_ or `PlatformIO`_.
.. note:: If you don't want to use this tutorial with the simulation, you can copy and paste the :ref:`blink_example_code` from `Wokwi`_ editor and use it on the `Arduino IDE`.

About this Tutorial
-------------------
Expand Down Expand Up @@ -109,5 +109,4 @@ Resources

.. _ESP32 Datasheet: https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf
.. _Wokwi: https://wokwi.com/
.. _PlatformIO: https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html#platformio
.. _Arduino IDE: https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html#installing-using-boards-manager
25 changes: 25 additions & 0 deletions libraries/BLE/src/BLECharacteristic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,13 @@ void BLECharacteristic::handleGATTServerEvent(esp_gatts_cb_event_t event, esp_ga

log_d(" - Response to write event: New value: handle: %.2x, uuid: %s", getHandle(), getUUID().toString().c_str());

// The call to BLEUtils::buildHexData() doesn't output anything if the log level is not
// "DEBUG". As it is quite CPU intensive, it is much better to not call it if not needed.
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG
char *pHexData = BLEUtils::buildHexData(nullptr, param->write.value, param->write.len);
log_d(" - Data: length: %d, data: %s", param->write.len, pHexData);
free(pHexData);
#endif

if (param->write.need_rsp) {
esp_gatt_rsp_t rsp;
Expand Down Expand Up @@ -390,9 +394,13 @@ void BLECharacteristic::handleGATTServerEvent(esp_gatts_cb_event_t event, esp_ga
rsp.attr_value.handle = param->read.handle;
rsp.attr_value.auth_req = ESP_GATT_AUTH_REQ_NONE;

// The call to BLEUtils::buildHexData() doesn't output anything if the log level is not
// "DEBUG". As it is quite CPU intensive, it is much better to not call it if not needed.
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG
char *pHexData = BLEUtils::buildHexData(nullptr, rsp.attr_value.value, rsp.attr_value.len);
log_d(" - Data: length=%d, data=%s, offset=%d", rsp.attr_value.len, pHexData, rsp.attr_value.offset);
free(pHexData);
#endif

esp_err_t errRc = ::esp_ble_gatts_send_response(gatts_if, param->read.conn_id, param->read.trans_id, ESP_GATT_OK, &rsp);
if (errRc != ESP_OK) {
Expand Down Expand Up @@ -471,7 +479,20 @@ void BLECharacteristic::notify(bool is_notification) {

m_pCallbacks->onNotify(this); // Invoke the notify callback.

// GeneralUtils::hexDump() doesn't output anything if the log level is not
// "VERBOSE". Additionally, it is very CPU intensive, even when it doesn't
// output anything! So it is much better to *not* call it at all if not needed.
// In a simple program which calls BLECharacteristic::notify() every 50 ms,
// the performance gain of this little optimization is 37% in release mode
// (-O3) and 57% in debug mode.
// Of course, the "#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_VERBOSE" guard
// could also be put inside the GeneralUtils::hexDump() function itself. But
// it's better to put it here also, as it is clearer (indicating a verbose log
// thing) and it allows to remove the "m_value.getValue().c_str()" call, which
// is, in itself, quite CPU intensive.
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_VERBOSE
GeneralUtils::hexDump((uint8_t *)m_value.getValue().c_str(), m_value.getValue().length());
#endif

if (getService()->getServer()->getConnectedCount() == 0) {
log_v("<< notify: No connected clients.");
Expand Down Expand Up @@ -624,9 +645,13 @@ void BLECharacteristic::setReadProperty(bool value) {
* @param [in] length The length of the data in bytes.
*/
void BLECharacteristic::setValue(uint8_t *data, size_t length) {
// The call to BLEUtils::buildHexData() doesn't output anything if the log level is not
// "VERBOSE". As it is quite CPU intensive, it is much better to not call it if not needed.
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_VERBOSE
char *pHex = BLEUtils::buildHexData(nullptr, data, length);
log_v(">> setValue: length=%d, data=%s, characteristic UUID=%s", length, pHex, getUUID().toString().c_str());
free(pHex);
#endif
if (length > ESP_GATT_MAX_ATTR_LEN) {
log_e("Size %d too large, must be no bigger than %d", length, ESP_GATT_MAX_ATTR_LEN);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ To get more information about the Espressif boards see [Espressif Development Ki
* Before Compile/Verify, select the correct board: `Tools -> Board`.
* Select the COM port: `Tools -> Port: xxx` where the `xxx` is the detected COM port.

#### Using Platform IO

* Select the COM port: `Devices` or set the `upload_port` option on the `platformio.ini` file.

## Troubleshooting

***Important: Make sure you are using a good quality USB cable and that you have a reliable power source***
Expand Down
4 changes: 0 additions & 4 deletions libraries/ESP32/examples/FreeRTOS/Mutex/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ To get more information about the Espressif boards see [Espressif Development Ki
* Before Compile/Verify, select the correct board: `Tools -> Board`.
* Select the COM port: `Tools -> Port: xxx` where the `xxx` is the detected COM port.

#### Using Platform IO

* Select the COM port: `Devices` or set the `upload_port` option on the `platformio.ini` file.

## Example Log Output

The expected output of shared variables protected by mutex demonstrates mutually exclusive access from tasks - they do not interrupt each other and do not rewrite the value before the other task has read it back.
Expand Down
4 changes: 0 additions & 4 deletions libraries/ESP32/examples/FreeRTOS/Queue/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ To get more information about the Espressif boards see [Espressif Development Ki
* Before Compile/Verify, select the correct board: `Tools -> Board`.
* Select the COM port: `Tools -> Port: xxx` where the `xxx` is the detected COM port.

#### Using Platform IO

* Select the COM port: `Devices` or set the `upload_port` option on the `platformio.ini` file.

## Example Log Output

```
Expand Down
4 changes: 0 additions & 4 deletions libraries/ESP32/examples/FreeRTOS/Semaphore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ To get more information about the Espressif boards see [Espressif Development Ki
* Before Compile/Verify, select the correct board: `Tools -> Board`.
* Select the COM port: `Tools -> Port: xxx` where the `xxx` is the detected COM port.

#### Using Platform IO

* Select the COM port: `Devices` or set the `upload_port` option on the `platformio.ini` file.

## Example Log Output

```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// add the file "build_opt.h" to your Arduino project folder with "-DESP32_ARDUINO_NO_RGB_BUILTIN" to use the RMT Legacy driver
#error "ESP32_ARDUINO_NO_RGB_BUILTIN is not defined, this example is intended to demonstrate the RMT Legacy driver."
#error "Please add the file 'build_opt.h' with '-DESP32_ARDUINO_NO_RGB_BUILTIN' to your Arduino project folder."
#error "Another way to disable the RGB_BUILTIN is to define it in the platformio.ini file, for instance: '-D ESP32_ARDUINO_NO_RGB_BUILTIN'"

#else

Expand Down
4 changes: 0 additions & 4 deletions libraries/ESP32/examples/Template/ExampleTemplate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ To get more information about the Espressif boards see [Espressif Development Ki
* Before Compile/Verify, select the correct board: `Tools -> Board`.
* Select the COM port: `Tools -> Port: xxx` where the `xxx` is the detected COM port.

#### Using Platform IO

* Select the COM port: `Devices` or set the `upload_port` option on the `platformio.ini` file.

## Example/Log Output ==(OPTIONAL)==

==*Add the log/serial output here!*==
Expand Down
4 changes: 0 additions & 4 deletions libraries/LittleFS/examples/LITTLEFS_PlatformIO/.gitignore

This file was deleted.

68 changes: 0 additions & 68 deletions libraries/LittleFS/examples/LITTLEFS_PlatformIO/README.md

This file was deleted.

This file was deleted.

This file was deleted.

Empty file.
Empty file.

This file was deleted.

22 changes: 0 additions & 22 deletions libraries/LittleFS/examples/LITTLEFS_PlatformIO/platformio.ini

This file was deleted.

Loading

0 comments on commit 3d8014b

Please sign in to comment.