Skip to main content
Graduate
March 9, 2024
Question

Using LwIP's sockets with CubeMX ?

  • March 9, 2024
  • 1 reply
  • 1684 views

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.

    1 reply

    Super User
    March 9, 2024

     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
    Graduate
    March 9, 2024

    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.