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.
2023-11-02 8: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 8: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 4: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 7:36 AM
Unfortunately, no. I abandoned this approach and modified my modbustcp library to use native NetX.
2025-01-05 7:11 PM
May be my you tube site will help you even though the speaking language is korean.
https://www.youtube.com/watch?v=YVdNClVnT1s
2025-01-06 4:15 AM
Please refer to my new youtube for simpletest ECAT Master program Developed on STM32F769I-DISC board by using nxd_bsd and Netx Duo in Azure RTOS operating combined with XMC4800 ECAT Slave Board.
https://studio.youtube.com/video/NWQJTNXTehI/edit
2025-01-06 4:34 AM
Neglect my previous reply. Sorry for that.
Please refer to my new youtube for simpletest ECAT Master program Developed on STM32F769I-DISC board by using nxd_bsd and Netx Duo in Azure RTOS operating combined with XMC4800 ECAT Slave Board.
https://www.youtube.com/watch?v=NWQJTNXTehI
2025-05-13 11:55 PM - edited 2025-05-14 12:40 AM
Hello, robmilne.
I reached same error such as you.
Description Resource Path Location Type
expected ':', ',', ';', '}' or '__attribute__' before 'ULONG' tx_api.h /ZMG-390AZ_BSD/Middlewares/ST/threadx/common/inc line 630 C/C++ Problem
So, I modified definition below. (with ';' semicolon end of the line)
#define TX_THREAD_EXTENSION_3 int bsd_errno;
but, I reached error message below
I'm getting errors redefining libraries and definitions under internal gnu tools.
So, I uncomment the definition below in nxd_bsd.h
#define NX_BSD_RAW_SUPPORT
#define NX_BSD_ENABLE_NATIVE_API
Finally, the definition below throws an error:
#define NX_SOC_ERROR -1 /* Failure. */
'expected identifier before '-' token'
I wonder if this issue has been resolved.
Best regards,
2025-05-14 4:25 AM
Hi JongOk,
I abandoned this effort quite a while back. Sorry
-rob