@@ -130,6 +130,8 @@ ETHClass::ETHClass(uint8_t eth_index)
130130 ,
131131 _pin_mcd (-1 ), _pin_mdio(-1 ), _pin_power(-1 ), _pin_rmii_clock(-1 )
132132#endif /* CONFIG_ETH_USE_ESP32_EMAC */
133+ ,
134+ _task_stack_size (4096 )
133135{
134136}
135137
@@ -141,6 +143,10 @@ bool ETHClass::ethDetachBus(void *bus_pointer) {
141143 return true ;
142144}
143145
146+ void ETHClass::setTaskStackSize (size_t size) {
147+ _task_stack_size = size;
148+ }
149+
144150#if CONFIG_ETH_USE_ESP32_EMAC
145151bool ETHClass::begin (eth_phy_type_t type, int32_t phy_addr, int mdc, int mdio, int power, eth_clock_mode_t clock_mode) {
146152 esp_err_t ret = ESP_OK;
@@ -214,6 +220,7 @@ bool ETHClass::begin(eth_phy_type_t type, int32_t phy_addr, int mdc, int mdio, i
214220
215221 eth_mac_config_t eth_mac_config = ETH_MAC_DEFAULT_CONFIG ();
216222 eth_mac_config.sw_reset_timeout_ms = 1000 ;
223+ eth_mac_config.rx_task_stack_size = _task_stack_size;
217224
218225 esp_eth_mac_t *mac = esp_eth_mac_new_esp32 (&mac_config, ð_mac_config);
219226 if (mac == NULL ) {
@@ -578,6 +585,9 @@ bool ETHClass::beginSPI(
578585 __unused eth_mac_config_t eth_mac_config = ETH_MAC_DEFAULT_CONFIG ();
579586 __unused eth_phy_config_t phy_config = ETH_PHY_DEFAULT_CONFIG ();
580587
588+ // Set RX Task Stack Size
589+ eth_mac_config.rx_task_stack_size = _task_stack_size;
590+
581591 // Update PHY config based on board specific configuration
582592 phy_config.phy_addr = phy_addr;
583593 phy_config.reset_gpio_num = _pin_rst;
0 commit comments