Skip to content

Commit 93e683a

Browse files
authored
Merge branch 'master' into replace_BLE_iBeacon
2 parents 0b7bbb0 + b2b4bf8 commit 93e683a

File tree

226 files changed

+329811
-570
lines changed

Some content is hidden

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

226 files changed

+329811
-570
lines changed

Diff for: .github/scripts/install-platformio-esp32.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export PLATFORMIO_ESP32_PATH="$HOME/.platformio/packages/framework-arduinoespres
44
PLATFORMIO_ESP32_URL="https://github.com/platformio/platform-espressif32.git"
55

66
TOOLCHAIN_VERSION="8.4.0+2021r2-patch3"
7-
ESPTOOLPY_VERSION="~1.30100.0"
7+
ESPTOOLPY_VERSION="~1.40201.0"
88
ESPRESSIF_ORGANIZATION_NAME="espressif"
99

1010
echo "Installing Python Wheel ..."

Diff for: .github/scripts/on-push.sh

+5-20
Original file line numberDiff line numberDiff line change
@@ -93,26 +93,11 @@ else
9393
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/BLE/examples/BLE_server/BLE_server.ino" && \
9494
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino"
9595

96-
# PlatformIO ESP32 Test
97-
# OPTIONS="board_build.mcu = esp32s2"
98-
# build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \
99-
# build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino"
100-
101-
python -m platformio ci --board "$BOARD" "$PLATFORMIO_ESP32_PATH/libraries/WiFi/examples/WiFiClient" --project-option="board_build.mcu = esp32s2" --project-option="board_build.partitions = huge_app.csv"
102-
python -m platformio ci --board "$BOARD" "$PLATFORMIO_ESP32_PATH/libraries/WiFi/examples/WiFiClient" --project-option="board_build.mcu = esp32c3" --project-option="board_build.partitions = huge_app.csv"
103-
104-
echo "Hacking in S3 support ..."
105-
replace_script="import json; import os;"
106-
replace_script+="fp=open(os.path.expanduser('~/.platformio/platforms/espressif32/platform.json'), 'r+');"
107-
replace_script+="data=json.load(fp);"
108-
replace_script+="data['packages']['toolchain-xtensa-esp32']['optional']=True;"
109-
replace_script+="data['packages']['toolchain-xtensa-esp32s3']['optional']=False;"
110-
replace_script+="data['packages']['tool-esptoolpy']['owner']='tasmota';"
111-
replace_script+="data['packages']['tool-esptoolpy']['version']='https://github.com/tasmota/esptool/releases/download/v4.2.1/esptool-4.2.1.zip';"
112-
replace_script+="fp.seek(0);fp.truncate();json.dump(data, fp, indent=2);fp.close()"
113-
python -c "$replace_script"
114-
115-
python -m platformio ci --board "$BOARD" "$PLATFORMIO_ESP32_PATH/libraries/WiFi/examples/WiFiClient" --project-option="board_build.mcu = esp32s3" --project-option="board_build.partitions = huge_app.csv"
96+
# Basic sanity testing for other series
97+
for board in "esp32-c3-devkitm-1" "esp32-s2-saola-1" "esp32-s3-devkitc-1"
98+
do
99+
python -m platformio ci --board "$board" "$PLATFORMIO_ESP32_PATH/libraries/WiFi/examples/WiFiClient" --project-option="board_build.partitions = huge_app.csv"
100+
done
116101

117102
#build_pio_sketches "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries"
118103
fi

Diff for: .github/scripts/on-release.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,12 @@ cp -Rf "$GITHUB_WORKSPACE/libraries" "$PKG_DIR/"
179179
cp -Rf "$GITHUB_WORKSPACE/variants" "$PKG_DIR/"
180180
cp -f "$GITHUB_WORKSPACE/tools/espota.exe" "$PKG_DIR/tools/"
181181
cp -f "$GITHUB_WORKSPACE/tools/espota.py" "$PKG_DIR/tools/"
182-
cp -f "$GITHUB_WORKSPACE/tools/esptool.py" "$PKG_DIR/tools/"
183182
cp -f "$GITHUB_WORKSPACE/tools/gen_esp32part.py" "$PKG_DIR/tools/"
184183
cp -f "$GITHUB_WORKSPACE/tools/gen_esp32part.exe" "$PKG_DIR/tools/"
185184
cp -Rf "$GITHUB_WORKSPACE/tools/partitions" "$PKG_DIR/tools/"
185+
cp -Rf "$GITHUB_WORKSPACE/tools/ide-debug" "$PKG_DIR/tools/"
186186
cp -Rf "$GITHUB_WORKSPACE/tools/sdk" "$PKG_DIR/tools/"
187-
cp -f $GITHUB_WORKSPACE/tools/platformio-build*.py "$PKG_DIR/tools/"
187+
cp -f $GITHUB_WORKSPACE/tools/platformio-build*.py "$PKG_DIR/tools/"
188188

189189
# Remove unnecessary files in the package folder
190190
echo "Cleaning up folders ..."
@@ -197,7 +197,11 @@ cat "$GITHUB_WORKSPACE/platform.txt" | \
197197
sed "s/version=.*/version=$ver$extent/g" | \
198198
sed 's/runtime.tools.xtensa-esp32-elf-gcc.path={runtime.platform.path}\/tools\/xtensa-esp32-elf//g' | \
199199
sed 's/runtime.tools.xtensa-esp32s2-elf-gcc.path={runtime.platform.path}\/tools\/xtensa-esp32s2-elf//g' | \
200+
sed 's/runtime.tools.xtensa-esp32s3-elf-gcc.path={runtime.platform.path}\/tools\/xtensa-esp32s3-elf//g' | \
201+
sed 's/runtime.tools.riscv32-esp-elf-gcc.path={runtime.platform.path}\/tools\/riscv32-esp-elf//g' | \
200202
sed 's/tools.esptool_py.path={runtime.platform.path}\/tools\/esptool/tools.esptool_py.path=\{runtime.tools.esptool_py.path\}/g' \
203+
sed 's/debug.server.openocd.path={runtime.platform.path}\/tools\/openocd-esp32\/bin\/openocd/debug.server.openocd.path=\{runtime.tools.openocd-esp32.path\}\/bin\/openocd/g' \
204+
sed 's/debug.server.openocd.scripts_dir={runtime.platform.path}\/tools\/openocd-esp32\/share\/openocd\/scripts\//debug.server.openocd.scripts_dir=\{runtime.tools.openocd-esp32.path\}\/share\/openocd\/scripts\//g' \
201205
> "$PKG_DIR/platform.txt"
202206

203207
# Add header with version information

Diff for: .gitignore

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ tools/esptool.exe
88
tools/mkspiffs
99
tools/mklittlefs
1010
tools/mkfatfs.exe
11+
tools/openocd-esp32
1112

1213
# Ignore editor backup files and macOS system metadata
1314
.DS_Store
@@ -19,8 +20,8 @@ tools/mkfatfs.exe
1920
/build
2021

2122
# Ignore files built by Visual Studio/Visual Micro
22-
[Dd]ebug*/
23-
[Rr]elease*/
23+
[Dd]ebug/
24+
[Rr]elease/
2425
.vs/
2526
__vm/
2627
*.vcxproj*

Diff for: CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,10 @@ if(NOT CONFIG_FREERTOS_HZ EQUAL 1000 AND NOT "$ENV{ARDUINO_SKIP_TICK_CHECK}")
217217
endif()
218218

219219
string(TOUPPER ${CONFIG_ARDUINO_VARIANT} idf_target_caps)
220+
string(REPLACE "-" "_" idf_target_for_macro "${idf_target_caps}")
220221
target_compile_options(${COMPONENT_TARGET} PUBLIC
221222
-DARDUINO=10812
222-
-DARDUINO_${idf_target_caps}_DEV
223+
-DARDUINO_${idf_target_for_macro}_DEV
223224
-DARDUINO_ARCH_ESP32
224225
-DARDUINO_BOARD="${idf_target_caps}_DEV"
225226
-DARDUINO_VARIANT="${CONFIG_ARDUINO_VARIANT}"

Diff for: CODE_OF_CONDUCT.md

+128
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, religion, or sexual identity
10+
and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
* Focusing on what is best not just for us as individuals, but for the
26+
overall community
27+
28+
Examples of unacceptable behavior include:
29+
30+
* The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at
63+
64+
All complaints will be reviewed and investigated promptly and fairly.
65+
66+
All community leaders are obligated to respect the privacy and security of the
67+
reporter of any incident.
68+
69+
## Enforcement Guidelines
70+
71+
Community leaders will follow these Community Impact Guidelines in determining
72+
the consequences for any action they deem in violation of this Code of Conduct:
73+
74+
### 1. Correction
75+
76+
**Community Impact**: Use of inappropriate language or other behavior deemed
77+
unprofessional or unwelcome in the community.
78+
79+
**Consequence**: A private, written warning from community leaders, providing
80+
clarity around the nature of the violation and an explanation of why the
81+
behavior was inappropriate. A public apology may be requested.
82+
83+
### 2. Warning
84+
85+
**Community Impact**: A violation through a single incident or series
86+
of actions.
87+
88+
**Consequence**: A warning with consequences for continued behavior. No
89+
interaction with the people involved, including unsolicited interaction with
90+
those enforcing the Code of Conduct, for a specified period of time. This
91+
includes avoiding interactions in community spaces as well as external channels
92+
like social media. Violating these terms may lead to a temporary or
93+
permanent ban.
94+
95+
### 3. Temporary Ban
96+
97+
**Community Impact**: A serious violation of community standards, including
98+
sustained inappropriate behavior.
99+
100+
**Consequence**: A temporary ban from any sort of interaction or public
101+
communication with the community for a specified period of time. No public or
102+
private interaction with the people involved, including unsolicited interaction
103+
with those enforcing the Code of Conduct, is allowed during this period.
104+
Violating these terms may lead to a permanent ban.
105+
106+
### 4. Permanent Ban
107+
108+
**Community Impact**: Demonstrating a pattern of violation of community
109+
standards, including sustained inappropriate behavior, harassment of an
110+
individual, or aggression toward or disparagement of classes of individuals.
111+
112+
**Consequence**: A permanent ban from any sort of public interaction within
113+
the community.
114+
115+
## Attribution
116+
117+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118+
version 2.0, available at
119+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120+
121+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
122+
enforcement ladder](https://github.com/mozilla/diversity).
123+
124+
[homepage]: https://www.contributor-covenant.org
125+
126+
For answers to common questions about this code of conduct, see the FAQ at
127+
https://www.contributor-covenant.org/faq. Translations are available at
128+
https://www.contributor-covenant.org/translations.

Diff for: README.md

+2
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,5 @@ Finally, if you are sure no one else had the issue, follow the **Issue template*
5656
We welcome contributions to the Arduino ESP32 project!
5757

5858
See [contributing](https://docs.espressif.com/projects/arduino-esp32/en/latest/contributing.html) in the documentation for more information on how to contribute to the project.
59+
60+
> We would like to have this repository in a polite and friendly atmosphere, so please be kind and respectful to others. For more details, look at [Code of Conduct](https://github.com/espressif/arduino-esp32/blob/master/CODE_OF_CONDUCT.md).

Diff for: boards.txt

+39-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ menu.LoopCore=Arduino Runs On
1818
menu.EventsCore=Events Run On
1919
menu.MemoryType=Memory Type
2020
menu.EraseFlash=Erase All Flash Before Sketch Upload
21+
menu.JTAGAdapter=JTAG Adapter
2122

2223
##############################################################
2324
### DO NOT PUT BOARDS ABOVE THE OFFICIAL ESPRESSIF BOARDS! ###
@@ -69,6 +70,14 @@ esp32s3.build.event_core=
6970
esp32s3.build.psram_type=qspi
7071
esp32s3.build.memory_type={build.boot}_{build.psram_type}
7172

73+
## IDE 2.0 Seems to not update the value
74+
esp32s3.menu.JTAGAdapter.default=Integrated USB JTAG
75+
esp32s3.menu.JTAGAdapter.default.build.openocdscript=esp32s3-builtin.cfg
76+
esp32s3.menu.JTAGAdapter.external=FTDI Adapter
77+
esp32s3.menu.JTAGAdapter.external.build.openocdscript=esp32s3-ftdi.cfg
78+
esp32s3.menu.JTAGAdapter.bridge=ESP USB Bridge
79+
esp32s3.menu.JTAGAdapter.bridge.build.openocdscript=esp32s3-bridge.cfg
80+
7281
esp32s3.menu.PSRAM.disabled=Disabled
7382
esp32s3.menu.PSRAM.disabled.build.defines=
7483
esp32s3.menu.PSRAM.disabled.build.psram_type=qspi
@@ -270,6 +279,14 @@ esp32c3.build.boot=qio
270279
esp32c3.build.partitions=default
271280
esp32c3.build.defines=
272281

282+
## IDE 2.0 Seems to not update the value
283+
esp32c3.menu.JTAGAdapter.default=Integrated USB JTAG
284+
esp32c3.menu.JTAGAdapter.default.build.openocdscript=esp32c3-builtin.cfg
285+
esp32c3.menu.JTAGAdapter.external=FTDI Adapter
286+
esp32c3.menu.JTAGAdapter.external.build.openocdscript=esp32c3-ftdi.cfg
287+
esp32c3.menu.JTAGAdapter.bridge=ESP USB Bridge
288+
esp32c3.menu.JTAGAdapter.bridge.build.openocdscript=esp32c3-bridge.cfg
289+
273290
esp32c3.menu.CDCOnBoot.default=Disabled
274291
esp32c3.menu.CDCOnBoot.default.build.cdc_on_boot=0
275292
esp32c3.menu.CDCOnBoot.cdc=Enabled
@@ -427,6 +444,12 @@ esp32s2.build.boot=qio
427444
esp32s2.build.partitions=default
428445
esp32s2.build.defines=
429446

447+
## IDE 2.0 Seems to not update the value
448+
esp32s2.menu.JTAGAdapter.external=FTDI Adapter
449+
esp32s2.menu.JTAGAdapter.external.build.openocdscript=esp32s2-kaluga-1.cfg
450+
esp32s2.menu.JTAGAdapter.bridge=ESP USB Bridge
451+
esp32s2.menu.JTAGAdapter.bridge.build.openocdscript=esp32s2-bridge.cfg
452+
430453
esp32s2.menu.CDCOnBoot.default=Disabled
431454
esp32s2.menu.CDCOnBoot.default.build.cdc_on_boot=0
432455
esp32s2.menu.CDCOnBoot.cdc=Enabled
@@ -603,6 +626,12 @@ esp32.build.defines=
603626
esp32.build.loop_core=
604627
esp32.build.event_core=
605628

629+
## IDE 2.0 Seems to not update the value
630+
esp32.menu.JTAGAdapter.external=FTDI Adapter
631+
esp32.menu.JTAGAdapter.external.build.openocdscript=esp32-wrover-kit-3.3v.cfg
632+
esp32.menu.JTAGAdapter.bridge=ESP USB Bridge
633+
esp32.menu.JTAGAdapter.bridge.build.openocdscript=esp32-bridge.cfg
634+
606635
esp32.menu.PSRAM.disabled=Disabled
607636
esp32.menu.PSRAM.disabled.build.defines=
608637
esp32.menu.PSRAM.disabled.build.extra_libs=
@@ -2209,6 +2238,9 @@ rmp.vid.0=0x303a
22092238
rmp.pid.0=0x80F6
22102239

22112240
rmp.upload.tool=esptool_py
2241+
rmp.upload.tool.default=esptool_py
2242+
rmp.upload.tool.network=esp_ota
2243+
22122244
rmp.upload.maximum_size=1310720
22132245
rmp.upload.maximum_data_size=327680
22142246
rmp.upload.flags=
@@ -9968,6 +10000,9 @@ esp32doit-devkit-v1.menu.EraseFlash.all.upload.erase_cmd=-e
996810000
esp32doit-espduino.name=DOIT ESPduino32
996910001

997010002
esp32doit-espduino.upload.tool=esptool_py
10003+
esp32doit-espduino.upload.tool.default=esptool_py
10004+
esp32doit-espduino.upload.tool.network=esp_ota
10005+
997110006
esp32doit-espduino.upload.maximum_size=1310720
997210007
esp32doit-espduino.upload.maximum_data_size=327680
997310008
esp32doit-espduino.upload.wait_for_upload_port=true
@@ -13121,7 +13156,10 @@ oroca_edubot.menu.EraseFlash.all.upload.erase_cmd=-e
1312113156

1312213157
fm-devkit.name=ESP32 FM DevKit
1312313158

13124-
fm-devkit.upload.tool=esptool
13159+
fm-devkit.upload.tool=esptool_py
13160+
fm-devkit.upload.tool.default=esptool_py
13161+
fm-devkit.upload.tool.network=esp_ota
13162+
1312513163
fm-devkit.upload.maximum_size=1310720
1312613164
fm-devkit.upload.maximum_data_size=327680
1312713165
fm-devkit.upload.flags=

Diff for: cores/esp32/HardwareSerial.cpp

+12-13
Original file line numberDiff line numberDiff line change
@@ -450,10 +450,12 @@ int HardwareSerial::peek(void)
450450

451451
int HardwareSerial::read(void)
452452
{
453-
if(available()) {
454-
return uartRead(_uart);
453+
uint8_t c = 0;
454+
if (uartReadBytes(_uart, &c, 1, 0) == 1) {
455+
return c;
456+
} else {
457+
return -1;
455458
}
456-
return -1;
457459
}
458460

459461
// read characters into buffer
@@ -462,16 +464,13 @@ int HardwareSerial::read(void)
462464
// the buffer is NOT null terminated.
463465
size_t HardwareSerial::read(uint8_t *buffer, size_t size)
464466
{
465-
size_t avail = available();
466-
if (size < avail) {
467-
avail = size;
468-
}
469-
size_t count = 0;
470-
while(count < avail) {
471-
*buffer++ = uartRead(_uart);
472-
count++;
473-
}
474-
return count;
467+
return uartReadBytes(_uart, buffer, size, 0);
468+
}
469+
470+
// Overrides Stream::readBytes() to be faster using IDF
471+
size_t HardwareSerial::readBytes(uint8_t *buffer, size_t length)
472+
{
473+
return uartReadBytes(_uart, buffer, length, (uint32_t)getTimeout());
475474
}
476475

477476
void HardwareSerial::flush(void)

Diff for: cores/esp32/HardwareSerial.h

+6
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ class HardwareSerial: public Stream
118118
{
119119
return read((uint8_t*) buffer, size);
120120
}
121+
// Overrides Stream::readBytes() to be faster using IDF
122+
size_t readBytes(uint8_t *buffer, size_t length);
123+
size_t readBytes(char *buffer, size_t length)
124+
{
125+
return readBytes((uint8_t *) buffer, length);
126+
}
121127
void flush(void);
122128
void flush( bool txOnly);
123129
size_t write(uint8_t);

Diff for: cores/esp32/USB.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ ESPUSB::~ESPUSB(){
160160

161161
bool ESPUSB::begin(){
162162
if(!_started){
163-
#if CONFIG_IDF_TARGET_ESP32S3
163+
#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3
164164
if(serial_number == "__MAC__"){
165165
StreamString s;
166166
uint8_t m[6];

0 commit comments

Comments
 (0)