2025-06-27 5:02 AM
I added I-CUBE-wolfMQTT and I-CUBE-wolfSSL software packs to my STM32CubeIDE project in CubeMX built into CubeIDE. In CubeMX I set parameters:
Despite that, trying to compile project ends up with errors like "'SOL_SOCKET' undeclared (first use in this function)" or "'AF_INET' undeclared (first use in this function)". It is because example code uses sockets from LwIP library which can't be used if FreeRTOS is disabled. Even in lwipopts.h LWIP_SOCKET is defined to 0 and you can't enable it in CubeMX if NO_SYS (OS Awarness) is set to OS Not Used.
Am I missing something? Did I misconfigure settings in CubeMX or are provided examples just wrong?
Solved! Go to Solution.
2025-06-30 2:28 AM
Hello @_AdamNtrx,
Thank you for your report.
The issue arises because the I-CUBE-wolfMQTT examples use BSD sockets via LWIP, which requires FreeRTOS to be enabled (NO_SYS=0) to provide this socket interface.
In your current configuration (NO_SYS=1, FreeRTOS disabled), LWIP does not provide the socket definitions and functions, hence the errors 'SOL_SOCKET' undeclared and 'AF_INET' undeclared.
To resolve this issue, please try to:
With Regards,
2025-06-30 2:28 AM
Hello @_AdamNtrx,
Thank you for your report.
The issue arises because the I-CUBE-wolfMQTT examples use BSD sockets via LWIP, which requires FreeRTOS to be enabled (NO_SYS=0) to provide this socket interface.
In your current configuration (NO_SYS=1, FreeRTOS disabled), LWIP does not provide the socket definitions and functions, hence the errors 'SOL_SOCKET' undeclared and 'AF_INET' undeclared.
To resolve this issue, please try to:
With Regards,
2025-06-30 5:49 AM
Thank you for the answer. Do you know by any chance which parts of the code need to be changed to use LwIP's raw API?
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.