2023-11-01 1:02 PM
Has anyone successfully used the BSD addon for netxduo inside CubeIDE? I followed the instructions at the top of https://learn.microsoft.com/en-us/azure/rtos/netx/netx-bsd/chapter2 (the #define TX_THREAD_EXTENSION_3 int bsd_errno needed a trailing semi-colon) but the netx timeval and fd_set definitions conflict with the CubeIDE environment (/ST/STM32CubeIDE_1.10.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.win32_1.1.1.202309131626/tools/arm-none-eabi/include/select.h and /ST/STM32CubeIDE_1.10.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.win32_1.1.1.202309131626/tools/arm-none-eabi/include/sys/_timeval.h).
My only reason for using BSD is to to implement ModbusTCP with libmodbus . I would gladly opt for a native netx implementation of ModbusTCP if anyone knows of one.
Solved! Go to Solution.
2025-05-16 1:45 AM
Hi rob.
Thanks for your reply.
I continued to do the check-up for a few more days.
The problem was in '#define' command.
#define NX_SOC_ERROR -1 /* Failure. */
#ifndef ERROR
#define ERROR NX_SOC_ERROR
#endif
The 'ERROR' constant also exists in the standard library, causing a conflict.
So, I modified this constant as below. And I replaced from ERROR to BSD_ERROR in nxd_bsd.c file.
#define NX_SOC_ERROR -1 /* Failure. */
#ifndef BSD_ERROR
#define BSD_ERROR NX_SOC_ERROR
#endif
Now, error is gone.
I will try to do TCP/UDP Test code with nxd_bsd.
Best regards,