@@ -130,6 +130,8 @@ ETHClass::ETHClass(uint8_t eth_index)
130
130
,
131
131
_pin_mcd (-1 ), _pin_mdio(-1 ), _pin_power(-1 ), _pin_rmii_clock(-1 )
132
132
#endif /* CONFIG_ETH_USE_ESP32_EMAC */
133
+ ,
134
+ _task_stack_size (4096 )
133
135
{
134
136
}
135
137
@@ -141,6 +143,10 @@ bool ETHClass::ethDetachBus(void *bus_pointer) {
141
143
return true ;
142
144
}
143
145
146
+ void ETHClass::setTaskStackSize (size_t size) {
147
+ _task_stack_size = size;
148
+ }
149
+
144
150
#if CONFIG_ETH_USE_ESP32_EMAC
145
151
bool ETHClass::begin (eth_phy_type_t type, int32_t phy_addr, int mdc, int mdio, int power, eth_clock_mode_t clock_mode) {
146
152
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
214
220
215
221
eth_mac_config_t eth_mac_config = ETH_MAC_DEFAULT_CONFIG ();
216
222
eth_mac_config.sw_reset_timeout_ms = 1000 ;
223
+ eth_mac_config.rx_task_stack_size = _task_stack_size;
217
224
218
225
esp_eth_mac_t *mac = esp_eth_mac_new_esp32 (&mac_config, ð_mac_config);
219
226
if (mac == NULL ) {
@@ -578,6 +585,9 @@ bool ETHClass::beginSPI(
578
585
__unused eth_mac_config_t eth_mac_config = ETH_MAC_DEFAULT_CONFIG ();
579
586
__unused eth_phy_config_t phy_config = ETH_PHY_DEFAULT_CONFIG ();
580
587
588
+ // Set RX Task Stack Size
589
+ eth_mac_config.rx_task_stack_size = _task_stack_size;
590
+
581
591
// Update PHY config based on board specific configuration
582
592
phy_config.phy_addr = phy_addr;
583
593
phy_config.reset_gpio_num = _pin_rst;
0 commit comments