2023-11-01 01: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.
2023-11-02 08:43 AM
hi @robmilne,
if you have a "nx_user.h" file in your project, please add the following
#ifdef __BSD_VISIBLE
#undef __BSD_VISIBLE
#endif
this should solve your problem.
regards
haithem.
2023-11-02 08:43 AM
hi @robmilne,
if you have a "nx_user.h" file in your project, please add the following
#ifdef __BSD_VISIBLE
#undef __BSD_VISIBLE
#endif
this should solve your problem.
regards
haithem.
2023-11-02 10:58 AM - edited 2023-11-02 11:01 AM
Hi Haithem,
Thanks!
Your code stops compiler errors for the NetXDuo BSD addon files, but I get build errors after I add the libmodbus sources to my project. I think building my own ModbusTCP from scratch using NetX will be less complicated than figuring out how to make this sockets-based library work with CubeIDE. I did find a Renesas project that integrated libmodbus with NetX+BSD, but it was tailored to their environment and the libmodbus version was not current.
Btw, I had already reached this point by defining __BSD_VISIBLE as 0 in ..\tools\arm-none-eabi\include\sys\features.h, but your method is much better.
-rob
2024-04-06 04:40 AM
Hello, thank you for your assistance. I also encountered the fd_set conflict issue when using the IDE, and defining nx as 0 did not resolve it. Do you have any other suggestions or solutions?
2024-04-08 07:36 AM
Unfortunately, no. I abandoned this approach and modified my modbustcp library to use native NetX.