Skip to content

Commit 6db3430

Browse files
authored
Merge branch 'master' into master
2 parents 1565bd2 + f5be003 commit 6db3430

File tree

13 files changed

+1067
-218
lines changed

13 files changed

+1067
-218
lines changed

.github/scripts/install-arduino-cli.sh

+7-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ fi
4141
if [ ! -d "$ARDUINO_IDE_PATH" ] || [ ! -f "$ARDUINO_IDE_PATH/arduino-cli" ]; then
4242
echo "Installing Arduino CLI on $OS_NAME ..."
4343
mkdir -p "$ARDUINO_IDE_PATH"
44-
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR="$ARDUINO_IDE_PATH" sh
44+
if [ "$OS_IS_WINDOWS" == "1" ]; then
45+
curl -fsSL https://downloads.arduino.cc/arduino-cli/arduino-cli_latest_Windows_64bit.zip -o arduino-cli.zip
46+
unzip -q arduino-cli.zip -d "$ARDUINO_IDE_PATH"
47+
rm arduino-cli.zip
48+
else
49+
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR="$ARDUINO_IDE_PATH" sh
50+
fi
4551
fi
4652

.github/workflows/tests_hw.yml

+14
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ on:
1212
description: 'Chip to run tests for'
1313
required: true
1414

15+
env:
16+
DEBIAN_FRONTEND: noninteractive
17+
18+
defaults:
19+
run:
20+
shell: bash
21+
1522
jobs:
1623
hardware-test:
1724
name: Hardware ${{ inputs.chip }} ${{ inputs.type }} tests
@@ -48,6 +55,13 @@ jobs:
4855
- name: Checkout user repository
4956
if: ${{ steps.check-tests.outputs.enabled == 'true' }}
5057
uses: actions/checkout@v4
58+
with:
59+
sparse-checkout: |
60+
*
61+
62+
- name: List files
63+
if: ${{ steps.check-tests.outputs.enabled == 'true' }}
64+
run: ls -la
5165

5266
# setup-python currently only works on ubuntu images
5367
# - uses: actions/setup-python@v5

boards.txt

100644100755
+851-182
Large diffs are not rendered by default.

cores/esp32/esp32-hal-gpio.h

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ extern "C" {
2727
#include "esp32-hal.h"
2828
#include "soc/soc_caps.h"
2929
#include "pins_arduino.h"
30+
#include "driver/gpio.h"
3031

3132
#if (CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3)
3233
#define NUM_OUPUT_PINS 46

cores/esp32/esp32-hal-timer.c

+59-11
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,28 @@ struct timer_struct_t {
3737
};
3838

3939
inline uint64_t timerRead(hw_timer_t *timer) {
40-
40+
if (timer == NULL) {
41+
log_e("Timer handle is NULL");
42+
return 0;
43+
}
4144
uint64_t value;
4245
gptimer_get_raw_count(timer->timer_handle, &value);
4346
return value;
4447
}
4548

4649
void timerWrite(hw_timer_t *timer, uint64_t val) {
50+
if (timer == NULL) {
51+
log_e("Timer handle is NULL");
52+
return;
53+
}
4754
gptimer_set_raw_count(timer->timer_handle, val);
4855
}
4956

5057
void timerAlarm(hw_timer_t *timer, uint64_t alarm_value, bool autoreload, uint64_t reload_count) {
58+
if (timer == NULL) {
59+
log_e("Timer handle is NULL");
60+
return;
61+
}
5162
esp_err_t err = ESP_OK;
5263
gptimer_alarm_config_t alarm_cfg = {
5364
.alarm_count = alarm_value,
@@ -61,22 +72,37 @@ void timerAlarm(hw_timer_t *timer, uint64_t alarm_value, bool autoreload, uint64
6172
}
6273

6374
uint32_t timerGetFrequency(hw_timer_t *timer) {
75+
if (timer == NULL) {
76+
return 0;
77+
}
6478
uint32_t frequency;
6579
gptimer_get_resolution(timer->timer_handle, &frequency);
6680
return frequency;
6781
}
6882

6983
void timerStart(hw_timer_t *timer) {
84+
if (timer == NULL) {
85+
log_e("Timer handle is NULL");
86+
return;
87+
}
7088
gptimer_start(timer->timer_handle);
7189
timer->timer_started = true;
7290
}
7391

7492
void timerStop(hw_timer_t *timer) {
93+
if (timer == NULL) {
94+
log_e("Timer handle is NULL");
95+
return;
96+
}
7597
gptimer_stop(timer->timer_handle);
7698
timer->timer_started = false;
7799
}
78100

79101
void timerRestart(hw_timer_t *timer) {
102+
if (timer == NULL) {
103+
log_e("Timer handle is NULL");
104+
return;
105+
}
80106
gptimer_set_raw_count(timer->timer_handle, 0);
81107
}
82108

@@ -129,17 +155,19 @@ hw_timer_t *timerBegin(uint32_t frequency) {
129155
}
130156

131157
void timerEnd(hw_timer_t *timer) {
132-
esp_err_t err = ESP_OK;
133-
if (timer->timer_started == true) {
134-
gptimer_stop(timer->timer_handle);
135-
}
136-
gptimer_disable(timer->timer_handle);
137-
err = gptimer_del_timer(timer->timer_handle);
138-
if (err != ESP_OK) {
139-
log_e("Failed to destroy GPTimer, error num=%d", err);
140-
return;
158+
if (timer != NULL) {
159+
esp_err_t err = ESP_OK;
160+
if (timer->timer_started == true) {
161+
gptimer_stop(timer->timer_handle);
162+
}
163+
gptimer_disable(timer->timer_handle);
164+
err = gptimer_del_timer(timer->timer_handle);
165+
if (err != ESP_OK) {
166+
log_e("Failed to destroy GPTimer, error num=%d", err);
167+
return;
168+
}
169+
free(timer);
141170
}
142-
free(timer);
143171
}
144172

145173
bool IRAM_ATTR timerFnWrapper(gptimer_handle_t timer, const gptimer_alarm_event_data_t *edata, void *args) {
@@ -156,6 +184,10 @@ bool IRAM_ATTR timerFnWrapper(gptimer_handle_t timer, const gptimer_alarm_event_
156184
}
157185

158186
void timerAttachInterruptFunctionalArg(hw_timer_t *timer, void (*userFunc)(void *), void *arg) {
187+
if (timer == NULL) {
188+
log_e("Timer handle is NULL");
189+
return;
190+
}
159191
esp_err_t err = ESP_OK;
160192
gptimer_event_callbacks_t cbs = {
161193
.on_alarm = timerFnWrapper,
@@ -187,6 +219,10 @@ void timerAttachInterrupt(hw_timer_t *timer, voidFuncPtr userFunc) {
187219
}
188220

189221
void timerDetachInterrupt(hw_timer_t *timer) {
222+
if (timer == NULL) {
223+
log_e("Timer handle is NULL");
224+
return;
225+
}
190226
esp_err_t err = ESP_OK;
191227
err = gptimer_set_alarm_action(timer->timer_handle, NULL);
192228
timer->interrupt_handle.fn = NULL;
@@ -197,18 +233,30 @@ void timerDetachInterrupt(hw_timer_t *timer) {
197233
}
198234

199235
uint64_t timerReadMicros(hw_timer_t *timer) {
236+
if (timer == NULL) {
237+
log_e("Timer handle is NULL");
238+
return 0;
239+
}
200240
uint64_t timer_val = timerRead(timer);
201241
uint32_t frequency = timerGetFrequency(timer);
202242
return timer_val * 1000000 / frequency;
203243
}
204244

205245
uint64_t timerReadMilis(hw_timer_t *timer) {
246+
if (timer == NULL) {
247+
log_e("Timer handle is NULL");
248+
return 0;
249+
}
206250
uint64_t timer_val = timerRead(timer);
207251
uint32_t frequency = timerGetFrequency(timer);
208252
return timer_val * 1000 / frequency;
209253
}
210254

211255
double timerReadSeconds(hw_timer_t *timer) {
256+
if (timer == NULL) {
257+
log_e("Timer handle is NULL");
258+
return 0;
259+
}
212260
uint64_t timer_val = timerRead(timer);
213261
uint32_t frequency = timerGetFrequency(timer);
214262
return (double)timer_val / frequency;

libraries/NetworkClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino

+31-21
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,37 @@ const char *server = "www.howsmyssl.com"; // Server URL
1818
// change it to your server root CA
1919
// SHA1 fingerprint is broken now!
2020

21-
const char *test_root_ca = "-----BEGIN CERTIFICATE-----\n"
22-
"MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/\n"
23-
"MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT\n"
24-
"DkRTVCBSb290IENBIFgzMB4XDTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVow\n"
25-
"PzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQD\n"
26-
"Ew5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB\n"
27-
"AN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmTrE4O\n"
28-
"rz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEq\n"
29-
"OLl5CjH9UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9b\n"
30-
"xiqKqy69cK3FCxolkHRyxXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw\n"
31-
"7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40dutolucbY38EVAjqr2m7xPi71XAicPNaD\n"
32-
"aeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNV\n"
33-
"HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQMA0GCSqG\n"
34-
"SIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69\n"
35-
"ikugdB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXr\n"
36-
"AvHRAosZy5Q6XkjEGB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZz\n"
37-
"R8srzJmwN0jP41ZL9c8PDHIyh8bwRLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5\n"
38-
"JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06XyxV3bqxbYo\n"
39-
"Ob8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ\n"
40-
"-----END CERTIFICATE-----\n";
41-
21+
const char *test_root_ca = R"literal(
22+
-----BEGIN CERTIFICATE-----
23+
MIIFBTCCAu2gAwIBAgIQS6hSk/eaL6JzBkuoBI110DANBgkqhkiG9w0BAQsFADBP
24+
MQswCQ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aBw1bGWKCIL0vIo
40+
zwzn1OZDjCQiHcFCktEJr59L9MhwTyAWsVrdAfYf+B9haxQnsHKNY67u4s5Lzzfd
41+
u6PUzeetUK29v+PsPmI2cJkxp+iN3epi4hKu9ZzUPSwMqtCceb7qPVxEbpYxY1p9
42+
1n5PJKBLBX9eb9LU6l8zSxPWV7bK3lG4XaMJgnT9x3ies7msFtpKK5bDtotij/l0
43+
GaKeA97pb5uwD9KgWvaFXMIEt8jVTjLEvwRdvCn294GPDF08U8lAkIv7tghluaQh
44+
1QnlE4SEN4LOECj8dsIGJXpGUk3aU3KkJz9icKy+aUgA+2cP21uh6NcDIS3XyfaZ
45+
QjmDQ993ChII8SXWupQZVBiIpcWO4RqZk3lr7Bz5MUCwzDIA359e57SSq5CCkY0N
46+
4B6Vulk7LktfwrdGNVI5BsC9qqxSwSKgRJeZ9wygIaehbHFHFhcBaMDKpiZlBHyz
47+
rsnnlFXCb5s8HKn5LsUgGvB24L7sGNZP2CX7dhHov+YhD+jozLW2p9W4959Bz2Ei
48+
RmqDtmiXLnzqTpXbI+suyCsohKRg6Un0RC47+cpiVwHiXZAW+cn8eiNIjqbVgXLx
49+
KPpdzvvtTnOPlC7SQZSYmdunr3Bf9b77AiC/ZidstK36dRILKz7OA54=
50+
-----END CERTIFICATE-----
51+
)literal";
4252
// You can use x.509 client certificates if you want
4353
//const char* test_client_key = ""; //to verify the client
4454
//const char* test_client_cert = ""; //to verify the client

libraries/RainMaker/examples/README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
While building any examples for ESP RainMaker, take care of the following:
44

5-
1. Change partition scheme in Arduino IDE to RainMaker (Tools -> Partition Scheme -> RainMaker).
5+
1. Change the partition scheme that fits your flash size in Arduino IDE to "RainMaker 4MB", "RainMaker 4MB no OTA" or "RainMaker 8MB" (Tools -> Partition Scheme -> RainMaker).
66
2. Once ESP RainMaker gets started, compulsorily call `WiFi.beginProvision()` which is responsible for user-node mapping.
77
3. Use the appropriate provisioning scheme as per the board.
88
- ESP32 Board: BLE Provisioning
99
- ESP32-C3 Board: BLE Provisioning
1010
- ESP32-S3 Board: BLE Provisioning
1111
- ESP32-S2 Board: SoftAP Provisioning
12-
4. Set debug level to Info (Tools -> Core Debug Level -> Info). This is recommended debug level but not mandatory to run RainMaker.
12+
- ESP32-C6 Board: BLE Provisioning
13+
- ESP32-H2 Board: BLE Provisioning
14+
4. Set debug level to Info (Tools -> Core Debug Level -> Info). This is the recommended debug level but not mandatory to run RainMaker.

tools/partitions/rainmaker.csv

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ otadata, data, ota, 0xe000, 0x2000,
44
ota_0, app, ota_0, 0x10000, 0x1E0000,
55
ota_1, app, ota_1, 0x1F0000, 0x1E0000,
66
fctry, data, nvs, 0x3D0000, 0x6000,
7-
coredump, data, coredump, 0x3F0000, 0x10000,
7+
coredump, data, coredump,0x3F0000, 0x10000,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Name, Type, SubType, Offset, Size, Flags
2+
nvs, data, nvs, 0x9000, 0x5000,
3+
otadata, data, ota, 0xe000, 0x2000,
4+
ota_0, app, ota_0, 0x10000, 0x3DA000,
5+
fctry, data, nvs, 0x3EA000, 0x6000,
6+
coredump, data, coredump,0x3F0000, 0x10000,

tools/partitions/rainmaker_8MB.csv

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Name, Type, SubType, Offset, Size, Flags
2+
nvs, data, nvs, 0x9000, 0x5000,
3+
otadata, data, ota, 0xe000, 0x2000,
4+
ota_0, app, ota_0, 0x10000, 0x3ED000,
5+
ota_1, app, ota_1, 0x3FD000, 0x3ED000,
6+
fctry, data, nvs, 0x7EA000, 0x6000,
7+
coredump, data, coredump,0x7F0000, 0x10000,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Name, Type, SubType, Offset, Size, Flags
2+
nvs, data, nvs, 0x9000, 0x5000,
3+
factory, app, factory, 0x10000, 0x3F0000,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Name, Type, SubType, Offset, Size, Flags
2+
nvs, data, nvs, 0x9000, 0x5000,
3+
otadata, data, ota, 0xE000, 0x2000,
4+
app0, app, ota_0, 0x10000, 0x1F0000,
5+
app1, app, ota_1, 0x200000, 0x1F0000,
6+
coredump, data, coredump, 0x3F0000, 0x10000,
+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
2+
#ifndef Pins_Arduino_h
3+
#define Pins_Arduino_h
4+
5+
#include <stdint.h>
6+
#include "soc/soc_caps.h"
7+
8+
// BN: ESP32 Family Device
9+
#define USB_VID 0x303a
10+
#define USB_PID 0x1001
11+
12+
#define USB_MANUFACTURER "Waveshare"
13+
#define USB_PRODUCT "ESP32-S3-Matrix"
14+
#define USB_SERIAL ""
15+
16+
// Onboard 8 x 8 Matrix panel
17+
#define WS_MATRIX_DIN 14
18+
19+
// Onboard QMI8658 IMU
20+
#define WS_IMU_SDA 11
21+
#define WS_IMU_SCL 12
22+
#define WS_IMU_ADDRESS 0x6B
23+
#define WS_IMU_INT1 10
24+
#define WS_IMU_INT2 13
25+
26+
// UART0 pins
27+
static const uint8_t TX = 43;
28+
static const uint8_t RX = 44;
29+
30+
// Def for I2C that shares the IMU I2C pins
31+
static const uint8_t SDA = 11;
32+
static const uint8_t SCL = 12;
33+
34+
// Mapping based on the ESP32S3 data sheet - alternate for SPI2
35+
static const uint8_t SS = 34; // FSPICS0
36+
static const uint8_t MOSI = 35; // FSPID
37+
static const uint8_t MISO = 37; // FSPIQ
38+
static const uint8_t SCK = 36; // FSPICLK
39+
40+
// Analog capable pins on the header
41+
static const uint8_t A0 = 1;
42+
static const uint8_t A1 = 2;
43+
static const uint8_t A2 = 3;
44+
static const uint8_t A3 = 4;
45+
static const uint8_t A4 = 5;
46+
static const uint8_t A5 = 6;
47+
static const uint8_t A6 = 7;
48+
49+
// GPIO capable pins on the header
50+
static const uint8_t D0 = 7;
51+
static const uint8_t D1 = 6;
52+
static const uint8_t D2 = 5;
53+
static const uint8_t D3 = 4;
54+
static const uint8_t D4 = 3;
55+
static const uint8_t D5 = 2;
56+
static const uint8_t D6 = 1;
57+
static const uint8_t D7 = 44;
58+
static const uint8_t D8 = 43;
59+
static const uint8_t D9 = 40;
60+
static const uint8_t D10 = 39;
61+
static const uint8_t D11 = 38;
62+
static const uint8_t D12 = 37;
63+
static const uint8_t D13 = 36;
64+
static const uint8_t D14 = 35;
65+
static const uint8_t D15 = 34;
66+
static const uint8_t D16 = 33;
67+
68+
// Touch input capable pins on the header
69+
static const uint8_t T1 = 1;
70+
static const uint8_t T2 = 2;
71+
static const uint8_t T3 = 3;
72+
static const uint8_t T4 = 4;
73+
static const uint8_t T5 = 5;
74+
static const uint8_t T6 = 6;
75+
static const uint8_t T7 = 7;
76+
77+
#endif /* Pins_Arduino_h */

0 commit comments

Comments
 (0)