TCP modbus slave example with ESP32-POE-ISO in idf 4.4

parkykk
Posts: 1
Joined: Fri Nov 03, 2023 5:05 am

TCP modbus slave example with ESP32-POE-ISO in idf 4.4

Postby parkykk » Fri Nov 03, 2023 5:20 am

Hi

I am seeking assistance for testing the TCP Modbus example in IDFv4.4. I am specifically using the ESP32-POE-ISO board (rev. L-https://www.olimex.com/Products/IoT/ESP ... e-hardware).

To begin, I downloaded the Simple Ethernet demo for ESP-IDF from https://github.com/OLIMEX/ESP32-POE/tre ... RE/ESP-IDF. I proceeded to test the 'ESP32_PoE_Ethernet_IDFv4.4' example, which worked perfectly. As a result, I copied the sdkconfig file to the mb_tcp_slave folder, compiled and tested it, but encountered the following error:

Anyone experienced a similar issue and found solution? I attached sdkconfig as reference.

Rebooting...
ets Jul 29 2019 12:21:46

rst:0xc (SW_CPU_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:0x3fff0030,len:6664
load:0x40078000,len:15060
load:0x40080400,len:3836
entry 0x4008069c
I (27) boot: ESP-IDF HEAD-HASH-NOTFOUND 2nd stage bootloader
I (27) boot: compile time 14:55:31
I (27) boot: Multicore bootloader
I (31) boot: chip revision: v3.1
I (35) boot.esp32: SPI Speed : 40MHz
I (40) boot.esp32: SPI Mode : DIO
I (44) boot.esp32: SPI Flash Size : 2MB
I (49) boot: Enabling RNG early entropy source...
I (54) boot: Partition Table:
I (58) boot: ## Label Usage Type ST Offset Length
I (65) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (73) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (80) boot: 2 factory factory app 00 00 00010000 00100000
I (88) boot: End of partition table
I (92) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=199f4h (104948) map
I (138) esp_image: segment 1: paddr=00029a1c vaddr=3ffb0000 size=03180h ( 12672) load
I (144) esp_image: segment 2: paddr=0002cba4 vaddr=40080000 size=03474h ( 13428) load
I (150) esp_image: segment 3: paddr=00030020 vaddr=400d0020 size=7e1f0h (516592) map
I (340) esp_image: segment 4: paddr=000ae218 vaddr=40083474 size=11de4h ( 73188) load
I (380) boot: Loaded app from partition at offset 0x10000
I (380) boot: Disabling RNG early entropy source...
I (392) cpu_start: Multicore app
I (392) cpu_start: Pro cpu up.
I (392) cpu_start: Starting app cpu, entry point is 0x400811a8
I (381) cpu_start: App cpu up.
I (410) cpu_start: Pro cpu start user code
I (410) cpu_start: cpu freq: 160000000
I (410) cpu_start: Application information:
I (415) cpu_start: Project name: modbus_tcp_slave
I (420) cpu_start: App version: 1
I (425) cpu_start: Compile time: Nov 3 2023 14:55:16
I (431) cpu_start: ELF file SHA256: 8fde073950ec9c68...
I (437) cpu_start: ESP-IDF: HEAD-HASH-NOTFOUND
I (443) cpu_start: Min chip rev: v0.0
I (447) cpu_start: Max chip rev: v3.99
I (452) cpu_start: Chip rev: v3.1
I (457) heap_init: Initializing. RAM available for dynamic allocation:
I (464) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (470) heap_init: At 3FFB7750 len 000288B0 (162 KiB): DRAM
I (477) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (483) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (489) heap_init: At 40095258 len 0000ADA8 (43 KiB): IRAM
I (497) spi_flash: detected chip: generic
I (500) spi_flash: flash io: dio
W (504) spi_flash: Detected size(4096k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (518) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (572) wifi:wifi driver task: 3ffbf8a0, prio:23, stack:6656, core=0
I (572) system_api: Base MAC address is not set
I (572) system_api: read default base MAC address from EFUSE
I (582) wifi:wifi firmware version: d9959e6
I (582) wifi:wifi certification version: v7.0
I (582) wifi:config NVS flash: enabled
I (582) wifi:config nano formating: disabled
I (592) wifi:Init data frame dynamic rx buffer num: 32
I (592) wifi:Init management frame dynamic rx buffer num: 32
I (602) wifi:Init management short buffer num: 32
I (602) wifi:Init dynamic tx buffer num: 32
I (612) wifi:Init static rx buffer size: 1600
I (612) wifi:Init static rx buffer num: 10
I (612) wifi:Init dynamic rx buffer num: 32
I (622) wifi_init: rx ba win: 6
I (622) wifi_init: tcpip mbox: 32
I (632) wifi_init: udp mbox: 6
I (632) wifi_init: tcp mbox: 6
I (632) wifi_init: tcp tx win: 5744
I (642) wifi_init: tcp rx win: 5744
I (642) wifi_init: tcp mss: 1440
I (652) wifi_init: WiFi IRAM OP enabled
I (652) wifi_init: WiFi RX IRAM OP enabled
I (662) example_connect: Connecting to myssid...
I (662) phy_init: phy_version 4771,450c73b,Aug 16 2023,11:03:10
I (742) wifi:mode : sta (08:b6:1f:72:10:74)
I (742) wifi:enable tsf
E (772) lan87xx: lan87xx_init(499): wrong chip ID
E (772) esp_eth: esp_eth_driver_install(215): init phy failed

ESP_ERROR_CHECK failed: esp_err_t 0xffffffff (ESP_FAIL) at 0x40088e68
file: "IDF/examples/common_components/protocol_examples_common/connect.c" line 444
func: eth_start
expression: esp_eth_driver_install(&config, &s_eth_handle)

abort() was called at PC 0x40088e6b on core 0

Backtrace: 0x40081b9a:0x3ffb9ac0 0x40088e75:0x3ffb9ae0 0x4008fa76:0x3ffb9b00 0x40088e6b:0x3ffb9b70 0x400d7cbb:0x3ffb9b90 0x400d7d15:0x3ffb9c40 0x400d7de7:0x3ffb9c60 0x400d7384:0x3ffb9ca0 0x400d7917:0x3ffb9cd0 0x4014c310:0x3ffb9d10 0x4008c2e5:0x3ffb9d30

ELF file SHA256: 8fde073950ec9c68
Attachments
sdkconfig.txt
(43.31 KiB) Downloaded 177 times

ESP_alisitsyn
Posts: 211
Joined: Fri Feb 01, 2019 4:02 pm
Contact:

Re: TCP modbus slave example with ESP32-POE-ISO in idf 4.4

Postby ESP_alisitsyn » Mon Nov 13, 2023 6:59 pm

Hi,

The issue is related to your Ethernet interface configuration. The driver can not recognize your Ethernet chip ID. This is usually related to pin configuration of the interface and as well as its clock source. Please check clock source used by your board. The clock source can be from external XTAL generator or from APLL from ESP32 chip. Please take a look to documentation https://docs.espressif.com/projects/esp ... p_eth.html.

Please take a look to corresponded kconfig values and verify your configuration once again:
ETH_PHY_INTERFACE_RMII(=y) "Reduced Media Independent Interface (RMII)"
ETH_RMII_CLK_INPUT(=n) "Input RMII clock from external"
ETH_RMII_CLK_IN_GPIO(=)
ETH_RMII_CLK_OUTPUT(=y) "Output RMII clock from internal"
ETH_RMII_CLK_OUTPUT_GPIO0(=y) "Output RMII clock from GPIO0 (Experimental!)"
ETH_RMII_CLK_OUT_GPIO(=) "RMII clock GPIO number"
<choice ETH_RMII_CLK_MODE> "RMII clock mode"

# Is the SPI ethernet bus used instead of ext RMII additionally?
CONFIG_ETH_USE_SPI_ETHERNET=y
# CONFIG_ETH_SPI_ETHERNET_DM9051 is not set
CONFIG_ETH_SPI_ETHERNET_W5500=y
As about the Modbus component I recommend to use latest v1.0.12 version of the component instead of included freemodbus in v4.4.
https://components.espressif.com/compon ... esp-modbus
You can simply exclude the freemodbus including the line below to your CmakeLists.txt file:

Code: Select all

set(EXCLUDE_COMPONENTS freemodbus)
Please also include the component manager manifest file to be able to include always latest esp-modbus component into your project https://github.com/espressif/esp-idf/bl ... ponent.yml

Who is online

Users browsing this forum: Gaston1980 and 103 guests