cancel
Showing results for 
Search instead for 
Did you mean: 

udp client -at atm32h753 board ethernet-lwip

abeba.1
Associate II

hii

i have the stm32h753 nuclio board and i am trying to run udp client on the board and my pc will be UDP_SERVER , i am using udp_echoclient_connect() and  udp_echoclient_send()  functions, that are inside the files that is included in the project examples folder .

i attached all the relevant files in my project

i the main function i just want to send one udp message to the server (pc) using udp_echoclient_send() 

my main problem in the cpu goes to hardfault and i don't know why !! 

when i comment udp_echoclient_send()  the project runs and i can ping the board successfully , but when i uncomment udp_echoclient_send()  the cpu goes into hard fault

i attached the relevant files in my project .

i be glad for help :)

4 REPLIES 4
Imen.D
ST Employee

Hello @abeba.1​ ,

Have a look at this article: How to create project for STM32H7 with Ethernet and LwIP stack working.

You can also review the available UDP example on Github :

x-cube-azrtos-h7/Projects/STM32H735G-DK/Applications/NetXDuo at main · STMicroelectronics/x-cube-azrtos-h7 · GitHub

https://github.com/stm32-hotspot/STM32H7-LwIP-Examples/tree/main/STM32H743_Nucleo_ETH

Hope this helps you!

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
LCE
Principal

Maybe you post some relevant code snippets?

Anyway, I ran into hard faults with ethernet stuff when I forgot to adjust the descriptor memory area (linker script) according to the declared descriptor array size.

hii thanks for your reply :)

i changed and configured my design to work with freertos and i can ping the board successfully.

and added the code of sending udp data to my main function in the default task just like in the first link that you provided , and still i don't see the message appear in my udp terminal .

on the other hand i run udp client in python and i see the message in the udp terminal .

it feels to me that something i still messing in the code like the udp_send function is not really activating the send logic , i attached my main.c ,i be glad for help ' it suppose to work .

i can ping the board successfully , and i don't see any reason why it wont work

Piranha
Chief II

Using the core lwIP API with RTOS requires doing the lwIP core thread locking. The following topic has some examples for how to do it:

https://community.st.com/s/question/0D53W00001sGiChSAK/cubemx-lwip-ethernetlinkthread-bug