This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LP-AM243: Ethernet udp connection

Part Number: LP-AM243

I am trying to modify the mcu+ sdk ethernet lwip_cpsw example to connect to a sensor. The sensor requires packets shipped via udp. I have already been able to run the application as is and see information on the console, such as the port, ip address of the board, and then at then end, the CPU load every 5 seconds. I actually had to to into the example.syscfg and enable CCS Log under "Debug_Log" to see all the information. It was disabled by default.

I do not need any of the tcp portions of the code since the sensor requires a udp packet. I am looking for a comprehensive understanding of which macros do not need enabled. It looks like the base values for the macros already allow for both udp and tcp packets to be sent and received. How would I disable TCP only.

Also, for clarification, the example application just shows a demonstration of connecting via ethernet from the host computer to the board and to get the mac address information and ip address, correct? To further understand the application, it looks like the tcpecho and udpecho threads are started and run separately from the main thread. As those are running, the main thread just prints out the CPU load every 5s. Is this a correct understanding? Is any information actually shipped out and received between the host PC and launch pad? I assume I probably also don't need iperf functionality as well. I was able to run it in command line and see successful TCP connection.

  • Hi Jacob,

    Sorry for delay. Gathering data on this from SW experts took little longer.

    Please find our response below -

    Please note our lwip example is picked from lwip-contrib test https://github.com/particle-iot/lwip-contrib/blob/master/examples/example_app/test.c

     This spawns different example apps like udp_echo/iperf etc.

    Disabling TCP support needs to be done in LWIP stack not in the example application. This will require changes in lwipopts.h

     https://www.nongnu.org/lwip/2_1_x/group__lwip__opts.html

    Btw, unless you want to reduce memory usage having TCP enabled is harmless. For reference code for simple UDP example, you can refer to udpecho.c

    We don’t see any documentation for the test.c in lwip-contrib but the flow is fairly straightforward. apps_init() functions spawns a series of applications each of which then is independent listening on a particular port. 

    There are defines that control if an app should be created: mcu_plus_sdk\examples\networking\lwip\enet_lwip_cpsw\lwipcfg.h

     Currently following are enabed:

     #define LWIP_TCPECHO_APP              1

    #define LWIP_UDPECHO_APP              1

    #define LWIP_LWIPERF_APP              1

    #define LWIP_UDPERF_APP               1

      

    For disabling the TCPECHO_APP/LWIPIPERF_APP, UDPERF_APP, please change above relevant defines to 0

     

    Regards,

    Prasad