esp32-evb Ethernet - emax rx buf err!!

Started by wobaekat, September 05, 2017, 07:51:06 PM

Previous topic - Next topic

wobaekat

I am trying to get the ETH_PHY_demo to work, everything compiles fine and the esp32 starts up, but if a network cable is actually connected, many errors appear on the serial output stating: "emax rx buf err!!" and no dhcp information is received.

I have tried various psu's, network cables, network switches and even different usb cables but it doesn't seem to make a difference.

I setup the esp-idf toolchain following this: https://esp-idf.readthedocs.io/en/latest/get-started/index.html#get-started-get-esp-idf

then setup the config options as per: https://github.com/OLIMEX/ESP32-EVB/blob/master/SOFTWARE/README.md

then setup the config options as per: https://github.com/OLIMEX/ESP32-EVB/blob/master/SOFTWARE/ETH_PHY_demo/README.md

then compiled with make flash.

Serial output:

$ make monitor
MONITOR
--- idf_monitor on COM11 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x1b (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:0x3fff0010,len:4
load:0x3fff0014,len:5396
load:0x40078000,len:0
load:0x40078000,len:12112
entry 0x40078f48
I (44) boot: ESP-IDF v3.0-dev-509-g9da1bf1a-dirty 2nd stage bootloader
I (45) boot: compile time 17:22:57
I (48) boot: Enabling RNG early entropy source...
I (64) boot: SPI Speed      : 40MHz
I (77) boot: SPI Mode       : DIO
I (89) boot: SPI Flash Size : 4MB
I (102) boot: Partition Table:
I (113) boot: ## Label            Usage          Type ST Offset   Length
I (136) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (159) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (182) boot:  2 factory          factory app      00 00 00010000 00100000
I (206) boot: End of partition table
I (219) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x06e40 ( 2
8224) map
I (277) esp_image: segment 1: paddr=0x00016e68 vaddr=0x3ffb0000 size=0x02158 (
8536) load
I (288) esp_image: segment 2: paddr=0x00018fc8 vaddr=0x40080000 size=0x00400 (
1024) load
0x40080000: _iram_start at ??:?

I (302) esp_image: segment 3: paddr=0x000193d0 vaddr=0x40080400 size=0x06c40 ( 2
7712) load
I (364) esp_image: segment 4: paddr=0x00020018 vaddr=0x400d0018 size=0x14e30 ( 8
5552) map
0x400d0018: _flash_cache_start at ??:?

I (456) esp_image: segment 5: paddr=0x00034e50 vaddr=0x40087040 size=0x00be4 (
3044) load
0x40087040: rtc_init at C:/users/Nathan/git/esp-idf/components/soc/esp32/rtc_ini
t.c:81

I (461) esp_image: segment 6: paddr=0x00035a3c vaddr=0x400c0000 size=0x00000 (
   0) load
I (491) boot: Loaded app from partition at offset 0x10000
I (495) boot: Disabling RNG early entropy source...
I (513) cpu_start: Pro cpu up.
I (524) cpu_start: Starting app cpu, entry point is 0x40080d78
0x40080d78: call_start_cpu1 at C:/users/Nathan/git/esp-idf/components/esp32/cpu_
start.c:218

I (0) cpu_start: App cpu up.
I (556) heap_init: Initializing. RAM available for dynamic allocation:
I (577) heap_init: At 3FFAE2A0 len 00001D60 (7 KiB): DRAM
I (595) heap_init: At 3FFBB4A8 len 00024B58 (146 KiB): DRAM
I (615) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (634) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (654) heap_init: At 40087C24 len 000183DC (96 KiB): IRAM
I (673) cpu_start: Pro cpu start user code
I (732) cpu_start: Starting scheduler on PRO CPU.
I (195) cpu_start: Starting scheduler on APP CPU.
I (195) emac: mac version 1137a
I (195) emac: emac start !!!

I (195) emac: emac reset done
I (205) system_api: Base MAC address is not set, read default base MAC address f
rom BLK0 of EFUSE
I (225) emac: emac start success !!!
I (4225) Olimex_ESP32_EVB_REV_B_eth_example: ~~~~~~~~~~~
I (4225) Olimex_ESP32_EVB_REV_B_eth_example: ETHIP:0.0.0.0
I (4225) Olimex_ESP32_EVB_REV_B_eth_example: ETHPMASK:0.0.0.0
I (4225) Olimex_ESP32_EVB_REV_B_eth_example: ETHPGW:0.0.0.0
I (4235) Olimex_ESP32_EVB_REV_B_eth_example: ~~~~~~~~~~~
I (4245) emac: eth link_up!!!
E (4685) emac: emac rx buf err!!

E (4915) emac: emac rx buf err!!

E (5355) emac: emac rx buf err!!

E (5435) emac: emac rx buf err!!

E (5695) emac: emac rx buf err!!

I (6235) Olimex_ESP32_EVB_REV_B_eth_example: ~~~~~~~~~~~
I (6235) Olimex_ESP32_EVB_REV_B_eth_example: ETHIP:0.0.0.0
I (6235) Olimex_ESP32_EVB_REV_B_eth_example: ETHPMASK:0.0.0.0
I (6235) Olimex_ESP32_EVB_REV_B_eth_example: ETHPGW:0.0.0.0
I (6245) Olimex_ESP32_EVB_REV_B_eth_example: ~~~~~~~~~~~
E (6425) emac: emac rx buf err!!

E (6695) emac: emac rx buf err!!

E (6955) emac: emac rx buf err!!

E (6955) emac: emac rx buf err!!

E (7315) emac: emac rx buf err!!

E (7405) emac: emac rx buf err!!

E (7425) emac: emac rx buf err!!

E (7705) emac: emac rx buf err!!

E (8235) emac: emac rx buf err!!

E (8235) emac: emac rx buf err!!

I (8245) Olimex_ESP32_EVB_REV_B_eth_example: ~~~~~~~~~~~
I (8245) Olimex_ESP32_EVB_REV_B_eth_example: ETHIP:0.0.0.0
I (8245) Olimex_ESP32_EVB_REV_B_eth_example: ETHPMASK:0.0.0.0
I (8255) Olimex_ESP32_EVB_REV_B_eth_example: ETHPGW:0.0.0.0
I (8265) Olimex_ESP32_EVB_REV_B_eth_example: ~~~~~~~~~~~
E (8705) emac: emac rx buf err!!


Any help would be much appreciated :D

wobaekat

Nevermind, I managed to get the latest demo thats in the esp-idf repo at: https://github.com/espressif/esp-idf/tree/master/examples/ethernet/ethernet to work without the "rx buf err" appearing when the evb is connected to a network, and an IP Address is requested and received from the network.

Something must have changed in the idf since the olimex examples were written up it seems.

For anyone else that was having the same problem, simply configure the esp-idf ethernet demo found at: https://github.com/espressif/esp-idf/tree/master/examples/ethernet/ethernet but use the make menuconfig options that are on the olimex ESP32-EVB ethernet example page at: https://github.com/OLIMEX/ESP32-EVB/blob/master/SOFTWARE/ETH_PHY_demo/README.md

Now my serial output is as follows:

$ make monitor
MONITOR
--- idf_monitor on COM11 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0xb (HSPI_FLASH_BOOT)
flash read err, 1000
Falling back to built-in command interpreter.
OK
>ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0xb (HSPI_FLASH_BOOT)
flash read err, 1000
Falling back to built-in command interpreter.
OK
>ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0xb (HSPI_FLASH_BOOT)
flash read err, 1000
Falling back to built-in command interpreter.
OK
>ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x1b (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:0x3fff0010,len:4
load:0x3fff0014,len:5396
load:0x40078000,len:0
load:0x40078000,len:12112
entry 0x40078f48
I (45) boot: ESP-IDF v3.0-dev-509-g9da1bf1a-dirty 2nd stage bootloader
I (45) boot: compile time 08:40:35
I (49) boot: Enabling RNG early entropy source...
I (66) boot: SPI Speed      : 40MHz
I (78) boot: SPI Mode       : DIO
I (91) boot: SPI Flash Size : 4MB
I (103) boot: Partition Table:
I (114) boot: ## Label            Usage          Type ST Offset   Length
I (137) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (160) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (184) boot:  2 factory          factory app      00 00 00010000 00100000
I (207) boot: End of partition table
I (220) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x08184 ( 3
3156) map
I (283) esp_image: segment 1: paddr=0x000181ac vaddr=0x3ffb0000 size=0x0216c (
8556) load
I (294) esp_image: segment 2: paddr=0x0001a320 vaddr=0x40080000 size=0x00400 (
1024) load
0x40080000: _iram_start at ??:?

I (311) esp_image: segment 3: paddr=0x0001a728 vaddr=0x40080400 size=0x058e8 ( 2
2760) load
I (366) esp_image: segment 4: paddr=0x00020018 vaddr=0x400d0018 size=0x1ed64 (12
6308) map
0x400d0018: _flash_cache_start at ??:?

I (501) esp_image: segment 5: paddr=0x0003ed84 vaddr=0x40085ce8 size=0x01f0c (
7948) load
0x40085ce8: multi_heap_malloc at C:/users/Nathan/git/esp-idf/components/heap/mul
ti_heap.c:315 (discriminator 2)

I (512) esp_image: segment 6: paddr=0x00040c98 vaddr=0x400c0000 size=0x00000 (
   0) load
I (537) boot: Loaded app from partition at offset 0x10000
I (540) boot: Disabling RNG early entropy source...
I (558) cpu_start: Pro cpu up.
I (569) cpu_start: Starting app cpu, entry point is 0x40080d78
0x40080d78: call_start_cpu1 at C:/users/Nathan/git/esp-idf/components/esp32/cpu_
start.c:218

I (0) cpu_start: App cpu up.
I (602) heap_init: Initializing. RAM available for dynamic allocation:
I (622) heap_init: At 3FFAE2A0 len 00001D60 (7 KiB): DRAM
I (641) heap_init: At 3FFBB5A8 len 00024A58 (146 KiB): DRAM
I (660) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (679) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (699) heap_init: At 40087BF4 len 0001840C (97 KiB): IRAM
I (718) cpu_start: Pro cpu start user code
I (777) cpu_start: Starting scheduler on PRO CPU.
I (195) cpu_start: Starting scheduler on APP CPU.
I (195) emac: mac version 1137a
I (195) emac: emac start !!!

I (195) emac: emac resetting ....
I (205) emac: emac reset done
I (205) system_api: Base MAC address is not set, read default base MAC address f
rom BLK0 of EFUSE
I (225) emac: emac start success !!!
I (4225) eth_example: ~~~~~~~~~~~
I (4225) eth_example: ETHIP:0.0.0.0
I (4225) eth_example: ETHPMASK:0.0.0.0
I (4225) eth_example: ETHPGW:0.0.0.0
I (4225) eth_example: ~~~~~~~~~~~
I (6225) eth_example: ~~~~~~~~~~~
I (6225) eth_example: ETHIP:0.0.0.0
I (6225) eth_example: ETHPMASK:0.0.0.0
I (6225) eth_example: ETHPGW:0.0.0.0
I (6225) eth_example: ~~~~~~~~~~~
I (8225) eth_example: ~~~~~~~~~~~
I (8225) eth_example: ETHIP:0.0.0.0
I (8225) eth_example: ETHPMASK:0.0.0.0
I (8225) eth_example: ETHPGW:0.0.0.0
I (8225) eth_example: ~~~~~~~~~~~
I (10225) eth_example: ~~~~~~~~~~~
I (10225) eth_example: ETHIP:0.0.0.0
I (10225) eth_example: ETHPMASK:0.0.0.0
I (10225) eth_example: ETHPGW:0.0.0.0
I (10225) eth_example: ~~~~~~~~~~~
I (12235) eth_example: ~~~~~~~~~~~
I (12235) eth_example: ETHIP:0.0.0.0
I (12235) eth_example: ETHPMASK:0.0.0.0
I (12235) eth_example: ETHPGW:0.0.0.0
I (12235) eth_example: ~~~~~~~~~~~
I (14245) eth_example: ~~~~~~~~~~~
I (14245) eth_example: ETHIP:0.0.0.0
I (14245) eth_example: ETHPMASK:0.0.0.0
I (14245) eth_example: ETHPGW:0.0.0.0
I (14245) eth_example: ~~~~~~~~~~~
I (16255) eth_example: ~~~~~~~~~~~
I (16255) eth_example: ETHIP:0.0.0.0
I (16255) eth_example: ETHPMASK:0.0.0.0
I (16255) eth_example: ETHPGW:0.0.0.0
I (16255) eth_example: ~~~~~~~~~~~
I (18225) emac: eth link_up!!!
I (18265) eth_example: ~~~~~~~~~~~
I (18265) eth_example: ETHIP:0.0.0.0
I (18265) eth_example: ETHPMASK:0.0.0.0
I (18265) eth_example: ETHPGW:0.0.0.0
I (18265) eth_example: ~~~~~~~~~~~
I (20275) eth_example: ~~~~~~~~~~~
I (20275) eth_example: ETHIP:192.168.254.196
I (20275) eth_example: ETHPMASK:255.255.255.0
I (20275) eth_example: ETHPGW:192.168.254.1
I (20275) eth_example: ~~~~~~~~~~~
I (22285) eth_example: ~~~~~~~~~~~
I (22285) eth_example: ETHIP:192.168.254.196
I (22285) eth_example: ETHPMASK:255.255.255.0
I (22285) eth_example: ETHPGW:192.168.254.1
I (22285) eth_example: ~~~~~~~~~~~
I (24295) eth_example: ~~~~~~~~~~~
I (24295) eth_example: ETHIP:192.168.254.196
I (24295) eth_example: ETHPMASK:255.255.255.0
I (24295) eth_example: ETHPGW:192.168.254.1
I (24295) eth_example: ~~~~~~~~~~~
I (26305) eth_example: ~~~~~~~~~~~
I (26305) eth_example: ETHIP:192.168.254.196
I (26305) eth_example: ETHPMASK:255.255.255.0
I (26305) eth_example: ETHPGW:192.168.254.1
I (26305) eth_example: ~~~~~~~~~~~