Hello everyone,
I'm getting my feet wet with ThreadX and NetxDuo.
I'm using a NUCLEO-H563ZI board.
I started by building and flashing the Nx_UDP_Echo_Server example project to the board using the STM32CubeIDE.
This worked right away. The board got address 192.168.1.164 assigned, green led was flashing, responded to a ping, and echoed whatever I sent over UDP port 6000.
My goal however, is to get this working with a static IP address. To accomplish this, I made the following changes in CubeMX:
- Middleware and Software packs -> NETXDUO -> Addons (Top pane)
Changed DHCP from "Client" to "Disable"
- Middleware and Software packs -> NETXDUO -> Configuration (Bottom pane) -> NetxDuo Protocols
NetxDuo Ethernet IP Address: From "192.168.1.1" to "192.168.1.164"
After that I needed to make the following code changes to get the software to compile again:
app_netxduo.h:
- removed the include for nxd_dhcp_client.h
app_netxduo.c:
- removed:
nx_dhcp_stop(&DHCPClient);
nx_dhcp_start(&DHCPClient);
- changed the last argument of the tx_thread_create call for the AppUDPThread from "TX_DONT_START" to "TX_AUTO_START"
Now, strangely enough, when I run this code with the CubeIDE debugger attached, it works just as expected.
But when I stop the debugger and reset the device:
- Green led does flash (so AppUDPThread must be running)
- Board does not respond to a ping
- No messages sent to the board are echoed back
- RJ45 port:
Green led is on
Orange led flashes
Log from serial port:
Nx_UDP_Echo_Server application started..
UDP Server listening on PORT 6000..
The network cable is not connected.
The network cable is connected again.
UDP Echo Server is available again.
Does anyone have any idea what could cause this, and how I get an UDP connection running with a static IP?
Thanks in advance.
Wim!
Board: NUCLEO-H563ZI
BSP: STM32Cube_FW_H5_V1.2.0
CubeIDE: 1.15.1