2022-11-13 04:59 AM
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 :)
2022-11-14 12:02 AM
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 :
https://github.com/stm32-hotspot/STM32H7-LwIP-Examples/tree/main/STM32H743_Nucleo_ETH
Hope this helps you!
Imen
2022-11-14 12:56 AM
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.
2022-11-14 01:53 AM
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
2022-11-14 06:17 PM
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