I am building an application for ATSAME70 microcontroller. I am trying out ThreadX with NetXDuo. I compile the ThreadX related libs separately from my actual application, and then copy the libs, .c and .h files from threadX folder to my application directory. I wanted to try out the demo BSD program but after making the changes suggested in https://learn.microsoft.com/en-us/azure/rtos/netx-duo/netx-duo-bsd/chapter2, the test LED blinking program stops working that was working before making the changes stops working.
Steps:
- Compile ThreadX with FileX and NetXDuo without modifying tx_port.h file.
- Copy the libs and relevant .c and .h files for threadX, fileX and netXDuo to the application directory.
- Build application.
- LED blinking program works.
- Compile ThreadX with FileX and NetXDuo after modifying tx_port.h file. Do not copy the modified tx_port.h file in the application directory yet.
- Copy the libs for threadX, fileX and netXDuo to the application directory.
- Build application.
- LED blinking program still works. At this point, I have not included the BSD related code in the main application. I have just updated the threadx libraries.
- Copy the modified tx_port.h file in application directory.
- Build application.
- LED blinking program stops working. The program is stuck in tx_kernel_enter().
The change I made in tx_port.h is redefine TX_THREAD_EXTENSION_3:
#define TX_THREAD_EXTENSION_3 int bsd_errno;
Can anyone tell me where I am going wrong?
For compiling netxduo libraries with threadx, I simply copy the filex and netxduo inside the threadx folder and add "add_subdirectory" commands in CMakeLists of threadx. For BSD addon, I simply update the tx_port.h file. Do I need to incorporate nxd_bsd.h and nxd_bsd.c files as well while generating libraries for threadx and netxduo? Currently I am not using the nxd_bsd files for generating the libraries. I am using them just in the main application.