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: Cannot bind to the socket created in the EtherNet/IP sample environment.

Part Number: PROCESSOR-SDK-AM335X
Other Parts Discussed in Thread: AMIC110

Hi,

I have implemented the EtherNet/IP stack (TMG) based on the evaluation environment of "PRU-ICSS-EthernetIP_Adapter_01.00.03.04".
I have removed the original library of TI samples ("ethernetip_adapter_stack_AM335x_arm") and implemented the stack.
(I understand that "ethernetip_adapter_stack_AM335x_arm" is also a TMG stack.)

The environment is as follows:

・PRU-ICSS-EthernetIP_Adapter_01.00.03.04
・processor_sdk_rtos_am335x_5_02_00_10
・ccs_9.3.0.00012
・XDC_TOOLS_VERSION=3.50.08.24
・SYS_BIOS_VERSION=6.73.01.01
・NDK_VERSION=3.40.01.01

The target device is AMIC110.

When some sockets are created in the initial process of EtherNet/IP, there is a problem that bind cannot be done.

The flow is as follows:

1. "fdOpenSession( TaskSelf() )" : Session construction.
2. "socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)" : Socket1 generation. Result OK.SOCKET"0x80100BC4"
3. "bind" : Bind: Socket"Socket1", addr"127.0.0.1", port"0x6056". Result OK.
4. "socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)" : Socket2 generation. Result OK.SOCKET"0x80100CC4"
5. "socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)" : Socket3 generation. Result OK.SOCKET"0x80100DC4"
6. "bind" : Bind: Socket"Socket3", addr"127.0.0.1", port"0x5056". Result NG(fdError="9 : NDK_EBADF(Bad file descriptor)").

<Question>

Q1. Why does bind give an error even though the socket can be created? Are there any restrictions?
I would appreciate it if you could teach me the points to confirm.

Q2. What does "SO_Open_Session()" of "PRU-ICSS-EthernetIP_Adapter_01.00.03.04" sample do?

Q3. Is it possible to provide the following files of the TMG stack and NDK junction, which were designed when the library "ethernetip_adapter_stack_AM335x_arm" was generated, as design samples?

- user_os_msgq.c
- user_os_sem.c
- user_os_task.c
- user_so.c
- user_sys.c

Thank you for your confirmation.

Best regards,
Eiji.

  • Hi Eiji

    >> implemented the stack

    Do you mean the stack is implemented by yourself, not from TMG?

    The "files of the TMG stack and NDK junction" is available from the recent TMG stack, please contact TMG for the support.

    Regards,

    Garrett

  • Hi Garrett

    Thank you for your prompt reply.

    > Do you mean the stack is implemented by yourself, not from TMG?

    ->The stack is from TMG.
    I have implemented the stack myself in the PRU-ICSS-EthernetIP_Adapter_01.00.03.04 environment.
    It is an image to replace the TMG stack without using the library "ethernetip_adapter_stack_AM335x_arm".

    > The "files of the TMG stack and NDK junction" is available from the recent TMG stack, please contact TMG for the support.

    ->Yes, I have already confirmed with TMG.
    But, I heard from them that The "files of the TMG stack and NDK junction" are not owned by TMG and are built by TI.
    They said they only provided TMG stacks to TI.
    So I contacted E2E...

    Thank you for your confirmation.

    Best regards,
    Eiji.