@@ -233,7 +233,7 @@ bool ETHClass::begin(uint8_t phy_addr, int power, int mdc, int mdio, eth_phy_typ
233
233
tcpipInit ();
234
234
235
235
tcpip_adapter_set_default_eth_handlers ();
236
-
236
+
237
237
esp_netif_config_t cfg = ESP_NETIF_DEFAULT_ETH ();
238
238
esp_netif_t *eth_netif = esp_netif_new (&cfg);
239
239
@@ -245,6 +245,12 @@ bool ETHClass::begin(uint8_t phy_addr, int power, int mdc, int mdio, eth_phy_typ
245
245
#endif
246
246
#if CONFIG_ETH_USE_ESP32_EMAC
247
247
eth_mac_config_t mac_config = ETH_MAC_DEFAULT_CONFIG ();
248
+
249
+ // Theo - core 2.0.2.3 start of fix 1 of 2
250
+ mac_config.clock_config .rmii .clock_mode = (eth_clock_mode) ? EMAC_CLK_OUT : EMAC_CLK_EXT_IN;
251
+ mac_config.clock_config .rmii .clock_gpio = (1 == eth_clock_mode) ? EMAC_APPL_CLK_OUT_GPIO : (2 == eth_clock_mode) ? EMAC_CLK_OUT_GPIO : (3 == eth_clock_mode) ? EMAC_CLK_OUT_180_GPIO : EMAC_CLK_IN_GPIO;
252
+ // Theo - core 2.0.2.3 end of fix 1 of 2
253
+
248
254
mac_config.smi_mdc_gpio_num = mdc;
249
255
mac_config.smi_mdio_gpio_num = mdio;
250
256
mac_config.sw_reset_timeout_ms = 1000 ;
@@ -305,13 +311,17 @@ bool ETHClass::begin(uint8_t phy_addr, int power, int mdc, int mdio, eth_phy_typ
305
311
306
312
eth_handle = NULL ;
307
313
esp_eth_config_t eth_config = ETH_DEFAULT_CONFIG (eth_mac, eth_phy);
308
- eth_config.on_lowlevel_init_done = on_lowlevel_init_done;
314
+
315
+ // Theo - core 2.0.2.3 start of fix 2 of 2
316
+ // eth_config.on_lowlevel_init_done = on_lowlevel_init_done;
317
+ // Theo - core 2.0.2.3 end of fix 2 of 2
318
+
309
319
// eth_config.on_lowlevel_deinit_done = on_lowlevel_deinit_done;
310
320
if (esp_eth_driver_install (ð_config, ð_handle) != ESP_OK || eth_handle == NULL ){
311
321
log_e (" esp_eth_driver_install failed" );
312
322
return false ;
313
323
}
314
-
324
+
315
325
/* attach Ethernet driver to TCP/IP stack */
316
326
if (esp_netif_attach (eth_netif, esp_eth_new_netif_glue (eth_handle)) != ESP_OK){
317
327
log_e (" esp_netif_attach failed" );
@@ -386,7 +396,7 @@ bool ETHClass::config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, I
386
396
{
387
397
esp_err_t err = ESP_OK;
388
398
tcpip_adapter_ip_info_t info;
389
-
399
+
390
400
if (local_ip != (uint32_t )0x00000000 && local_ip != INADDR_NONE){
391
401
info.ip .addr = static_cast <uint32_t >(local_ip);
392
402
info.gw .addr = static_cast <uint32_t >(gateway);
@@ -408,7 +418,7 @@ bool ETHClass::config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, I
408
418
log_e (" STA IP could not be configured! Error: %d" , err);
409
419
return false ;
410
420
}
411
-
421
+
412
422
if (info.ip .addr ){
413
423
staticIP = true ;
414
424
} else {
0 commit comments