Skip to content

Commit cb33c5e

Browse files
authored
Merge branch 'master' into feature/idf_component_ci_and_ver_check
2 parents e3cc290 + 399f4ec commit cb33c5e

File tree

327 files changed

+3602
-748
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

327 files changed

+3602
-748
lines changed

README.md

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,15 @@
1-
# Arduino core for the ESP32
1+
# Arduino core for the ESP32, ESP32-S2 and ESP32-C3
22

3-
[![Build Status](https://travis-ci.org/espressif/arduino-esp32.svg?branch=master)](https://travis-ci.org/espressif/arduino-esp32) ![](https://github.com/espressif/arduino-esp32/workflows/ESP32%20Arduino%20CI/badge.svg) [![Documentation Status](https://readthedocs.com/projects/espressif-arduino-esp32/badge/?version=latest)](https://docs.espressif.com/projects/arduino-esp32/en/latest/?badge=latest)
3+
![Build Status](https://github.com/espressif/arduino-esp32/workflows/ESP32%20Arduino%20CI/badge.svg) [![Documentation Status](https://readthedocs.com/projects/espressif-arduino-esp32/badge/?version=latest)](https://docs.espressif.com/projects/arduino-esp32/en/latest/?badge=latest)
44

55
### Need help or have a question? Join the chat at [![https://gitter.im/espressif/arduino-esp32](https://badges.gitter.im/espressif/arduino-esp32.svg)](https://gitter.im/espressif/arduino-esp32?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
66

77
## Contents
88

9-
- [ESP32-S2 and ESP32-C3 Support](#esp32-s2-and-esp32-c3-support)
109
- [Development Status](#development-status)
1110
- [Decoding Exceptions](#decoding-exceptions)
1211
- [Issue/Bug report template](#issuebug-report-template)
1312

14-
### ESP32-S2 and ESP32-C3 Support
15-
16-
If you want to test ESP32-S2 and/or ESP32-C3 through the board manager, please use the development release link:
17-
18-
```
19-
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json
20-
```
21-
22-
Now you can install the latest 2.0.0 version from the boards manager.
23-
2413
### Development Status
2514

2615
Latest Stable Release [![Release Version](https://img.shields.io/github/release/espressif/arduino-esp32.svg?style=plastic)](https://github.com/espressif/arduino-esp32/releases/latest/) [![Release Date](https://img.shields.io/github/release-date/espressif/arduino-esp32.svg?style=plastic)](https://github.com/espressif/arduino-esp32/releases/latest/) [![Downloads](https://img.shields.io/github/downloads/espressif/arduino-esp32/latest/total.svg?style=plastic)](https://github.com/espressif/arduino-esp32/releases/latest/)
@@ -38,6 +27,10 @@ You can use [Arduino-ESP32 Online Documentation](https://docs.espressif.com/proj
3827
* [FAQ](https://docs.espressif.com/projects/arduino-esp32/en/latest/faq.html)
3928
* [Troubleshooting](https://docs.espressif.com/projects/arduino-esp32/en/latest/troubleshooting.html)
4029

30+
### Supported Chips
31+
32+
Visit the [supported chips](https://docs.espressif.com/projects/arduino-esp32/en/latest/getting_started.html#supported-soc-s) documentation to see the list of current supported ESP32 SoCs.
33+
4134
### Decoding exceptions
4235

4336
You can use [EspExceptionDecoder](https://github.com/me-no-dev/EspExceptionDecoder) to get meaningful call trace.

boards.txt

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9690,10 +9690,20 @@ deneyapmini.build.boot=qio
96909690
deneyapmini.build.partitions=default
96919691
deneyapmini.build.defines=
96929692

9693-
deneyapmini.menu.CDCOnBoot.default=Disabled
9694-
deneyapmini.menu.CDCOnBoot.default.build.cdc_on_boot=0
9695-
deneyapmini.menu.CDCOnBoot.cdc=Enabled
9696-
deneyapmini.menu.CDCOnBoot.cdc.build.cdc_on_boot=1
9693+
deneyapmini.menu.CDCOnBoot.default=Enabled
9694+
deneyapmini.menu.CDCOnBoot.default.build.cdc_on_boot=1
9695+
deneyapmini.menu.CDCOnBoot.cdc=Disabled
9696+
deneyapmini.menu.CDCOnBoot.cdc.build.cdc_on_boot=0
9697+
9698+
deneyapmini.menu.MSCOnBoot.default=Disabled
9699+
deneyapmini.menu.MSCOnBoot.default.build.msc_on_boot=0
9700+
deneyapmini.menu.MSCOnBoot.msc=Enabled
9701+
deneyapmini.menu.MSCOnBoot.msc.build.msc_on_boot=1
9702+
9703+
deneyapmini.menu.DFUOnBoot.default=Disabled
9704+
deneyapmini.menu.DFUOnBoot.default.build.dfu_on_boot=0
9705+
deneyapmini.menu.DFUOnBoot.dfu=Enabled
9706+
deneyapmini.menu.DFUOnBoot.dfu.build.dfu_on_boot=1
96979707

96989708
deneyapmini.menu.PSRAM.disabled=Disabled
96999709
deneyapmini.menu.PSRAM.disabled.build.defines=

cores/esp32/cbuf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class cbuf
6262

6363
cbuf *next;
6464

65-
private:
65+
protected:
6666
inline char* wrap_if_bufend(char* ptr) const
6767
{
6868
return (ptr == _bufend) ? _buf : ptr;

cores/esp32/esp32-hal-i2c-slave.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ esp_err_t i2cSlaveInit(uint8_t num, int sda, int scl, uint16_t slaveID, uint32_t
302302
i2c_ll_slave_init(i2c->dev);
303303
i2c_ll_set_fifo_mode(i2c->dev, true);
304304
i2c_ll_set_slave_addr(i2c->dev, slaveID, false);
305-
i2c_ll_set_tout(i2c->dev, 32000);
305+
i2c_ll_set_tout(i2c->dev, I2C_LL_MAX_TIMEOUT);
306306
i2c_slave_set_frequency(i2c, frequency);
307307

308308
if (!i2c_slave_check_line_state(sda, scl)) {

cores/esp32/esp32-hal-i2c.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "soc/soc_caps.h"
2525
#include "soc/i2c_periph.h"
2626
#include "hal/i2c_hal.h"
27+
#include "hal/i2c_ll.h"
2728
#include "driver/i2c.h"
2829

2930
typedef volatile struct {
@@ -91,6 +92,8 @@ esp_err_t i2cInit(uint8_t i2c_num, int8_t sda, int8_t scl, uint32_t frequency){
9192
} else {
9293
bus[i2c_num].initialized = true;
9394
bus[i2c_num].frequency = frequency;
95+
//Clock Stretching Timeout: 20b:esp32, 5b:esp32-c3, 24b:esp32-s2
96+
i2c_set_timeout((i2c_port_t)i2c_num, I2C_LL_MAX_TIMEOUT);
9497
}
9598
}
9699
#if !CONFIG_DISABLE_HAL_LOCKS

docs/source/esp-idf_component.rst

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ Arduino as a ESP-IDF component
55
ESP32 Arduino lib-builder
66
-------------------------
77

8-
For a simplified method, see `lib-builder <lib_builder>`_.
8+
For a simplified method, see `lib-builder <https://github.com/espressif/esp32-arduino-lib-builder>`_.
99

1010
Installation
1111
------------
1212

13-
.. note:: Latest Arduino Core ESP32 version is now compatible with [ESP-IDF v4.4](https://github.com/espressif/esp-idf/tree/release/v4.4). Please consider this compability when using Arduino as component in ESP-IDF.
13+
.. note:: Latest Arduino Core ESP32 version is now compatible with `ESP-IDF v4.4 <https://github.com/espressif/esp-idf/tree/release/v4.4>`_. Please consider this compability when using Arduino as component in ESP-IDF.
1414

1515
- Download and install `ESP-IDF <https://github.com/espressif/esp-idf>`_.
16-
- Create blank idf project (from one of the examples).
16+
- Create blank ESP-IDF project (use sample_project from /examples/get-started) or choose one of the examples.
1717
- In the project folder, create a new folder called `components` and clone this repository inside the new created folder.
1818

1919
.. code-block:: bash
@@ -26,10 +26,19 @@ Installation
2626
cd ../.. && \
2727
idf.py menuconfig
2828
29+
Option 1. Using Arduino setup() and loop()
30+
******************************************
2931

3032
- The `idf.py menuconfig` has some Arduino options.
31-
- On `Autostart Arduino setup and loop on boot`.
32-
- If you enable these options, your main.cpp should be formated like any other sketch.
33+
- Turn on `Autostart Arduino setup and loop on boot`.
34+
- In main folder rename file `main.c` to `main.cpp`.
35+
- In main folder open file `CMakeList.txt` and change `main.c` to `main.cpp` as described below.
36+
37+
.. code-block:: bash
38+
39+
idf_component_register(SRCS "main.cpp" INCLUDE_DIRS ".")
40+
41+
- Your main.cpp should be formated like any other sketch.
3342

3443
.. code-block:: c
3544
@@ -45,14 +54,17 @@ Installation
4554
delay(1000);
4655
}
4756
48-
- Otherwise, you need to implement ```app_main()``` and call ```initArduino();``` in it.
57+
Option 2. Using ESP-IDF appmain()
58+
*********************************
59+
60+
- You need to implement ``app_main()`` and call ``initArduino();`` in it.
4961

5062
Keep in mind that setup() and loop() will not be called in this case.
5163
If you plan to base your code on examples provided in `examples <https://github.com/espressif/esp-idf/tree/master/examples>`_, please make sure to move the app_main() function in main.cpp from the files in the example.
5264

5365
.. code-block:: cpp
5466
55-
//file: main.cpp
67+
//file: main.c or main.cpp
5668
#include "Arduino.h"
5769
5870
extern "C" void app_main()
@@ -69,7 +81,11 @@ If you plan to base your code on examples provided in `examples <https://github.
6981
- If enabled, WiFi will start with the last known configuration
7082
- Otherwise it will wait for WiFi.begin
7183

72-
- ```idf.py -p <your-board-serial-port> flash monitor``` will build, upload and open serial monitor to your board
84+
Build, flash and monitor
85+
************************
86+
87+
- For both options use command ``idf.py -p <your-board-serial-port> flash monitor``
88+
- It will build, upload and open serial monitor to your board.
7389

7490
Logging To Serial
7591
-----------------

docs/source/getting_started.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ SoC Stable Development Datasheet
3737
ESP32 Yes Yes `ESP32 Datasheet`_
3838
ESP32-S2 Yes Yes `ESP32-S2 Datasheet`_
3939
ESP32-C3 Yes Yes `ESP32-C3 Datasheet`_
40-
ESP32-S3 No No Not Available Yet
40+
ESP32-S3 No No `ESP32-S3 Datasheet`_
4141
======== ====== =========== ===================================
4242

4343
See `Boards <boards/boards.html>`_ for more details about ESP32 development boards.
@@ -122,6 +122,7 @@ Resources
122122
.. _ESP32 Datasheet: https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf
123123
.. _ESP32-S2 Datasheet: https://www.espressif.com/sites/default/files/documentation/esp32-s2_datasheet_en.pdf
124124
.. _ESP32-C3 Datasheet: https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_en.pdf
125+
.. _ESP32-S3 Datasheet: https://www.espressif.com/sites/default/files/documentation/esp32-s3_datasheet_en.pdf
125126
.. _Arduino.cc: https://www.arduino.cc/en/Main/Software
126127
.. _Arduino Reference: https://www.arduino.cc/reference/en/
127128
.. _ESP32 Forum: https://esp32.com

package/package_esp32_index.template.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
},
2424
"boards": [
2525
{
26-
"name": "ESP32 Dev Module"
26+
"name": "ESP32 Dev Board"
2727
},
2828
{
29-
"name": "WEMOS LoLin32"
29+
"name": "ESP32-S2 Dev Board"
3030
},
3131
{
32-
"name": "WEMOS D1 MINI ESP32"
32+
"name": "ESP32-C3 Dev Board"
3333
}
3434
],
3535
"toolsDependencies": [

platform.txt

Lines changed: 7 additions & 7 deletions
Large diffs are not rendered by default.

tools/platformio-build-esp32.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
"-u", "pthread_include_pthread_impl",
101101
"-u", "pthread_include_pthread_cond_impl",
102102
"-u", "pthread_include_pthread_local_storage_impl",
103+
"-u", "pthread_include_pthread_rwlock_impl",
103104
"-u", "ld_include_highint_hdl",
104105
"-u", "start_app",
105106
"-u", "start_app_other_cores",
@@ -303,8 +304,9 @@
303304
"UNITY_INCLUDE_CONFIG_H",
304305
"WITH_POSIX",
305306
"_GNU_SOURCE",
306-
("IDF_VER", '\\"v4.4-dev-3569-g6a7d83af19\\"'),
307+
("IDF_VER", '\\"v4.4-dev-3703-gddc44956bf\\"'),
307308
"ESP_PLATFORM",
309+
"_POSIX_READER_WRITER_LOCKS",
308310
"ARDUINO_ARCH_ESP32",
309311
"ESP32",
310312
("F_CPU", "$BOARD_F_CPU"),

tools/platformio-build-esp32c3.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@
127127
"-u", "pthread_include_pthread_impl",
128128
"-u", "pthread_include_pthread_cond_impl",
129129
"-u", "pthread_include_pthread_local_storage_impl",
130+
"-u", "pthread_include_pthread_rwlock_impl",
130131
"-u", "start_app",
131132
"-u", "__ubsan_include",
132133
"-u", "__assert_func",
@@ -293,8 +294,9 @@
293294
"UNITY_INCLUDE_CONFIG_H",
294295
"WITH_POSIX",
295296
"_GNU_SOURCE",
296-
("IDF_VER", '\\"v4.4-dev-3569-g6a7d83af19\\"'),
297+
("IDF_VER", '\\"v4.4-dev-3703-gddc44956bf\\"'),
297298
"ESP_PLATFORM",
299+
"_POSIX_READER_WRITER_LOCKS",
298300
"ARDUINO_ARCH_ESP32",
299301
"ESP32",
300302
("F_CPU", "$BOARD_F_CPU"),

tools/platformio-build-esp32s2.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
"-u", "pthread_include_pthread_impl",
9696
"-u", "pthread_include_pthread_cond_impl",
9797
"-u", "pthread_include_pthread_local_storage_impl",
98+
"-u", "pthread_include_pthread_rwlock_impl",
9899
"-u", "ld_include_highint_hdl",
99100
"-u", "start_app",
100101
"-u", "__ubsan_include",
@@ -289,8 +290,9 @@
289290
"UNITY_INCLUDE_CONFIG_H",
290291
"WITH_POSIX",
291292
"_GNU_SOURCE",
292-
("IDF_VER", '\\"v4.4-dev-3569-g6a7d83af19\\"'),
293+
("IDF_VER", '\\"v4.4-dev-3703-gddc44956bf\\"'),
293294
"ESP_PLATFORM",
295+
"_POSIX_READER_WRITER_LOCKS",
294296
"ARDUINO_ARCH_ESP32",
295297
"ESP32",
296298
("F_CPU", "$BOARD_F_CPU"),

tools/sdk/esp32/include/config/sdkconfig.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@
346346
#define CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE 0
347347
#define CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER 1
348348
#define CONFIG_FREERTOS_DEBUG_OCDAWARE 1
349+
#define CONFIG_FREERTOS_FPU_IN_ISR 1
349350
#define CONFIG_FREERTOS_ENABLE_TASK_SNAPSHOT 1
350351
#define CONFIG_HAL_ASSERTION_EQUALS_SYSTEM 1
351352
#define CONFIG_HAL_DEFAULT_ASSERTION_LEVEL 2
@@ -370,6 +371,7 @@
370371
#define CONFIG_LWIP_ESP_GRATUITOUS_ARP 1
371372
#define CONFIG_LWIP_GARP_TMR_INTERVAL 60
372373
#define CONFIG_LWIP_TCPIP_RECVMBOX_SIZE 32
374+
#define CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID 1
373375
#define CONFIG_LWIP_DHCP_RESTORE_LAST_IP 1
374376
#define CONFIG_LWIP_DHCP_OPTIONS_LEN 128
375377
#define CONFIG_LWIP_DHCPS 1
@@ -636,6 +638,7 @@
636638
#define CONFIG_OPTIMIZATION_LEVEL_RELEASE CONFIG_COMPILER_OPTIMIZATION_SIZE
637639
#define CONFIG_POST_EVENTS_FROM_IRAM_ISR CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR
638640
#define CONFIG_POST_EVENTS_FROM_ISR CONFIG_ESP_EVENT_POST_FROM_ISR
641+
#define CONFIG_REDUCE_PHY_TX_POWER CONFIG_ESP_PHY_REDUCE_TX_POWER
639642
#define CONFIG_SCAN_DUPLICATE_BY_DEVICE_ADDR CONFIG_BTDM_SCAN_DUPL_TYPE_DEVICE
640643
#define CONFIG_SEMIHOSTFS_HOST_PATH_MAX_LEN CONFIG_VFS_SEMIHOSTFS_HOST_PATH_MAX_LEN
641644
#define CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS CONFIG_VFS_SEMIHOSTFS_MAX_MOUNT_POINTS
@@ -673,5 +676,5 @@
673676
#define CONFIG_ULP_COPROC_RESERVE_MEM CONFIG_ESP32_ULP_COPROC_RESERVE_MEM
674677
#define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS
675678
#define CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP
676-
#define CONFIG_ARDUINO_IDF_COMMIT "6a7d83af19"
679+
#define CONFIG_ARDUINO_IDF_COMMIT "ddc44956bf"
677680
#define CONFIG_ARDUINO_IDF_BRANCH "release/v4.4"

tools/sdk/esp32/include/driver/include/driver/mcpwm.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ typedef enum {
174174
/**
175175
* @brief Interrupt masks for MCPWM capture
176176
*/
177-
__attribute__ ((deprecated("please use callback function to avoid directly accessing registers")))
178177
typedef enum {
179178
MCPWM_LL_INTR_CAP0 = BIT(27), ///< Capture 0 happened
180179
MCPWM_LL_INTR_CAP1 = BIT(28), ///< Capture 1 happened
@@ -922,7 +921,6 @@ esp_err_t mcpwm_sync_invert_gpio_synchro(mcpwm_unit_t mcpwm_num, mcpwm_sync_sign
922921
* - ESP_OK Success
923922
* - ESP_ERR_INVALID_ARG Function pointer error.
924923
*/
925-
__attribute__((deprecated("interrupt events are handled by driver, please use callback")))
926924
esp_err_t mcpwm_isr_register(mcpwm_unit_t mcpwm_num, void (*fn)(void *), void *arg, int intr_alloc_flags,
927925
intr_handle_t *handle);
928926

tools/sdk/esp32/include/efuse/include/esp_efuse.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@
66

77
#pragma once
88

9-
#ifdef __cplusplus
10-
extern "C" {
11-
#endif
12-
9+
#include <stdbool.h>
1310
#include <stdint.h>
11+
1412
#include "esp_err.h"
1513
#include "esp_log.h"
1614
#include "soc/soc_caps.h"
@@ -29,6 +27,10 @@ extern "C" {
2927
#include "esp32h2/rom/secure_boot.h"
3028
#endif
3129

30+
#ifdef __cplusplus
31+
extern "C" {
32+
#endif
33+
3234
#define ESP_ERR_EFUSE 0x1600 /*!< Base error code for efuse api. */
3335
#define ESP_OK_EFUSE_CNT (ESP_ERR_EFUSE + 0x01) /*!< OK the required number of bits is set. */
3436
#define ESP_ERR_EFUSE_CNT_IS_FULL (ESP_ERR_EFUSE + 0x02) /*!< Error field is full. */

tools/sdk/esp32/include/esp_netif/include/esp_netif_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ typedef enum{
7979
ESP_NETIF_REQUESTED_IP_ADDRESS = 50, /**< Request specific IP address */
8080
ESP_NETIF_IP_ADDRESS_LEASE_TIME = 51, /**< Request IP address lease time */
8181
ESP_NETIF_IP_REQUEST_RETRY_TIME = 52, /**< Request IP address retry counter */
82+
ESP_NETIF_VENDOR_CLASS_IDENTIFIER = 60, /**< Vendor Class Identifier of a DHCP client */
83+
ESP_NETIF_VENDOR_SPECIFIC_INFO = 43, /**< Vendor Specific Information of a DHCP server */
8284
} esp_netif_dhcp_option_id_t;
8385

8486
/** IP event declarations */

tools/sdk/esp32/include/esp_phy/include/phy.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ void phy_close_rf(void);
6868
void phy_xpd_tsens(void);
6969
#endif
7070

71+
#if CONFIG_IDF_TARGET_ESP32C3
72+
/**
73+
* @brief Update internal state of PHY when wifi deinit powers off the wifi power domain.
74+
*/
75+
void phy_init_flag(void);
76+
#endif
77+
7178
/**
7279
* @brief Store and load PHY digital registers.
7380
*

0 commit comments

Comments
 (0)