cancel
Showing results for 
Search instead for 
Did you mean: 

Adding BSD sockets to netxDuo for LLDP

coso2
Associate

Hi,

I was able to run a demo project on a STM32H573 dev board. I am using ThreadX and NetxDuo, with mqtt addon.

I was able to connect to the mqtt broker and send/receive messages.

I want also to be able to use the bsd sockets to send packets on layer 2. As far as I have understood, for sending and receiving layer 2 packets I need to use bsd sockets.

I followed the doc from github, added the files .h and .c 
I had to add the line

#define TX_THREAD_USER_EXTENSION int bsd_errno


in the user code part of "tx_user.h", so it can survive a code generation.

Then I enabled 
NX_ENABLE_EXTENDED_NOTIFY_SUPPORT
and

NX_ENABLE_IP_RAW_PACKET_FILTER

Then I got into a problem: the redefinitions of structs and function names, so I added

#define NX_BSD_ENABLE_NATIVE_API

in the user code part of "nx_user.h"
I want to have raw support, so I also added

#define NX_BSD_RAW_SUPPORT

in the user code part of "nx_user.h"

Now I get an error when I compile:
"nxd_bsd.c:474: undefined reference to `_nx_driver_hardware_packet_received_callback' "

Am I missing something or I am doing it wrong? 
Thanks in advance tor any help

1 REPLY 1
coso2
Associate

Ok, I got something in working condition.. kinda. I can init and create a raw socket.

Now, if I call the function "nx_bsd_send", the compiler is complaining abount this:

../NetXDuo/App/nxd_bsd.c:13327: undefined reference to `_nx_driver_hardware_packet_send'

that line is in the function

static INT _nx_bsd_hardware_internal_sendto(NX_BSD_SOCKET *bsd_socket_ptr, CHAR *msg, INT msgLength, INT flags,  struct nx_bsd_sockaddr* destAddr, INT destAddrLen)

If I go to that line and press F3, I go to the declaration in nxd_bsd.h file:

extern UINT _nx_driver_hardware_packet_send(NX_PACKET *packet_ptr);

If I press again F3, I go straight to the implementation in the file "nx_stm32_eth_driver.c".

How is it possible for the ide to find the function, but when I compile I get undefined reference?

Thanks for any hint or advise