FreeRTOS-Plus-TCP icon indicating copy to clipboard operation
FreeRTOS-Plus-TCP copied to clipboard

[Feature Request] ESP32 port implementation for both Ethernet and Wi-Fi

Open ryan4xen opened this issue 1 year ago • 2 comments

I am currently porting the TCP stack to work with the esp-idf as an alternative to the existing lwIP. Though during the implementation I found that only Wi-Fi was actually implemented, but using _Eth_ naming. At this stage I am only personally doing a Wi-Fi implementation, though would be good to clean this up.

For example:

static BaseType_t xESP32_Eth_NetworkInterfaceInitialise( NetworkInterface_t * pxInterface )
{
    static BaseType_t xMACAdrInitialized = pdFALSE;
    uint8_t ucMACAddress[ ipMAC_ADDRESS_LENGTH_BYTES ];

    if( xInterfaceState == INTERFACE_UP )
    {
        if( xMACAdrInitialized == pdFALSE )
        {
            esp_wifi_get_mac( ESP_IF_WIFI_STA, ucMACAddress );
            FreeRTOS_UpdateMACAddress( ucMACAddress );
            xMACAdrInitialized = pdTRUE;
        }

        return pdTRUE;
    }

    return pdFALSE;
}

Unless I am missing something I believe someone originally intended to implement the Ethernet driver, but ended up with a Wi-Fi one instead.

ryan4xen avatar Jul 08 '24 03:07 ryan4xen

The +TCP driver for ESP32 in portable/NetworkInterface/esp32, is indeed only for WiFi.

These seem to be the official driver sources on github.com/espressif.

If you decide to create a ESP32 Ethernet driver for +TCP, you can either:

It shouldn't be too difficult, assuming that the espressif driver is well tested.

htibosch avatar Jul 08 '24 08:07 htibosch

HI @ryan4xen Are you planning on creating a pull request as suggested by hein?

moninom1 avatar Jul 22 '24 09:07 moninom1