2021-12-20 02:16 AM
Hello,
I'm using stm32h757i-eval board & STM23cube ide for programming.
I have successfully achieved the UDP communication.
But there is one problem.
I want a trigger or auto polling function for the UDP_RECV i.e, when ever there is a input data available only then it should enter the UDP_RECV function.
and I'm not able to figure out how to do this.
Kindly help me solve this issue
2021-12-20 03:03 AM
Assuming you are using lwIP, do you really mean the function "udp_recv" which is only binding a udp receive (recv) function to a certain pcb = setting udp callback function?
In my lwIP application input data is polled through MX_LWIP_Process() in the main while loop, which again calls ... many functions:
I once tracked that down for IP4 to get a better overview for the "processing path":
Network Interface Layer:
main.c: poll: MX_LWIP_Process()
-> lwip.c: MX_LWIP_Process() -> ethernetif_input(&netif)
-> ethernetif.c ethernetif_input(&netif) -> p = low_level_input(netif)
-> ethernetif.c low_level_input(netif) -> netif->input(p, netif)
-> ethernet.c netif->input(p, netif) = ethernet_input(p, netif)
-> ethernet.c ethernet_input(p, netif) -> check: header, length, address (ARP), type -> ip4_input(p, netif)
Internet Layer:
-> ip4.c ip4_input(p, netif) -> address / broadcast? type? -> RAW, ICMP, IGMP, UDP, TCP ?
-> ICMP: icmp_input(p, netif)
-> IGMP: igmp_input(p, netif)
Transport Layer:
-> UDP: udp_input(p, netif) <<== so this might be of interest to you?
-> TCP: tcp_input(p, netif)
2021-12-20 04:25 AM
Thank you for your response.
yes. I'm using LwIP and have referred this link for the udp communication: https://controllerstech.com/stm32-ethernet-3-udp-client/
and I have called the MX_LWIP_Process,
The issue is since its in the while loop the data keeps printing till the new input data is enterred.
I want to pause the printing after once and wait for the next input data.
2021-12-22 11:20 PM
So the UDP_recv function can be replaced with the UDP_Input function?
Is that what you suggest.
2022-01-13 06:13 PM
Read my latest post in this thread:
https://community.st.com/s/question/0D50X0000C6eNNS/bug-fixes-stm32h7-ethernet
It's exactly about the code from that site...