Skip to content

Commit d4572e2

Browse files
authored
Merge branch 'master' into idf-release/v4.4
2 parents ffef02e + cf01523 commit d4572e2

File tree

20 files changed

+800
-211
lines changed

20 files changed

+800
-211
lines changed

boards.txt

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

docs/source/api/wifi.rst

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The Wi-Fi API provides support for the 802.11b/g/n protocol driver. This API inc
1111

1212
* AP mode (aka Soft-AP mode or Access Point mode). Devices connect to the ESP32
1313

14-
* Security modes (WPA, WPA2, WEP, etc.)
14+
* Security modes (WPA2, WPA3 etc.)
1515

1616
* Scanning for access points
1717

@@ -446,26 +446,12 @@ Return the connection state.
446446
setAutoConnect
447447
**************
448448

449-
Function used to set the automatic connection.
450-
451-
.. code-block:: arduino
452-
453-
bool setAutoConnect(bool autoConnect);
454-
455-
Where:
456-
457-
* ``bool autoConnect`` is set to ``true`` to enable this option.
449+
Function is deprecated.
458450

459451
getAutoConnect
460452
**************
461453

462-
Function used to get the automatic connection setting value.
463-
464-
.. code-block:: arduino
465-
466-
bool getAutoConnect();
467-
468-
The function will return ``true`` if the setting is enabled.
454+
Function is deprecated.
469455

470456
setAutoReconnect
471457
****************
@@ -484,11 +470,25 @@ getAutoReconnect
484470
****************
485471

486472
Function used to get the automatic reconnection if the connection is lost.
473+
487474
.. code-block:: arduino
488475
489476
bool getAutoReconnect();
490477
491-
The function will return ``true`` if this setting is enabled.
478+
The function will return ``true`` if this setting is enabled.
479+
480+
setMinSecurity
481+
**************
482+
483+
Function used to set the minimum security for AP to be considered connectable.
484+
485+
.. code-block:: arduino
486+
487+
bool setMinSecurity(wifi_auth_mode_t minSecurity);
488+
489+
Where:
490+
491+
* ``minSecurity`` is the minimum security for AP to be considered connectable. Default is ``WIFI_AUTH_WPA2_PSK``.
492492

493493
WiFiMulti
494494
---------

docs/source/troubleshooting.rst

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,42 @@ Solution
8080
* Change the USB port.
8181
* Check your power supply.
8282
* Check if the board is damaged or defective.
83+
84+
Wi-Fi
85+
-----
86+
87+
Why does the board not connect to WEP/WPA-"encrypted" Wi-Fi?
88+
************************************************************
89+
90+
Please note that WEP/WPA has significant security vulnerabilities and its use is strongly discouraged.
91+
The support may therefore be removed in the future. Please migrate to WPA2 or newer.
92+
93+
Solution
94+
^^^^^^^^
95+
96+
Nevertheless, it may be necessary to connect to insecure networks. To do this, the security requirement of the ESP32 must be lowered to an insecure level by using:
97+
98+
.. code-block:: arduino
99+
100+
WiFi.setMinSecurity(WIFI_AUTH_WEP); // Lower min security to WEP.
101+
// or
102+
WiFi.setMinSecurity(WIFI_AUTH_WPA_PSK); // Lower min security to WPA.
103+
104+
Why does the board not connect to WPA3-encrypted Wi-Fi?
105+
*******************************************************
106+
107+
WPA3 support is resource intensive and may not be compiled into the used SDK.
108+
109+
Solution
110+
^^^^^^^^
111+
112+
* Check WPA3 support by your SDK.
113+
* Compile your custom SDK with WPA3 support.
114+
115+
Sample code to check SDK WPA3 support at compile time:
116+
117+
.. code-block:: arduino
118+
119+
#ifndef CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE
120+
#warning "No WPA3 support."
121+
#endif

libraries/BLE/src/BLE2902.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ void BLE2902::setIndications(bool flag) {
4646
uint8_t *pValue = getValue();
4747
if (flag) pValue[0] |= 1 << 1;
4848
else pValue[0] &= ~(1 << 1);
49+
setValue(pValue, 2);
4950
} // setIndications
5051

5152

@@ -57,6 +58,7 @@ void BLE2902::setNotifications(bool flag) {
5758
uint8_t *pValue = getValue();
5859
if (flag) pValue[0] |= 1 << 0;
5960
else pValue[0] &= ~(1 << 0);
61+
setValue(pValue, 2);
6062
} // setNotifications
6163

6264
#endif

libraries/BLE/src/BLEDescriptor.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ BLEDescriptor::BLEDescriptor(const char* uuid, uint16_t len) : BLEDescriptor(BLE
3232
BLEDescriptor::BLEDescriptor(BLEUUID uuid, uint16_t max_len) {
3333
m_bleUUID = uuid;
3434
m_value.attr_len = 0; // Initial length is 0.
35-
m_value.attr_max_len = max_len; // Maximum length of the data.
35+
m_value.attr_max_len = max_len; // Maximum length of the data.
3636
m_handle = NULL_HANDLE; // Handle is initially unknown.
3737
m_pCharacteristic = nullptr; // No initial characteristic.
3838
m_pCallback = nullptr; // No initial callback.
@@ -235,6 +235,10 @@ void BLEDescriptor::setValue(uint8_t* data, size_t length) {
235235
}
236236
m_value.attr_len = length;
237237
memcpy(m_value.attr_value, data, length);
238+
if (m_handle != NULL_HANDLE) {
239+
esp_ble_gatts_set_attr_value(m_handle, length, (const uint8_t *)data);
240+
log_d("Set the value in the GATTS database using handle 0x%x", m_handle);
241+
}
238242
} // setValue
239243

240244

libraries/BLE/src/BLEDescriptor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class BLEDescriptor {
5151
uint16_t m_handle;
5252
BLEDescriptorCallbacks* m_pCallback;
5353
BLECharacteristic* m_pCharacteristic;
54-
esp_gatt_perm_t m_permissions = ESP_GATT_PERM_READ | ESP_GATT_PERM_WRITE;
54+
esp_gatt_perm_t m_permissions = ESP_GATT_PERM_READ | ESP_GATT_PERM_WRITE;
5555
FreeRTOS::Semaphore m_semaphoreCreateEvt = FreeRTOS::Semaphore("CreateEvt");
5656
esp_attr_value_t m_value;
5757

libraries/SD_MMC/src/SD_MMC.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ bool SDMMCFS::setPins(int clk, int cmd, int d0, int d1, int d2, int d3)
8484
#endif
8585
}
8686

87-
bool SDMMCFS::begin(const char * mountpoint, bool mode1bit, bool format_if_mount_failed, int sdmmc_frequency)
87+
bool SDMMCFS::begin(const char * mountpoint, bool mode1bit, bool format_if_mount_failed, int sdmmc_frequency, uint8_t maxOpenFiles)
8888
{
8989
if(_card) {
9090
return true;
@@ -122,7 +122,7 @@ bool SDMMCFS::begin(const char * mountpoint, bool mode1bit, bool format_if_mount
122122

123123
esp_vfs_fat_sdmmc_mount_config_t mount_config = {
124124
.format_if_mount_failed = format_if_mount_failed,
125-
.max_files = 5,
125+
.max_files = maxOpenFiles,
126126
.allocation_unit_size = 0
127127
};
128128

libraries/SD_MMC/src/SD_MMC.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class SDMMCFS : public FS
5050
SDMMCFS(FSImplPtr impl);
5151
bool setPins(int clk, int cmd, int d0);
5252
bool setPins(int clk, int cmd, int d0, int d1, int d2, int d3);
53-
bool begin(const char * mountpoint="/sdcard", bool mode1bit=false, bool format_if_mount_failed=false, int sdmmc_frequency=BOARD_MAX_SDMMC_FREQ);
53+
bool begin(const char * mountpoint="/sdcard", bool mode1bit=false, bool format_if_mount_failed=false, int sdmmc_frequency=BOARD_MAX_SDMMC_FREQ, uint8_t maxOpenFiles = 5);
5454
void end();
5555
sdcard_type_t cardType();
5656
uint64_t cardSize();

libraries/WiFi/src/WiFiSTA.cpp

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,10 @@ bool WiFiSTAClass::reconnect()
337337
}
338338

339339
/**
340-
* Disconnect from the network
341-
* @param wifioff
342-
* @return one value of wl_status_t enum
340+
* Disconnect from the network.
341+
* @param wifioff `true` to turn the Wi-Fi radio off.
342+
* @param eraseap `true` to erase the AP configuration from the NVS memory.
343+
* @return `true` when successful.
343344
*/
344345
bool WiFiSTAClass::disconnect(bool wifioff, bool eraseap)
345346
{
@@ -398,8 +399,8 @@ bool WiFiSTAClass::isConnected()
398399
}
399400

400401
/**
401-
* Set the minimum security for AP to be considered connectable
402-
* Must be called before WiFi.begin()
402+
* Set the minimum security for AP to be considered connectable.
403+
* Must be called before WiFi.begin().
403404
* @param minSecurity wifi_auth_mode_t
404405
*/
405406
void WiFiSTAClass::setMinSecurity(wifi_auth_mode_t minSecurity)
@@ -430,8 +431,9 @@ void WiFiSTAClass::setSortMethod(wifi_sort_method_t sortMethod)
430431
}
431432

432433
/**
433-
* Setting the ESP32 station to connect to the AP (which is recorded)
434+
* Deprecated. Setting the ESP32 station to connect to the AP (which is recorded)
434435
* automatically or not when powered on. Enable auto-connect by default.
436+
* @deprecated use `setAutoReconnect`
435437
* @param autoConnect bool
436438
* @return if saved
437439
*/
@@ -441,21 +443,30 @@ bool WiFiSTAClass::setAutoConnect(bool autoConnect)
441443
}
442444

443445
/**
444-
* Checks if ESP32 station mode will connect to AP
446+
* Deprecated. Checks if ESP32 station mode will connect to AP
445447
* automatically or not when it is powered on.
448+
* @deprecated use `getAutoReconnect`
446449
* @return auto connect
447450
*/
448451
bool WiFiSTAClass::getAutoConnect()
449452
{
450453
return false;//now deprecated
451454
}
452455

456+
/**
457+
* Function used to set the automatic reconnection if the connection is lost.
458+
* @param autoReconnect `true` to enable this option.
459+
* @return true
460+
*/
453461
bool WiFiSTAClass::setAutoReconnect(bool autoReconnect)
454462
{
455463
_autoReconnect = autoReconnect;
456464
return true;
457465
}
458-
466+
/**
467+
* Function used to get the automatic reconnection if the connection is lost.
468+
* @return The function will return `true` if this setting is enabled.
469+
*/
459470
bool WiFiSTAClass::getAutoReconnect()
460471
{
461472
return _autoReconnect;

variants/adafruit_feather_esp32_v2/pins_arduino.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ static const uint8_t LED_BUILTIN = 13;
1717

1818
static const uint8_t TX = 8;
1919
static const uint8_t RX = 7;
20-
static const uint8_t TX1 = 8;
21-
static const uint8_t RX1 = 7;
20+
#define TX1 TX
21+
#define RX1 RX
2222

2323
static const uint8_t SDA = 22;
2424
static const uint8_t SCL = 20;
22.2 KB
Binary file not shown.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# ESP-IDF Partition Table
2+
# Name, Type, SubType, Offset, Size, Flags
3+
# bootloader.bin,, 0x1000, 32K
4+
# partition table, 0x8000, 4K
5+
6+
nvs, data, nvs, 0x9000, 20K,
7+
otadata, data, ota, 0xe000, 8K,
8+
ota_0, 0, ota_0, 0x10000, 1408K,
9+
ota_1, 0, ota_1, 0x170000, 1408K,
10+
uf2, app, factory,0x2d0000, 256K,
11+
ffat, data, fat, 0x310000, 960K,
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#ifndef Pins_Arduino_h
2+
#define Pins_Arduino_h
3+
4+
#include <stdint.h>
5+
6+
#define USB_VID 0x239A
7+
#define USB_PID 0x811B
8+
#define USB_MANUFACTURER "Adafruit"
9+
#define USB_PRODUCT "Feather ESP32-S3"
10+
#define USB_SERIAL "" // Empty string for MAC adddress
11+
12+
#define EXTERNAL_NUM_INTERRUPTS 46
13+
#define NUM_DIGITAL_PINS 48
14+
#define NUM_ANALOG_INPUTS 20
15+
16+
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
17+
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1)
18+
#define digitalPinHasPWM(p) (p < 46)
19+
20+
#define LED_BUILTIN 13
21+
22+
#define PIN_NEOPIXEL 33
23+
#define NEOPIXEL_NUM 1 // number of neopixels
24+
#define NEOPIXEL_POWER 21 // power pin
25+
#define NEOPIXEL_POWER_ON HIGH // power pin state when on
26+
#define I2C_POWER 7 // I2C power pin
27+
#define PIN_I2C_POWER 7 // I2C power pin
28+
29+
30+
static const uint8_t TX = 39;
31+
static const uint8_t RX = 38;
32+
#define TX1 TX
33+
#define RX1 RX
34+
35+
static const uint8_t SDA = 3;
36+
static const uint8_t SCL = 4;
37+
38+
static const uint8_t SS = 42;
39+
static const uint8_t MOSI = 35;
40+
static const uint8_t SCK = 36;
41+
static const uint8_t MISO = 37;
42+
43+
static const uint8_t A0 = 18;
44+
static const uint8_t A1 = 17;
45+
static const uint8_t A2 = 16;
46+
static const uint8_t A3 = 15;
47+
static const uint8_t A4 = 14;
48+
static const uint8_t A5 = 8;
49+
static const uint8_t A6 = 3;
50+
static const uint8_t A7 = 4;
51+
static const uint8_t A8 = 5;
52+
static const uint8_t A9 = 6;
53+
static const uint8_t A10 = 9;
54+
static const uint8_t A11 = 10;
55+
static const uint8_t A12 = 11;
56+
static const uint8_t A13 = 12;
57+
static const uint8_t A14 = 13;
58+
59+
static const uint8_t T3 = 3;
60+
static const uint8_t T4 = 4;
61+
static const uint8_t T5 = 5;
62+
static const uint8_t T6 = 6;
63+
static const uint8_t T8 = 8;
64+
static const uint8_t T9 = 9;
65+
static const uint8_t T10 = 10;
66+
static const uint8_t T11 = 11;
67+
static const uint8_t T12 = 12;
68+
static const uint8_t T13 = 13;
69+
static const uint8_t T14 = 14;
70+
71+
#endif /* Pins_Arduino_h */
162 KB
Binary file not shown.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* The MIT License (MIT)
3+
*
4+
* Copyright (c) 2021 Ha Thach (tinyusb.org) for Adafruit Industries
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*/
24+
25+
26+
#include "esp32-hal-gpio.h"
27+
#include "pins_arduino.h"
28+
29+
extern "C" {
30+
31+
// Initialize variant/board, called before setup()
32+
void initVariant(void)
33+
{
34+
// This board has a power control pin, and we must set it to output and high
35+
// in order to enable the NeoPixels.
36+
pinMode(NEOPIXEL_POWER, OUTPUT);
37+
digitalWrite(NEOPIXEL_POWER, HIGH);
38+
39+
// turn on the I2C power by setting LDO enable pin 'high'
40+
pinMode(PIN_I2C_POWER, OUTPUT);
41+
digitalWrite(PIN_I2C_POWER, HIGH);
42+
}
43+
}
Binary file not shown.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# ESP-IDF Partition Table
2+
# Name, Type, SubType, Offset, Size, Flags
3+
# bootloader.bin,, 0x1000, 32K
4+
# partition table, 0x8000, 4K
5+
6+
nvs, data, nvs, 0x9000, 20K,
7+
otadata, data, ota, 0xe000, 8K,
8+
ota_0, 0, ota_0, 0x10000, 1408K,
9+
ota_1, 0, ota_1, 0x170000, 1408K,
10+
uf2, app, factory,0x2d0000, 256K,
11+
ffat, data, fat, 0x310000, 960K,

0 commit comments

Comments
 (0)