Hi @Prasad V , Greetings! To set and integrate BSD with Azure RTOS, please follow the steps outlined in the article Installation and use of Azure RTOS NetX Duo BSD. The required files nxd_bsd.h and nxd_bsd.c can be obtained from the GitHub link. The demo samples can be found from the Samples directive of the GitHub repository.
- In order to use NetX Duo BSD place the above files in the directory where NetX Duo is installed. For example, if NetX Duo is installed in the directory "\threadx\arm7\green" then the nxd_bsd.h and nxd_bsd.c files should be copied into this directory.
- The ThreadX library must define
bsd_errno
in the thread local storage. Please find additional details below- In tx_port.h, set one of the TX_THREAD_EXTENSION macros as follows:
-
#define TX_THREAD_EXTENSION_3 int bsd_errno
- If TX_THREAD_EXTENSION_3 is already used, the user is free to use one of the other TX_THREAD_EXTENSION macros.
-
- Rebuild the ThreadX library
- In tx_port.h, set one of the TX_THREAD_EXTENSION macros as follows:
- Before using NetX Duo BSD Services, the NetX Duo library must be built with NX_ENABLE_EXTENDED_NOTIFY_SUPPORT defined. By default it is not defined. If the BSD raw sockets are to be used, the NetX Duo library must be built with NX_ENABLE_IP_RAW_PACKET_FILTER defined.
- To utilize NetX Duo BSD services, the application must create an IP instance, create a packet pool for the BSD layer to allocate packets from, allocate memory space for the internal BSD thread stack, and specify the priority of the internal BSD thread. Please find the snippet below
INT bsd_initialize(NX_IP *default_ip, NX_PACKET_POOL *default_pool,
*CHAR *bsd_thread_stack_area,
*ULONG bsd_thread_stack_size,
*UINT bsd_thread_priority*);
Hope this helps! Please let us know if you have any additional questions or need further assistance on this in the comments below.