Skip to content

Commit 4087960

Browse files
committed
Fix MDNS. C3 works
1 parent 952118f commit 4087960

File tree

6 files changed

+19
-5
lines changed

6 files changed

+19
-5
lines changed

ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ CIRCUITPY_CREATION_ID = 0x00C30001
33

44
IDF_TARGET = esp32c3
55

6-
CIRCUITPY_ESP_FLASH_MODE = dio
6+
CIRCUITPY_ESP_FLASH_MODE = qio
77
CIRCUITPY_ESP_FLASH_FREQ = 80m
88
CIRCUITPY_ESP_FLASH_SIZE = 4MB

ports/espressif/boards/espressif_esp32s3_lcd_ev/mpconfigboard.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,9 @@ CIRCUITPY_ESP_FLASH_MODE = dio
99
CIRCUITPY_ESP_FLASH_FREQ = 80m
1010
CIRCUITPY_ESP_FLASH_SIZE = 16MB
1111

12+
CIRCUITPY_ESP_PSRAM_SIZE = 8MB
13+
CIRCUITPY_ESP_PSRAM_MODE = opi
14+
CIRCUITPY_ESP_PSRAM_FREQ = 80m
15+
1216
CIRCUITPY_DOTCLOCKFRAMEBUFFER = 1
1317
UF2_BOOTLOADER = 0

ports/espressif/common-hal/wifi/__init__.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ void common_hal_wifi_init(bool user_initiated) {
190190
&self->handler_instance_got_ip));
191191

192192
wifi_init_config_t config = WIFI_INIT_CONFIG_DEFAULT();
193-
#ifdef CONFIG_IDF_TARGET_ESP32
193+
#ifdef CONFIG_ESP32_WIFI_NVS_ENABLED
194+
// Generally we don't use this because we store ssid and passwords ourselves in the filesystem.
194195
esp_err_t err = nvs_flash_init();
195196
if (err == ESP_ERR_NVS_NO_FREE_PAGES || err == ESP_ERR_NVS_NEW_VERSION_FOUND) {
196197
// NVS partition was truncated and needs to be erased
@@ -210,7 +211,7 @@ void common_hal_wifi_init(bool user_initiated) {
210211
if (gc_alloc_possible()) {
211212
raise_esp_error(result);
212213
}
213-
ESP_LOGE(TAG, "WiFi error code: %d", result);
214+
ESP_LOGE(TAG, "WiFi error code: %x", result);
214215
return;
215216
}
216217
// set station mode to avoid the default SoftAP

ports/espressif/esp-idf-config/sdkconfig-esp32c3.defaults

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@ CONFIG_I2S_SUPPRESS_DEPRECATE_WARN=y
4949

5050
# end of Driver Configurations
5151

52+
#
53+
# Wi-Fi
54+
#
55+
CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=4
56+
CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=8
57+
CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=16
58+
# CONFIG_ESP32_WIFI_NVS_ENABLED is not set
59+
# end of Wi-Fi
60+
5261
#
5362
# Newlib
5463
#

ports/espressif/esp-idf-config/sdkconfig-esp32s3.defaults

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ CONFIG_BT_NIMBLE_HCI_EVT_BUF_SIZE=70
2323
# end of Memory Settings
2424

2525
CONFIG_BT_NIMBLE_EXT_ADV=y
26+
# CONFIG_BT_NIMBLE_ENABLE_PERIODIC_ADV is not set
2627
# end of NimBLE Options
2728

2829
#

supervisor/shared/web_workflow/web_workflow.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,7 @@ bool supervisor_start_web_workflow(bool reload) {
347347
#if CIRCUITPY_MDNS
348348
// Try to start MDNS if the user deinited it.
349349
if (mdns.base.type != &mdns_server_type ||
350-
common_hal_mdns_server_deinited(&mdns) ||
351-
reload) { // Always reconstruct on reload, since we don't know if the net changed.
350+
common_hal_mdns_server_deinited(&mdns)) {
352351
mdns_server_construct(&mdns, true);
353352
mdns.base.type = &mdns_server_type;
354353
if (!common_hal_mdns_server_deinited(&mdns)) {

0 commit comments

Comments
 (0)