This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PROCESSOR-SDK-AM335X: How to include NS for BSD socket

Part Number: PROCESSOR-SDK-AM335X

Goodmorning,

I write you since I want to create a raw ethernet socket. Folllowing NDK User's Guide at point F.1 Using BSD Sockets Provided by SlNetSock, they state to include #include <sys/socket.h>.

In order to let the compiler to find the header, I had to include the NDK path in project include Directories path "C:\ti\ns_2_60_01_06\source\ti\net\bsd" as shown in the picture below:

The problem is that I get several errors:

'sbintime_t' undeclared (first use in this function);

I kindly ask you what is the better way to include NS in a project.

Thank you.

Best Regards,

Davide Brunelli

  • Hi Davide,

    Currently we do not support Network Service (ns) for AM335x in Processor SDK RTOS.

    Ming

  • Hello Ming,

    thank you for your answer. It's very disappointing that so many RTOS features are not supported for sitara processor.

    Is there any other way with which I can create raw socket? Maybe the old starterware?

    And the second question is: what are the sitara processor families (AM437x, AM572x, etc.) that are supported by Network Service?

    Regards,

    Davide Brunelli

  • Besides in this post

    they use BSD sockets, but the path indicated in the thread "And add the include path '"C:\ti\ndk_2_26_00_08\packages\ti\ndk\inc\bsd"' for the bsd_test.c" doesn't exist anymore..

  • Hi Davide,

    Some time back, the BSD support was moved from NDK to NS. What you have done should work.

    The undefined sbintime_t is probably caused by something else. In fact, the sbintime_t is defined in

    C:\ti_am3_610\bios_6_76_02_02\packages\gnu\targets\arm\libs\install-native\arm-none-eabi\include\sys\types.h or

    C:\ti_am3_610\gcc-arm-none-eabi-7-2018-q2-update\arm-none-eabi\include\sys\types.h

    Make sure you include the types.h and its path.

    Ming

  • Hello Ming,

    I could resolve that error by adding the following include directory path "C:\ti\bios_6_76_02_02\packages\gnu\targets\arm\libs\install-native\arm-none-eabi\include", however before including "C:\ti\ndk_2_26_00_08\packages\ti\ndk\inc\bsd" as explained by the guide I could include <sys/types.h> with no problem because "C:\ti_am3_610\gcc-arm-none-eabi-7-2018-q2-update\arm-none-eabi\include" was already included. It's just a little curios..

    I proceeded with the study and I've fond out that in NS BSD implementation several option are not available like the following:

       r = setsockopt(*psock, SOL_SOCKET, SO_SNDTIMEO, &timeout, sizeof(timeout));      // Error SO_SNDTIMEO not defined
       r = setsockopt(*psock, SOL_SOCKET, SO_DONTROUTE, &i, sizeof(i));                          // Error SO_DONTROUTE not defined

    Reading the document NDK_API_Reference.pdf I noticed that raw socket can be implemented sticking with NKD and using NDK_socket(), NDK_bind(), etc. to create RAW socket. So probably I'll move to this kind of implementation.

    Before closing the thread, I wonder what are the advantages of NS BSD raw socket over NDK one?

    Thank you.

    Regards,

    Davide Brunelli

  • Hi Davide,

    I am glad the NDK can meet your needs.

    The reason we have NS is that we can unify some common network services (a high level abstraction) for SimpleLink (for WiFi) and NDK (for Wired network).

    The NS BSD could be easily supported by both SimpleLink and NDK, while the NDK BSD will only supported by NDK.

    Ming