Skip to content

Commit b6699bd

Browse files
committed
Various changes
Improve debug start with P4 when using host wifi Reduce C3 memory usage Fix I2S clock multiplier Allow wifi & ethernet by default for P4
1 parent c69e4c4 commit b6699bd

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

targets/ESP32/_IDF/esp32p4/app_main.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,18 @@ void main_task(void *pvParameter)
4444
// Called from Esp32 IDF start up code before scheduler starts
4545
void app_main()
4646
{
47+
UBaseType_t taskPriority = 5;
48+
4749
// Switch off logging so as not to interfere with WireProtocol over Uart0
4850
esp_log_level_set("*", ESP_LOG_NONE);
4951

5052
ESP_ERROR_CHECK(nvs_flash_init());
5153

54+
vTaskPrioritySet(NULL, taskPriority);
55+
5256
// start receiver task pinned to core 0
53-
xTaskCreatePinnedToCore(&receiver_task, "ReceiverThread", 3072, NULL, 5, NULL, 0);
57+
xTaskCreatePinnedToCore(&receiver_task, "ReceiverThread", 3072, NULL, taskPriority, NULL, 0);
5458

5559
// start the CLR main task pinned to core 1
56-
xTaskCreatePinnedToCore(&main_task, "main_task", 15000, NULL, 5, NULL, 1);
60+
xTaskCreatePinnedToCore(&main_task, "main_task", 15000, NULL, taskPriority, NULL, 1);
5761
}

targets/ESP32/_IDF/sdkconfig.default.esp32c3

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,17 @@ CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=2304
3030
CONFIG_FREERTOS_TIMER_TASK_PRIORITY=5
3131
CONFIG_FREERTOS_USE_TICKLESS_IDLE=y
3232

33+
CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=5
34+
CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=16
35+
3336
CONFIG_LWIP_LOCAL_HOSTNAME="nanodevice"
34-
CONFIG_LWIP_MAX_SOCKETS=16
37+
CONFIG_LWIP_MAX_SOCKETS=8
3538
CONFIG_LWIP_SO_LINGER=y
3639
CONFIG_LWIP_SO_RCVBUF=y
3740
CONFIG_LWIP_DHCP_OPTIONS_LEN=80
3841
CONFIG_LWIP_DHCPS=n
3942
CONFIG_LWIP_IPV6=n
40-
CONFIG_LWIP_MAX_LISTENING_TCP=8
43+
CONFIG_LWIP_MAX_LISTENING_TCP=4
4144
CONFIG_LWIP_SNTP_MAX_SERVERS=2
4245

4346
CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC=y

targets/ESP32/_common/targetHAL_ConfigurationManager.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,14 @@ void InitialiseWirelessDefaultConfig(HAL_Configuration_Wireless80211 *config, ui
308308
// Once smart config has run will start up automatically and reconnect of disconnected
309309
// Application will have to disable Wi-Fi to save power etc
310310
// if Ethernet enable then disable
311+
// Disable Wi-Fi if Ethernet is enabled for all targets except esp32_p4 which by default will have both active at same time
312+
#if !defined(CONFIG_IDF_TARGET_ESP32P4)
311313
if (ethernetEnabled)
312314
{
313315
config->Options = Wireless80211Configuration_ConfigurationOptions_Disable;
314316
}
315317
else
318+
#endif
316319
{
317320
config->Options =
318321
(Wireless80211Configuration_ConfigurationOptions)(Wireless80211Configuration_ConfigurationOptions_AutoConnect |

targets/ESP32/_nanoCLR/System.Device.I2s/sys_dev_i2s_native_System_Device_I2s_I2sDevice.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ HRESULT SetI2sConfig(i2s_port_t bus, CLR_RT_HeapBlock *config)
182182
NANOCLR_HEADER();
183183

184184
i2s_pin_config_t pin_config;
185+
185186
pin_config.mck_io_num = (gpio_num_t)Esp32_GetMappedDevicePins(DEV_TYPE_I2S, bus, 0);
186187
pin_config.bck_io_num = (gpio_num_t)Esp32_GetMappedDevicePins(DEV_TYPE_I2S, bus, 1);
187188
pin_config.ws_io_num = (gpio_num_t)Esp32_GetMappedDevicePins(DEV_TYPE_I2S, bus, 2);
@@ -190,6 +191,7 @@ HRESULT SetI2sConfig(i2s_port_t bus, CLR_RT_HeapBlock *config)
190191

191192
// Important: this will have to be adjusted for IDF5
192193
i2s_config_t conf;
194+
193195
int commformat = config[I2sConnectionSettings::FIELD___i2sConnectionFormat].NumericByRef().s4;
194196
i2s_mode_t mode = (i2s_mode_t)config[I2sConnectionSettings::FIELD___i2sMode].NumericByRef().s4;
195197
i2s_bits_per_sample_t bits =
@@ -218,10 +220,8 @@ HRESULT SetI2sConfig(i2s_port_t bus, CLR_RT_HeapBlock *config)
218220
conf.use_apll = false;
219221
conf.tx_desc_auto_clear = true;
220222
conf.fixed_mclk = 0;
221-
#if (ESP_IDF_VERSION_MAJOR == 4) && (ESP_IDF_VERSION_MINOR >= 4)
222-
conf.mclk_multiple = I2S_MCLK_MULTIPLE_DEFAULT;
223+
conf.mclk_multiple = I2S_MCLK_MULTIPLE_256;
223224
conf.bits_per_chan = (i2s_bits_per_chan_t)0;
224-
#endif
225225

226226
// If this is first device on Bus then init driver
227227
if (Esp_I2S_Initialised_Flag[bus] == 0)

0 commit comments

Comments
 (0)