ESP32-GATEWAY Rev F Ethernet Configurations

Started by Karim, April 14, 2020, 12:58:45 PM

Previous topic - Next topic

Karim

Hi there,

now we are working on a projekt with ESP32-GATEWAY revision F. I want simply to run the Ethernet Demo from Olimex "ETH_PHY_demo" or the Ethernet "basic" demo from Espressif. The problem is that the Ethernet driver is not configured correctly. Can you point me which conigurations should I do on "idf.py menuconfig" to let the Ethernet driver works?

Also, I tried the example given from Olimex here, but the code was not able to be compiled by ESP-IDF v4.2.

Have a nice day and stay safe

Best regards,
Karim

JohnS


Karim

Hi Johns,

thanks a lot for your answer but unfortunately I used the code which was used in the thread you pointed. Of Course I used "Newest-board-revisions" because I am using ESP32-GATEWAY rev F

Karim

LubOlimex

The example at the Olimex GitHub was made for ESP-IDF version 3.x, it won't work with ESP-IDF 4.x. We have added it in our TODO list to also provide an updated demo.

Until then try using the example for ESP32-PoE, it should work fine with ESP32-GATEWAY without any changes since the Ethernet part is the same:

https://github.com/OLIMEX/ESP32-POE/tree/master/SOFTWARE/ESP-IDF/ESP32_PoE_Ethernet_IDFv4.0

Also consider that ESP-IDF version 4.2 is not stable branch but developer branch. It is meant for ESP-IDF developers and it can contain bugs. It is recommended to use the latest stable tag which is version 4.0.

If you still encounter issues, I'd recommend testing also with the Arduino IDE for ESP32, to confirm if the hardware of the board works fine. For Arduino IDE check this document:

https://www.olimex.com/Products/IoT/ESP32/_resources/Arudino-ESP32.txt

I you have problems with Arduino IDE you might follow my advice in the thread here: https://www.olimex.com/forum/index.php?topic=7480.0
Technical support and documentation manager at Olimex

Karim

Thanks a lot for your answer.
Well I tried the source code you pointed me and it seems better but still not working fine!

Here is my console output
[rst:0x1 (POWERON_RESET),boot:0x1a (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:6804
load:0x40078000,len:14076
load:0x40080400,len:4304
entry 0x400806e8
I (70) boot: Chip Revision: 1
I (71) boot_comm: chip revision: 1, min. bootloader chip revision: 0
I (39) boot: ESP-IDF v4.0-dirty 2nd stage bootloader
I (39) boot: compile time 13:06:25
I (39) boot: Enabling RNG early entropy source...
I (44) boot: SPI Speed      : 40MHz
I (48) boot: SPI Mode       : DIO
I (52) boot: SPI Flash Size : 4MB
I (56) boot: Partition Table:
I (60) boot: ## Label            Usage          Type ST Offset   Length
I (67) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (74) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (82) boot:  2 factory          factory app      00 00 00010000 00100000
I (89) boot: End of partition table
I (94) boot_comm: chip revision: 1, min. application chip revision: 0
I (101) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x0cac4 ( 51908) map
I (128) esp_image: segment 1: paddr=0x0001caec vaddr=0x3ffb0000 size=0x02514 (  9492) load
I (132) esp_image: segment 2: paddr=0x0001f008 vaddr=0x40080000 size=0x00400 (  1024) load
0x40080000: _WindowOverflow4 at C:/esp-idf/components/freertos/xtensa_vectors.S:1778

I (136) esp_image: segment 3: paddr=0x0001f410 vaddr=0x40080400 size=0x00c00 (  3072) load
I (145) esp_image: segment 4: paddr=0x00020018 vaddr=0x400d0018 size=0x2c250 (180816) map
0x400d0018: _stext at ??:?

I (218) esp_image: segment 5: paddr=0x0004c270 vaddr=0x40081000 size=0x09364 ( 37732) load
0x40081000: start_cpu0_default at C:/esp-idf/components/esp32/cpu_start.c:382 (discriminator 1)

I (240) boot: Loaded app from partition at offset 0x10000
I (240) boot: Disabling RNG early entropy source...
I (241) cpu_start: Pro cpu up.
I (244) cpu_start: Application information:
I (249) cpu_start: Project name:     ethernet_basic
I (255) cpu_start: App version:      ee0738a
I (260) cpu_start: Compile time:     Apr 16 2020 13:04:27
I (266) cpu_start: ELF file SHA256:  1ce7c519ed782681...
I (272) cpu_start: ESP-IDF:          v4.0-dirty
I (277) cpu_start: Starting app cpu, entry point is 0x40081110
0x40081110: call_start_cpu1 at C:/esp-idf/components/esp32/cpu_start.c:272

I (0) cpu_start: App cpu up.
I (288) heap_init: Initializing. RAM available for dynamic allocation:
I (294) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (300) heap_init: At 3FFB4578 len 0002BA88 (174 KiB): DRAM
I (307) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (313) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (319) heap_init: At 4008A364 len 00015C9C (87 KiB): IRAM
I (326) cpu_start: Pro cpu start user code
I (344) spi_flash: detected chip: gd
I (344) spi_flash: flash io: dio
I (345) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (368) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (388) eth_example: Ethernet Started
I (4388) eth_example: Ethernet Link Up
I (4388) eth_example: Ethernet HW Addr 24:0a:c4:26:d3:2f][/sub]

LubOlimex

It looks alright. Where is the problem now?
Technical support and documentation manager at Olimex

Karim

#6
when I click RST button I get the following:
[E (368) lan8720: lan8720_pwrctl(332): power up failed
E (378) lan8720: lan8720_init(368): power control failed
E (378) esp_eth: esp_eth_driver_install(192): init phy failed
ESP_ERROR_CHECK failed: esp_err_t 0xffffffff (ESP_FAIL) at 0x40085228
file: "../main/ethernet_example_main.c" line 125
func: app_main
expression: esp_eth_driver_install(&config, &eth_handle)
]

then the console output after the first reboot is as I printed in the preceded comment.


I am not getting the event "IP_EVENT_ETH_GOT_IP"
Also, I am not getting the following output on my console.
[I (5864) tcpip_adapter: eth ip: 192.168.2.151, mask: 255.255.255.0, gw: 192.168.2.2
I (5864) eth_example: Ethernet Got IP Address
I (5864) eth_example: ~~~~~~~~~~~
I (5864) eth_example: ETHIP:192.168.2.151
I (5874) eth_example: ETHMASK:255.255.255.0
I (5874) eth_example: ETHGW:192.168.2.2
I (5884) eth_example: ~~~~~~~~~~~

Karim

#7
Update:

well, this link is working for my kit ESP32-GATEWAY rev F. The idea was, that the kit should be connected to a router to get the IP address. To connect the kit with the PC, one should use a static IP address.

LubOlimex

Thanks for the update. Glad you got it partially working. The demo should work with DHCP-assigned IP addresses too but probably something in the router settings is not set properly.

Notice that when we wrote this demo we tested only with DHCP-assigned IP addresses.
Technical support and documentation manager at Olimex