ESP-IDF Ethernet Basic Example not working with ESP32S3 and W5500-EVB
ESP-IDF Ethernet Basic Example not working with ESP32S3 and W5500-EVB
Hi, I have been trying to run the Ethernet Basic example (https://github.com/espressif/esp-idf/tr ... rnet/basic) on my ESP32S3-WROOM-1 devkit connected through SPI to a W5500-EVB board (https://www.digikey.com/en/products/det ... VB/8789607) and have been unable to have the example successfully work. The program begins infinitely looping once the "Ethernet Started" message is outputted to the terminal. Then at seemingly random intervals, error messages are outputted to the terminal before once more looping.
Here are some more specific hardware details:
Pin Layouts
ESP32S3-WROOM-1 Devkit
MOSI - GPIO11 (FSPID)
MISO - GPIO13 (FSPIQ)
CLK - GPIO12 (FSPICLK)
CS - not connected since the W5500-EVB dev board has CS tied low
RESET - RST
W5500-EVB
MOSI - D11
MISO - D12
CLK - D13
CS - tied low
RESET - RST
Other connection notes:
- Ethernet port on W5500-EVB connected directly to back of router
- USB port on ESP32S3 connected to laptop
- Jumper cables to supply power to the connected boards through 3V3 and GND ports also added
Terminal output:
Any help would be greatly appreciated, thanks!
Here are some more specific hardware details:
Pin Layouts
ESP32S3-WROOM-1 Devkit
MOSI - GPIO11 (FSPID)
MISO - GPIO13 (FSPIQ)
CLK - GPIO12 (FSPICLK)
CS - not connected since the W5500-EVB dev board has CS tied low
RESET - RST
W5500-EVB
MOSI - D11
MISO - D12
CLK - D13
CS - tied low
RESET - RST
Other connection notes:
- Ethernet port on W5500-EVB connected directly to back of router
- USB port on ESP32S3 connected to laptop
- Jumper cables to supply power to the connected boards through 3V3 and GND ports also added
Terminal output:
Any help would be greatly appreciated, thanks!
Re: ESP-IDF Ethernet Basic Example not working with ESP32S3 and W5500-EVB
Please make sure you also connected the W5500 interrupt output to your ESP32.
Re: ESP-IDF Ethernet Basic Example not working with ESP32S3 and W5500-EVB
Thanks for the reply. I've connected the INTn pin on the W5500 to GPIO4 (as specified by the sdkconfig file) on the ESP32S3 devkit and the error has persisted.
Here is a screenshot of my sdkconfig file > Example Configuration:
Please let me know if there are any other potential causes of this error and/or fixes, thanks.
Here is a screenshot of my sdkconfig file > Example Configuration:
Please let me know if there are any other potential causes of this error and/or fixes, thanks.
Re: ESP-IDF Ethernet Basic Example not working with ESP32S3 and W5500-EVB
I see that you've mentioned the CS is pulled low on the board. However, would it be possible to connect CS to the GPIO? I have this type https://www.amazon.de/-/en/TECNOIOT-USR ... B07RGLN436 of W5500 module and when I connect the CS to GND it does not work.... It theoretically should but it doesn't and I haven't had time to investigate why.
Re: ESP-IDF Ethernet Basic Example not working with ESP32S3 and W5500-EVB
Thanks again for your response. Even after connecting the CS0 pin, the error still persists. I've also tried configuring the PHY reset pin on the ESP32S3 and connect it to the W5500-EVB with no success. The W5500 board I have is a development board compared to your board which seems much more compact. Do you have any other leads or ideas I could explore to find a solution? Thanks
Re: ESP-IDF Ethernet Basic Example not working with ESP32S3 and W5500-EVB
Try to reduce SPI frequency and use wires as short as possible with matching length.
Re: ESP-IDF Ethernet Basic Example not working with ESP32S3 and W5500-EVB
Thanks for getting back to me, I've tried going as low as 5MHz with no success, and all wires are identical lengths. Could this be an issue on the W5500-EVB side caused by varying firmware as my W5500 board is a development board?
Re: ESP-IDF Ethernet Basic Example not working with ESP32S3 and W5500-EVB
So I dived bit deeper and checked W5500-EVB schematics. This is not just a module with the W5500 but it has its own MCU (https://docs.wiznet.io/Product/iEtherne ... /W5500-EVB)! There is default demo firmware flashed in it and it certainly interacts with the W5500. Now, you connected the second MCU, no wonder it does not work.
You need to investigate further steps by yourself. If it worth to modify the EVB and disconnect its MCU or to buy a simple module I've already provided reference to...
You need to investigate further steps by yourself. If it worth to modify the EVB and disconnect its MCU or to buy a simple module I've already provided reference to...
-
BenSuffolk
- Posts: 5
- Joined: Wed Aug 17, 2022 5:36 am
Re: ESP-IDF Ethernet Basic Example not working with ESP32S3 and W5500-EVB
I have used the W5500 in a few different projects, and in each case I collect all 6 pins (MOSI, MISO, CLK, CS, Int & Reset) but I have a project where my IO is very tight. I was hoping to drop Reset and CS. I quickly tried on one of my existing boards setting CS low and passing -1 as the CS pin to the Ethernet driver.I see that you've mentioned the CS is pulled low on the board. However, would it be possible to connect CS to the GPIO? I have this type https://www.amazon.de/-/en/TECNOIOT-USR ... B07RGLN436 of W5500 module and when I connect the CS to GND it does not work.... It theoretically should but it doesn't and I haven't had time to investigate why.
It never detects the ethernet lead being plugged in, but shows no errors. If I do not pull CS low, I get errors. So clearly it must be happily communicating with the W5500, just not fully working.
Have you managed to figure out why it needs CS?
-
BenSuffolk
- Posts: 5
- Joined: Wed Aug 17, 2022 5:36 am
Re: ESP-IDF Ethernet Basic Example not working with ESP32S3 and W5500-EVB
Looking in the datasheet for the W5500 shows that there are 2 modes Variable Length Data Mode, and Fixed Length Data Mode.
I do note that it says it is not recommended to use the FDM mode unless you are in inevitable status.
So it looks like the w5500 driver is using VDM mode, and hence needs the CS pin, there is a FDM mode which does not need the CS pin. So I guess ideally if -1 is passed in for the CS pin it should use FDM mode instead of VDM mode.2.2.3 Data Phase
With the Control Phase set by the SPI Operation Mode Bits OM[1:0], the Data Phase
is set by two types of length, one type is the N-Bytes length (VDM mode) and the other
type is 1/2/4 Bytes (FDM mode).
At this time, 1 byte data is transferred through MOSI or MISO signal from MSB to LSB
sequentially.
2.3 Variable Length Data Mode (VDM)
In VDM mode, the SPI Frame Data Phase Length is determined by SCSn Control of the
External Host. That means that the Data Phase Length can have random value (Any
length from 1 Byte to N Bytes) according to the SCSn Control.
The OM[1:0] of the Control Phase should be ‘00’ value in VDM mode.
2.4 Fixed Length Data Mode (FDM)
The FDM mode can be used when the External Host cannot control SCSn signal.
The SCSn signal should be tied to Low (Always connected to GND) and it is not possible
to share the SPI Bus with other SPI Devices. (Refer to the Figure 5)
In VDM mode, Data Phase length is controlled by SCSn control.
But in FDM mode, Data Phase length is controlled by OM[1:0] value (‘01’ / ‘10’ / ‘11’)
which is the SPI Operation Mode Bits of the Control Phase.
As the SPI Frame of FDM mode is the same as SPI Frame of VDM mode (1Byte, 2 Bytes,
4 Bytes SPI Frame) except for the SCSn signal control and OM[1:0] setting, the detail
about FDM mode is not described in this section.
It is not recommended to use the FDM mode unless you are in inevitable status. In
addition, we use only 1/2/4 Bytes SPI Frame, as described in ‘Chapter 2.4.1’ & ‘Chapter
2.4.2’. Using SPI Frame with other length of Data will cause malfunction of W5500.
I do note that it says it is not recommended to use the FDM mode unless you are in inevitable status.
Who is online
Users browsing this forum: Google [Bot], Qwantbot and 4 guests
