cancel
Showing results for 
Search instead for 
Did you mean: 

LwIP UDP updated examples ?

andy b
Senior
Posted on June 28, 2017 at 16:42

Hello fellow stm32 explorers

I am currently trying to communicate on a LAN network between a pc (server) and my stm32F4 discovery + phy module (client) via a UDP protocol.I am using LwIP with the RAW api (also called NO_SYS).I was able to succesfully convert an example from the stm32f4 eval board to work on my hardware.My probleme is that now im trying to recreate the example but from a project made from scratch.The example I've used is using an old version of LwIP which means that now with my new project which includes the newest version of LwIP simply doing excly the same thing as the example I converted does not work because of the changes made to the library. I am looking for LwIP examples for a newer version of LwIP. Ideally im looking for a RAW api UDP client example. Frankly I haven't found much documentation on how to use the RAW api just a list of functions and how to call them.A code with a basic example of a UDP client would be appreciated.I kept the settings of LwiP in the cube unchanged exept for the NO_SYS ,NO_DHCP and NO_TCP.I am also wondering if there might be something fishy in my configs.I know for certain that my hardware works so this is really a software issue.

Any help or tips concerning UDP using LwIP's RAW api is much appreciated.

Have a nice day

-Andy

#udp #stm32f4 #lwip #stm32f4-discovery #lan
1 ACCEPTED SOLUTION

Accepted Solutions
andy b
Senior
Posted on June 28, 2017 at 20:22

Was able to find an ok example : 

https://lists.nongnu.org/archive/html/lwip-users/2007-06/msg00078.html

 

Just had to change ''struct ip_addr *addr'' for ''const ip_addr_t *addr'' in the udp_echo_recv function.

-Andy

View solution in original post

3 REPLIES 3
andy b
Senior
Posted on June 28, 2017 at 20:22

Was able to find an ok example : 

https://lists.nongnu.org/archive/html/lwip-users/2007-06/msg00078.html

 

Just had to change ''struct ip_addr *addr'' for ''const ip_addr_t *addr'' in the udp_echo_recv function.

-Andy
Posted on July 05, 2017 at 16:18

You can find some LwIP examples in F4 FW Package located in:

STM32CubeMX > Menu Help > Updater Settings > Repository folder

within: STM32Cube_FW_F4_Vxxxx

in some: Projects\STM32F4xxxxxxxxx\Applications\LwIP folders

BR

Eric

Andrew Chin
Associate II
Posted on December 19, 2017 at 22:42

Are there any more updated examples? The problem with the included ones is that they seem not be based on cubemx. So it has a lot of stuff that is redundant. For example, on the UDP server and client, It makes all these function calls that are otherwise automatically done with CubeMx (I think they are). One would think that , 'oh, ok, that means I need to just look at the udp_client_whatever_it_is_called.c file'. Unfortunately, there is a lot of dependencies that make it very hard to follow since it deviates.  For example, the example code assigns the IP address with :

IP4_ADDR( &DestIPaddr, DEST_IP_ADDR0, DEST_IP_ADDR1, DEST_IP_ADDR2, DEST_IP_ADDR3 );

However, it seems (not really 100% sure) that MXcube somehow does it in a different manner? Not only that, but those variables also are predefined in the .h file. 

From what I gather, at this point, we only need to be concerned with the actual LWIP commands such as upd_send() and any other callbacks we may need?