<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[CoreS3 and W5500 fail]]></title><description><![CDATA[<p dir="auto">I need to use the W5500 with m5unified library and SPI.</p>
<p dir="auto">Here my initialization code</p>
<pre><code>static esp_netif_t *eth_start(void) {
    // Initialize TCP/IP network interface (should be called only once in application)
    ESP_ERROR_CHECK(esp_netif_init());
    // Create default event loop that running in background
    ESP_ERROR_CHECK(esp_event_loop_create_default());

    esp_netif_inherent_config_t esp_netif_config = ESP_NETIF_INHERENT_DEFAULT_ETH();
    // Warning: the interface desc is used in tests to capture actual connection details (IP, gw, mask)
    esp_netif_config.if_desc = "eth0";
    esp_netif_config.if_key = "ETH_SPI_0";
    esp_netif_config.route_prio = 64;
    esp_netif_config_t netif_config = {
        .base = &amp;esp_netif_config,
        .stack = ESP_NETIF_NETSTACK_DEFAULT_ETH
    };
    esp_netif_t *netif = esp_netif_new(&amp;netif_config);
    assert(netif);

    eth_mac_config_t mac_config = ETH_MAC_DEFAULT_CONFIG();
    mac_config.rx_task_stack_size = 3072;
    eth_phy_config_t phy_config = ETH_PHY_DEFAULT_CONFIG();
    phy_config.phy_addr = 1;
    phy_config.reset_gpio_num = GPIO_NUM_7;

    gpio_install_isr_service(0);

    spi_device_interface_config_t spi_devcfg = {
        .command_bits = 16, //Aggiunto
        .address_bits = 8,  //Aggiumto
        .mode = 0,
        .clock_speed_hz = 20 * 1000 * 1000, //Configurare
        .spics_io_num = GPIO_NUM_9,
        .queue_size = 20
    };

    eth_w5500_config_t w5500_config = ETH_W5500_DEFAULT_CONFIG(SPI1_HOST, &amp;spi_devcfg);
    w5500_config.int_gpio_num = GPIO_NUM_14;
    s_mac = esp_eth_mac_new_w5500(&amp;w5500_config, &amp;mac_config);
    s_phy = esp_eth_phy_new_w5500(&amp;phy_config);

    vTaskDelay(pdMS_TO_TICKS(10));


    esp_eth_config_t config = ETH_DEFAULT_CONFIG(s_mac, s_phy);
    ESP_ERROR_CHECK(esp_eth_driver_install(&amp;config, &amp;s_eth_handle));

    uint8_t eth_mac[6] = {0};
    ESP_ERROR_CHECK(esp_read_mac(eth_mac, ESP_MAC_ETH));
    ESP_ERROR_CHECK(esp_eth_ioctl(s_eth_handle, ETH_CMD_S_MAC_ADDR, eth_mac));

    // attach Ethernet driver to TCP/IP stack
    ESP_ERROR_CHECK(esp_netif_attach(netif, esp_eth_new_netif_glue(s_eth_handle)));

    ESP_ERROR_CHECK(esp_event_handler_register(ETH_EVENT, ETHERNET_EVENT_CONNECTED, &amp;on_eth_event, netif));
    ESP_ERROR_CHECK(esp_event_handler_register(IP_EVENT, IP_EVENT_ETH_GOT_IP, &amp;eth_on_got_ip, NULL));

    esp_eth_start(s_eth_handle);
    esp_netif_init();

    return netif;
}
</code></pre>
<p dir="auto">it fail with<br />
E (1214) spi_master: spi_bus_add_device(389): invalid host<br />
E (1214) w5500.mac: w5500_spi_init(87): adding device to SPI host #1 failed<br />
E (1214) w5500.mac: esp_eth_mac_new_w5500(915): SPI initialization failed<br />
E (1234) esp_eth: esp_eth_driver_install(189): can't set eth-&gt;mac or eth-&gt;phy to null</p>
<p dir="auto">when execute  <code>ESP_ERROR_CHECK(esp_eth_driver_install(&amp;config, &amp;s_eth_handle));</code></p>
<p dir="auto">What's wrong?<br />
SPI interface is just initialized by the Display code.</p>
<p dir="auto">And what about INTn (GPIO14) used by microphone?</p>
<p dir="auto">I just disable microphone during init</p>
<pre><code>auto cfg = M5.config();
cfg.output_power = false;
cfg.internal_mic = false;
</code></pre>
<p dir="auto">Gio</p>
]]></description><link>https://community.m5stack.com/topic/6700/cores3-and-w5500-fail</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 01:33:37 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/6700.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 14 Aug 2024 00:24:32 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CoreS3 and W5500 fail on Wed, 14 Aug 2024 10:09:53 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a>,<br />
thank you for your fast response.<br />
I think a GPIO conflict.</p>
<p dir="auto">I use <a href="https://shop.m5stack.com/products/lan-module-w5500-with-poe-v12" target="_blank" rel="noopener noreferrer nofollow ugc">PoE Lan Module w5500</a> that use as Interrupt PIN the GPIO_14 and is also the I2S_DIN used by the integrated microphone.</p>
<p dir="auto">Now it works without M5 initialization <code>M5.begin(cfg);</code>.</p>
<p dir="auto">I also try to set the polling mode without success.</p>
<p dir="auto">Gio</p>
]]></description><link>https://community.m5stack.com/post/26085</link><guid isPermaLink="true">https://community.m5stack.com/post/26085</guid><dc:creator><![CDATA[giobg]]></dc:creator><pubDate>Wed, 14 Aug 2024 10:09:53 GMT</pubDate></item><item><title><![CDATA[Reply to CoreS3 and W5500 fail on Wed, 14 Aug 2024 05:15:58 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/giobg" aria-label="Profile: giobg">@<bdi>giobg</bdi></a></p>
<p dir="auto">have you looked at this <a href="https://github.com/m5stack/M5Module-LAN-13.2/blob/main/examples/WebServer/WebServer.ino" target="_blank" rel="noopener noreferrer nofollow ugc">example</a>? It's for M5CoreS3, uses M5Unified and W5500.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/26082</link><guid isPermaLink="true">https://community.m5stack.com/post/26082</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Wed, 14 Aug 2024 05:15:58 GMT</pubDate></item></channel></rss>