Skip to content

Commit 9682e0d

Browse files
Merge branch 'espressif:master' into master
2 parents 78a489e + fc85010 commit 9682e0d

File tree

67 files changed

+664
-175
lines changed

Some content is hidden

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

67 files changed

+664
-175
lines changed

.github/ISSUE_TEMPLATE/Issue-report.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ body:
4343
- latest stable Release (if not listed below)
4444
- latest development Release Candidate (RC-X)
4545
- latest master (checkout manually)
46+
- v3.3.4
4647
- v3.3.3
4748
- v3.3.2
4849
- v3.3.1

.gitlab/workflows/common.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ stages:
1313

1414
variables:
1515
ESP_IDF_VERSION: "5.5"
16-
ESP_ARDUINO_VERSION: "3.3.3"
16+
ESP_ARDUINO_VERSION: "3.3.4"
1717

1818
#############
1919
# `default` #

boards.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42936,10 +42936,10 @@ waveshare_esp32_s3_zero.menu.USBMode.hwcdc.build.usb_mode=1
4293642936
waveshare_esp32_s3_zero.menu.USBMode.default=USB-OTG (TinyUSB)
4293742937
waveshare_esp32_s3_zero.menu.USBMode.default.build.usb_mode=0
4293842938

42939-
waveshare_esp32_s3_zero.menu.CDCOnBoot.default=Disabled
42940-
waveshare_esp32_s3_zero.menu.CDCOnBoot.default.build.cdc_on_boot=0
42941-
waveshare_esp32_s3_zero.menu.CDCOnBoot.cdc=Enabled
42942-
waveshare_esp32_s3_zero.menu.CDCOnBoot.cdc.build.cdc_on_boot=1
42939+
waveshare_esp32_s3_zero.menu.CDCOnBoot.default=Enabled
42940+
waveshare_esp32_s3_zero.menu.CDCOnBoot.default.build.cdc_on_boot=1
42941+
waveshare_esp32_s3_zero.menu.CDCOnBoot.cdc=Disabled
42942+
waveshare_esp32_s3_zero.menu.CDCOnBoot.cdc.build.cdc_on_boot=0
4294342943

4294442944
waveshare_esp32_s3_zero.menu.MSCOnBoot.default=Disabled
4294542945
waveshare_esp32_s3_zero.menu.MSCOnBoot.default.build.msc_on_boot=0

cores/esp32/esp32-hal-hosted.c

Lines changed: 128 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@
1717

1818
#include "esp32-hal-hosted.h"
1919
#include "esp32-hal-log.h"
20+
#include "pins_arduino.h"
2021

22+
#include "esp_hosted.h"
2123
#include "esp_hosted_transport_config.h"
22-
extern esp_err_t esp_hosted_init();
23-
extern esp_err_t esp_hosted_deinit();
24+
// extern esp_err_t esp_hosted_init();
25+
// extern esp_err_t esp_hosted_deinit();
2426

2527
static bool hosted_initialized = false;
2628
static bool hosted_ble_active = false;
@@ -46,6 +48,100 @@ static sdio_pin_config_t sdio_pin_config = {
4648
#endif
4749
};
4850

51+
static esp_hosted_coprocessor_fwver_t slave_version_struct = {.major1 = 0, .minor1 = 0, .patch1 = 0};
52+
static esp_hosted_coprocessor_fwver_t host_version_struct = {
53+
.major1 = ESP_HOSTED_VERSION_MAJOR_1, .minor1 = ESP_HOSTED_VERSION_MINOR_1, .patch1 = ESP_HOSTED_VERSION_PATCH_1
54+
};
55+
56+
void hostedGetHostVersion(uint32_t *major, uint32_t *minor, uint32_t *patch) {
57+
*major = host_version_struct.major1;
58+
*minor = host_version_struct.minor1;
59+
*patch = host_version_struct.patch1;
60+
}
61+
62+
void hostedGetSlaveVersion(uint32_t *major, uint32_t *minor, uint32_t *patch) {
63+
*major = slave_version_struct.major1;
64+
*minor = slave_version_struct.minor1;
65+
*patch = slave_version_struct.patch1;
66+
}
67+
68+
bool hostedHasUpdate() {
69+
uint32_t host_version = ESP_HOSTED_VERSION_VAL(host_version_struct.major1, host_version_struct.minor1, host_version_struct.patch1);
70+
uint32_t slave_version = 0;
71+
72+
esp_err_t ret = esp_hosted_get_coprocessor_fwversion(&slave_version_struct);
73+
if (ret != ESP_OK) {
74+
log_e("Could not get slave firmware version: %s", esp_err_to_name(ret));
75+
} else {
76+
slave_version = ESP_HOSTED_VERSION_VAL(slave_version_struct.major1, slave_version_struct.minor1, slave_version_struct.patch1);
77+
}
78+
79+
log_i("Host firmware version: %" PRIu32 ".%" PRIu32 ".%" PRIu32, host_version_struct.major1, host_version_struct.minor1, host_version_struct.patch1);
80+
log_i("Slave firmware version: %" PRIu32 ".%" PRIu32 ".%" PRIu32, slave_version_struct.major1, slave_version_struct.minor1, slave_version_struct.patch1);
81+
82+
// compare major.minor only
83+
// slave_version &= 0xFFFFFF00;
84+
// host_version &= 0xFFFFFF00;
85+
86+
if (host_version == slave_version) {
87+
log_i("Versions Match!");
88+
} else if (host_version > slave_version) {
89+
log_w("Version on Host is NEWER than version on co-processor");
90+
log_w("Update URL: %s", hostedGetUpdateURL());
91+
return true;
92+
} else {
93+
log_w("Version on Host is OLDER than version on co-processor");
94+
}
95+
return false;
96+
}
97+
98+
char *hostedGetUpdateURL() {
99+
// https://espressif.github.io/arduino-esp32/hosted/esp32c6-v1.2.3.bin
100+
static char url[92] = {0};
101+
snprintf(
102+
url, 92, "https://espressif.github.io/arduino-esp32/hosted/%s-v%" PRIu32 ".%" PRIu32 ".%" PRIu32 ".bin", CONFIG_ESP_HOSTED_IDF_SLAVE_TARGET,
103+
host_version_struct.major1, host_version_struct.minor1, host_version_struct.patch1
104+
);
105+
return url;
106+
}
107+
108+
bool hostedBeginUpdate() {
109+
esp_err_t err = esp_hosted_slave_ota_begin();
110+
if (err != ESP_OK) {
111+
log_e("Failed to begin Update: %s", esp_err_to_name(err));
112+
}
113+
return err == ESP_OK;
114+
}
115+
116+
bool hostedWriteUpdate(uint8_t *buf, uint32_t len) {
117+
esp_err_t err = esp_hosted_slave_ota_write(buf, len);
118+
if (err != ESP_OK) {
119+
log_e("Failed to write Update: %s", esp_err_to_name(err));
120+
}
121+
return err == ESP_OK;
122+
}
123+
124+
bool hostedEndUpdate() {
125+
esp_err_t err = esp_hosted_slave_ota_end();
126+
if (err != ESP_OK) {
127+
log_e("Failed to end Update: %s", esp_err_to_name(err));
128+
}
129+
return err == ESP_OK;
130+
}
131+
132+
bool hostedActivateUpdate() {
133+
esp_err_t err = esp_hosted_slave_ota_activate();
134+
if (err != ESP_OK) {
135+
log_e("Failed to activate Update: %s", esp_err_to_name(err));
136+
}
137+
// else {
138+
// hostedDeinit();
139+
// delay(1000);
140+
// hostedInit();
141+
// }
142+
return err == ESP_OK;
143+
}
144+
49145
static bool hostedInit() {
50146
if (!hosted_initialized) {
51147
log_i("Initializing ESP-Hosted");
@@ -69,6 +165,12 @@ static bool hostedInit() {
69165
return false;
70166
}
71167
log_i("ESP-Hosted initialized!");
168+
if (esp_hosted_connect_to_slave() != ESP_OK) {
169+
log_e("Failed to connect to slave");
170+
return false;
171+
}
172+
hostedHasUpdate();
173+
return true;
72174
}
73175

74176
// Attach pins to PeriMan here
@@ -101,8 +203,21 @@ static bool hostedDeinit() {
101203

102204
bool hostedInitBLE() {
103205
log_i("Initializing ESP-Hosted for BLE");
206+
if (!hostedInit()) {
207+
return false;
208+
}
209+
esp_err_t err = esp_hosted_bt_controller_init();
210+
if (err != ESP_OK) {
211+
log_e("esp_hosted_bt_controller_init failed: %s", esp_err_to_name(err));
212+
return false;
213+
}
214+
err = esp_hosted_bt_controller_enable();
215+
if (err != ESP_OK) {
216+
log_e("esp_hosted_bt_controller_enable failed: %s", esp_err_to_name(err));
217+
return false;
218+
}
104219
hosted_ble_active = true;
105-
return hostedInit();
220+
return true;
106221
}
107222

108223
bool hostedInitWiFi() {
@@ -113,6 +228,16 @@ bool hostedInitWiFi() {
113228

114229
bool hostedDeinitBLE() {
115230
log_i("Deinitializing ESP-Hosted for BLE");
231+
esp_err_t err = esp_hosted_bt_controller_disable();
232+
if (err != ESP_OK) {
233+
log_e("esp_hosted_bt_controller_disable failed: %s", esp_err_to_name(err));
234+
return false;
235+
}
236+
err = esp_hosted_bt_controller_deinit(false);
237+
if (err != ESP_OK) {
238+
log_e("esp_hosted_bt_controller_deinit failed: %s", esp_err_to_name(err));
239+
return false;
240+
}
116241
hosted_ble_active = false;
117242
if (!hosted_wifi_active) {
118243
return hostedDeinit();

cores/esp32/esp32-hal-hosted.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ bool hostedIsBLEActive();
4444
bool hostedIsWiFiActive();
4545
bool hostedSetPins(int8_t clk, int8_t cmd, int8_t d0, int8_t d1, int8_t d2, int8_t d3, int8_t rst);
4646
void hostedGetPins(int8_t *clk, int8_t *cmd, int8_t *d0, int8_t *d1, int8_t *d2, int8_t *d3, int8_t *rst);
47+
void hostedGetHostVersion(uint32_t *major, uint32_t *minor, uint32_t *patch);
48+
void hostedGetSlaveVersion(uint32_t *major, uint32_t *minor, uint32_t *patch);
49+
bool hostedHasUpdate();
50+
char *hostedGetUpdateURL();
51+
bool hostedBeginUpdate();
52+
bool hostedWriteUpdate(uint8_t *buf, uint32_t len);
53+
bool hostedEndUpdate();
54+
bool hostedActivateUpdate();
4755

4856
#ifdef __cplusplus
4957
}

cores/esp32/esp_arduino_version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ extern "C" {
2323
/** Minor version number (x.X.x) */
2424
#define ESP_ARDUINO_VERSION_MINOR 3
2525
/** Patch version number (x.x.X) */
26-
#define ESP_ARDUINO_VERSION_PATCH 3
26+
#define ESP_ARDUINO_VERSION_PATCH 4
2727

2828
/**
2929
* Macro to convert ARDUINO version number into an integer

docs/conf_common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Used for substituting variables in the documentation
66
rst_prolog = """
7-
.. |version| replace:: 3.3.3
7+
.. |version| replace:: 3.3.4
88
.. |idf_version| replace:: 5.5
99
"""
1010

idf_component.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ dependencies:
5454
espressif/esp_modem:
5555
version: "^1.1.0"
5656
espressif/esp-zboss-lib:
57-
version: "==1.6.4" # compatible with esp-zigbee-lib 1.6.7
57+
version: "==1.6.4" # compatible with esp-zigbee-lib 1.6.8
5858
require: public
5959
rules:
6060
- if: "target not in [esp32c2, esp32p4]"
6161
espressif/esp-zigbee-lib:
62-
version: "==1.6.7"
62+
version: "==1.6.8"
6363
require: public
6464
rules:
6565
- if: "target not in [esp32c2, esp32p4]"
@@ -94,7 +94,7 @@ dependencies:
9494
rules:
9595
- if: "target not in [esp32c2, esp32p4]"
9696
espressif/cbor:
97-
version: "0.6.0~1"
97+
version: "0.6.1~4"
9898
rules:
9999
- if: "target not in [esp32c2, esp32p4]"
100100
espressif/qrcode:

libraries/ArduinoOTA/library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=ArduinoOTA
2-
version=3.3.3
2+
version=3.3.4
33
author=Ivan Grokhotkov and Hristo Gochkov
44
maintainer=Hristo Gochkov <hristo@espressif.com>
55
sentence=Enables Over The Air upgrades, via wifi and espota.py UDP request/TCP download.

libraries/AsyncUDP/library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=ESP32 Async UDP
2-
version=3.3.3
2+
version=3.3.4
33
author=Me-No-Dev
44
maintainer=Me-No-Dev
55
sentence=Async UDP Library for ESP32

0 commit comments

Comments
 (0)