Skip to main content
Associate II
Mar 9, 2024 3:03 PM UTC
Question

Using LwIP's sockets with CubeMX ?

I would like to use plain sockets in my non OS STM32 application.  LwIP provides plain sockets.  I have used them in ESP32 applications where they work well.

LwIP sockets are not an option in CubeMX as far as I can tell.   One can manually enable sockets by changing LWIP_SOCKETS from 0 to 1 in Inc/lwipopts.h.   However, when I do this I get the build errors in the attached file.

STM has test for sockets in their github code:  https://github.com/STMicroelectronics/stm32_mw_lwip/blob/master/test/sockets/sockets_stresstest.c

Has anyone used LwIP's plain sockets in an STM32 application ?  If so, how did you get it to build ?

Thanks

 

 

    This topic has been closed for replies.

    2 replies

    Pavel A.
    Mar 9, 2024 10:31 PM UTC

    >  non OS STM32 application

    From the source (sockets_stresstest.c) this test is intended for multi-threading environment  (aka RTOS). So, not suitable for non-OS setup.

    Files in the test/ subtree come from the upstream LwIP project, not modified by ST.

    SomeguyAuthor
    Associate II
    Mar 9, 2024 10:38 PM UTC

    Thanks for the reply.  I'll check with the LwIP group and see what is going on. 

    BTW, really liking CubeMX and the fact that LwIP is part of the toolchain.   Saves work not having to get it set up ourselves.