Skip to content

Commit 4b72877

Browse files
authored
Merge branch 'master' into revert_wifi_disconnect_usestaticip_false
2 parents 2f25da2 + e9ee9c1 commit 4b72877

File tree

94 files changed

+2648
-439
lines changed

Some content is hidden

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

94 files changed

+2648
-439
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
2. [ ] Please provide related links (*eg. Issue which will be closed by this Pull Request*)
66
3. [ ] Please **update relevant Documentation** if applicable
77
4. [ ] Please check [Contributing guide](https://docs.espressif.com/projects/arduino-esp32/en/latest/contributing.html)
8+
5. [ ] Please **confirm option to "Allow edits and access to secrets by maintainers"** when opening a Pull Request
89

910
*This entire section above can be deleted if all items are checked.*
1011

.github/scripts/on-push.sh

+6-12
Original file line numberDiff line numberDiff line change
@@ -73,22 +73,16 @@ if [ "$BUILD_PIO" -eq 0 ]; then
7373

7474
SKETCHES_ESP32="\
7575
$ARDUINO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino\
76-
$ARDUINO_ESP32_PATH/libraries/BLE/examples/BLE_server/BLE_server.ino\
76+
$ARDUINO_ESP32_PATH/libraries/BLE/examples/Server/Server.ino\
7777
$ARDUINO_ESP32_PATH/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino\
7878
$ARDUINO_ESP32_PATH/libraries/Insights/examples/MinimalDiagnostics/MinimalDiagnostics.ino\
7979
"
8080

81-
SKETCHES_ESP32XX="\
82-
$ARDUINO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino\
83-
$ARDUINO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino\
84-
$ARDUINO_ESP32_PATH/libraries/Insights/examples/MinimalDiagnostics/MinimalDiagnostics.ino\
85-
"
86-
8781
build "esp32s3" $FQBN_ESP32S3 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32
88-
build "esp32s2" $FQBN_ESP32S2 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32XX
89-
build "esp32c3" $FQBN_ESP32C3 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32XX
90-
build "esp32c6" $FQBN_ESP32C6 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32XX
91-
build "esp32h2" $FQBN_ESP32H2 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32XX
82+
build "esp32s2" $FQBN_ESP32S2 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32
83+
build "esp32c3" $FQBN_ESP32C3 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32
84+
build "esp32c6" $FQBN_ESP32C6 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32
85+
build "esp32h2" $FQBN_ESP32H2 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32
9286
build "esp32" $FQBN_ESP32 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32
9387
else
9488
source ${SCRIPTS_DIR}/install-platformio-esp32.sh
@@ -98,7 +92,7 @@ else
9892
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \
9993
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino" && \
10094
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/BluetoothSerial/examples/SerialToSerialBT/SerialToSerialBT.ino" && \
101-
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/BLE/examples/BLE_server/BLE_server.ino" && \
95+
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/BLE/examples/Server/Server.ino" && \
10296
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino"
10397

10498
# Basic sanity testing for other series

.github/scripts/sketch_utils.sh

+16
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
126126
# of configuration built in case of a multiconfiguration test.
127127

128128
sketchname=$(basename $sketchdir)
129+
130+
if [[ -n $target ]] && [[ -f "$sketchdir/.skip.$target" ]]; then
131+
echo "Skipping $sketchname for target $target"
132+
exit 0
133+
fi
129134

130135
ARDUINO_CACHE_DIR="$HOME/.arduino/cache.tmp"
131136
if [ -n "$ARDUINO_BUILD_DIR" ]; then
@@ -159,6 +164,12 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
159164
--build-cache-path "$ARDUINO_CACHE_DIR" \
160165
--build-path "$build_dir" \
161166
$xtra_opts "${sketchdir}"
167+
168+
exit_status=$?
169+
if [ $exit_status -ne 0 ]; then
170+
echo ""ERROR: Compilation failed with error code $exit_status""
171+
exit $exit_status
172+
fi
162173
elif [ -f "$ide_path/arduino-builder" ]; then
163174
echo "Building $sketchname with arduino-builder and FQBN=$currfqbn"
164175
echo "Build path = $build_dir"
@@ -173,6 +184,11 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
173184
-build-path "$build_dir" \
174185
$xtra_opts "${sketchdir}/${sketchname}.ino"
175186

187+
exit_status=$?
188+
if [ $exit_status -ne 0 ]; then
189+
echo ""ERROR: Compilation failed with error code $exit_status""
190+
exit $exit_status
191+
fi
176192
# $ide_path/arduino-builder -compile -logger=human -core-api-version=10810 \
177193
# -fqbn=\"$currfqbn\" \
178194
# -warnings="all" \

.github/scripts/tests_build.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ while [ ! -z "$1" ]; do
4646
shift
4747
done
4848

49-
source ${SCRIPTS_DIR}/install-arduino-ide.sh
49+
#source ${SCRIPTS_DIR}/install-arduino-ide.sh
50+
source ${SCRIPTS_DIR}/install-arduino-cli.sh
5051
source ${SCRIPTS_DIR}/install-arduino-core-esp32.sh
5152

5253
args="-ai $ARDUINO_IDE_PATH -au $ARDUINO_USR_PATH"

.github/workflows/boards.yml

+10
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ jobs:
4545
- name: Checkout repository
4646
uses: actions/checkout@v3
4747

48+
- name: Check if build.board is uppercase
49+
run: |
50+
board_name=$(echo ${{ matrix.fqbn }} | awk -F':' '{print $NF}')
51+
if grep -q "^$board_name.build.board=[A-Z0-9_]*$" boards.txt; then
52+
echo "$board_name.build.board is valid.";
53+
else
54+
echo "Error: $board_name.build.board is not uppercase!";
55+
exit 1;
56+
fi
57+
4858
- name: Compile sketch
4959
uses: P-R-O-C-H-Y/compile-sketches@main
5060
with:

.github/workflows/dangerjs.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: DangerJS Pull Request linter
2+
on:
3+
pull_request_target:
4+
types: [opened, edited, reopened, synchronize]
5+
6+
permissions:
7+
pull-requests: write
8+
contents: write
9+
10+
jobs:
11+
pull-request-style-linter:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check out PR head
15+
uses: actions/checkout@v4
16+
with:
17+
ref: ${{ github.event.pull_request.head.sha }}
18+
19+
- name: DangerJS pull request linter
20+
uses: espressif/shared-github-dangerjs@v1
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ set(LIBRARY_SRCS
115115
libraries/Update/src/Updater.cpp
116116
libraries/Update/src/HttpsOTAUpdate.cpp
117117
libraries/USB/src/USBHID.cpp
118+
libraries/USB/src/USBMIDI.cpp
118119
libraries/USB/src/USBHIDMouse.cpp
119120
libraries/USB/src/USBHIDKeyboard.cpp
120121
libraries/USB/src/USBHIDGamepad.cpp

boards.txt

+9-7
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,8 @@ esp32c6.menu.PartitionScheme.custom.upload.maximum_size=16777216
430430

431431
esp32c6.menu.CPUFreq.160=160MHz (WiFi)
432432
esp32c6.menu.CPUFreq.160.build.f_cpu=160000000L
433+
esp32c6.menu.CPUFreq.120=120MHz (WiFi)
434+
esp32c6.menu.CPUFreq.120.build.f_cpu=120000000L
433435
esp32c6.menu.CPUFreq.80=80MHz (WiFi)
434436
esp32c6.menu.CPUFreq.80.build.f_cpu=80000000L
435437
esp32c6.menu.CPUFreq.40=40MHz
@@ -17110,7 +17112,7 @@ heltec_wifi_kit_32.build.target=esp32
1711017112
heltec_wifi_kit_32.build.mcu=esp32
1711117113
heltec_wifi_kit_32.build.core=esp32
1711217114
heltec_wifi_kit_32.build.variant=heltec_wifi_kit_32
17113-
heltec_wifi_kit_32.build.board=heltec_wifi_kit_32
17115+
heltec_wifi_kit_32.build.board=HELTEC_WIFI_KIT_32
1711417116

1711517117
heltec_wifi_kit_32.build.f_cpu=240000000L
1711617118
heltec_wifi_kit_32.build.flash_size=4MB
@@ -17199,7 +17201,7 @@ heltec_wifi_kit_32_V3.build.target=esp32s3
1719917201
heltec_wifi_kit_32_V3.build.mcu=esp32s3
1720017202
heltec_wifi_kit_32_V3.build.core=esp32
1720117203
heltec_wifi_kit_32_V3.build.variant=heltec_wifi_kit_32_V3
17202-
heltec_wifi_kit_32_V3.build.board=heltec_wifi_kit_32_V3
17204+
heltec_wifi_kit_32_V3.build.board=HELTEC_WIFI_KIT_32_V3
1720317205

1720417206
heltec_wifi_kit_32_V3.build.usb_mode=1
1720517207
heltec_wifi_kit_32_V3.build.cdc_on_boot=0
@@ -17298,7 +17300,7 @@ heltec_wifi_lora_32.build.target=esp32
1729817300
heltec_wifi_lora_32.build.mcu=esp32
1729917301
heltec_wifi_lora_32.build.core=esp32
1730017302
heltec_wifi_lora_32.build.variant=heltec_wifi_lora_32
17301-
heltec_wifi_lora_32.build.board=heltec_wifi_lora_32
17303+
heltec_wifi_lora_32.build.board=HELTEC_WIFI_LORA_32
1730217304

1730317305
heltec_wifi_lora_32.build.f_cpu=240000000L
1730417306
heltec_wifi_lora_32.build.flash_size=4MB
@@ -17435,7 +17437,7 @@ heltec_wifi_lora_32_V2.build.target=esp32
1743517437
heltec_wifi_lora_32_V2.build.mcu=esp32
1743617438
heltec_wifi_lora_32_V2.build.core=esp32
1743717439
heltec_wifi_lora_32_V2.build.variant=heltec_wifi_lora_32_V2
17438-
heltec_wifi_lora_32_V2.build.board=heltec_wifi_lora_32_V2
17440+
heltec_wifi_lora_32_V2.build.board=HELTEC_WIFI_LORA_32_V2
1743917441

1744017442
heltec_wifi_lora_32_V2.build.f_cpu=240000000L
1744117443
heltec_wifi_lora_32_V2.build.flash_size=8MB
@@ -17551,7 +17553,7 @@ heltec_wifi_lora_32_V3.build.target=esp32s3
1755117553
heltec_wifi_lora_32_V3.build.mcu=esp32s3
1755217554
heltec_wifi_lora_32_V3.build.core=esp32
1755317555
heltec_wifi_lora_32_V3.build.variant=heltec_wifi_lora_32_V3
17554-
heltec_wifi_lora_32_V3.build.board=heltec_wifi_32_lora_V3
17556+
heltec_wifi_lora_32_V3.build.board=HELTEC_WIFI_LORA_32_V3
1755517557

1755617558
heltec_wifi_lora_32_V3.build.usb_mode=1
1755717559
heltec_wifi_lora_32_V3.build.cdc_on_boot=0
@@ -17693,7 +17695,7 @@ heltec_wireless_stick.build.target=esp32
1769317695
heltec_wireless_stick.build.mcu=esp32
1769417696
heltec_wireless_stick.build.core=esp32
1769517697
heltec_wireless_stick.build.variant=heltec_wireless_stick
17696-
heltec_wireless_stick.build.board=heltec_wireless_stick
17698+
heltec_wireless_stick.build.board=HELTEC_WIRELESS_STICK
1769717699

1769817700
heltec_wireless_stick.build.f_cpu=240000000L
1769917701
heltec_wireless_stick.build.flash_size=8MB
@@ -17806,7 +17808,7 @@ heltec_wireless_stick_lite.build.target=esp32
1780617808
heltec_wireless_stick_lite.build.mcu=esp32
1780717809
heltec_wireless_stick_lite.build.core=esp32
1780817810
heltec_wireless_stick_lite.build.variant=heltec_wireless_stick_lite
17809-
heltec_wireless_stick_lite.build.board=heltec_wireless_stick_LITE
17811+
heltec_wireless_stick_lite.build.board=HELTEC_WIRELESS_STICK_LITE
1781017812

1781117813
heltec_wireless_stick_lite.build.f_cpu=240000000L
1781217814
heltec_wireless_stick_lite.build.flash_size=4MB

cores/esp32/Esp.cpp

+10-9
Original file line numberDiff line numberDiff line change
@@ -225,30 +225,31 @@ String EspClass::getSketchMD5()
225225
const esp_partition_t *running = esp_ota_get_running_partition();
226226
if (!running) {
227227
log_e("Partition could not be found");
228-
229228
return String();
230229
}
230+
231231
const size_t bufSize = SPI_FLASH_SEC_SIZE;
232-
std::unique_ptr<uint8_t[]> buf(new uint8_t[bufSize]);
233-
uint32_t offset = 0;
234-
if(!buf.get()) {
232+
uint8_t *pb = (uint8_t *)malloc(bufSize);
233+
if(!pb) {
235234
log_e("Not enough memory to allocate buffer");
236-
237235
return String();
238236
}
237+
uint32_t offset = 0;
238+
239239
MD5Builder md5;
240240
md5.begin();
241-
while( lengthLeft > 0) {
241+
while(lengthLeft > 0) {
242242
size_t readBytes = (lengthLeft < bufSize) ? lengthLeft : bufSize;
243-
if (!ESP.flashRead(running->address + offset, reinterpret_cast<uint32_t*>(buf.get()), (readBytes + 3) & ~3)) {
243+
if (!ESP.flashRead(running->address + offset, (uint32_t *)pb, (readBytes + 3) & ~3)) {
244+
free(pb);
244245
log_e("Could not read buffer from flash");
245-
246246
return String();
247247
}
248-
md5.add(buf.get(), readBytes);
248+
md5.add(pb, readBytes);
249249
lengthLeft -= readBytes;
250250
offset += readBytes;
251251
}
252+
free(pb);
252253
md5.calculate();
253254
result = md5.toString();
254255
return result;

0 commit comments

Comments
 (0)