BF609: Ethernet - sending on one core, receive on another

Hello, guys!

I have some question about ethernet. For example, in my application I need to send data from Core0 and receive on Core1. But if I initialize lwip on Core 0, and do same action on Core 1, I can see that sending operation on Core0 through sendto() return number sended bytes, but traffic analyzer (Wireshark) doesn't see this sent packet, but if I do sending operation on Core 1 (core which initialize lwip second time) then I see this packet in Wireshark. I tried not initialize lwip on Core1 (commenting function adi_lwip_Init() in adi_initialize.c) and I got next results: sending on Core0 goes success and packet falls into Wireshark, but listening on Core1 through the same socket is possible only if on Core0 ethernet listening thread works, i.e. I have double work on receiving operation for both cores, moreover if I'm not using receiving thread on Core0 (excluding it from execution) I can't thereafter receiving data in remaining listening thread on Core1. Search the reasons such behavior in source files for ethernet drivers for now doesn't help me. Maybe I do something wrong. If you know how to solve this problem, please, let me know.

For lwip settings I use static ip address, in my case 10.10.70.1 and port 7001. Sending and receiving goes through the same port on both cores, but I tried different ports - result is same. 

  • Hi, again

    I compiled part of my project on bf609 ez-kit board. I will send a file through private support. For client code you can use source code in ethernet_client. For reproduce my problems you need do next things:

    1) Open Wireshark and start sniffing ethernet traffic on current interface

    2) Open DSP project: in file ethernet_test_Core0.c set up breakpoint at line 133

    adi_core_enable(ADI_CORE_1)

    and at line 138

    int send_r = send(acc_sct, send_b, sizeof(send_b), 0);

    in file ethernet_test_Core1.c setup breakpoint at line 131

    int send_r = sendto(sockfd, send_b, sizeof(send_b), 0, (struct sockaddr *) &server_address, addr_len);

    3) Start up DSP project

    4) Open main.cpp file at any IDE (I used Qt Creator) and setup breakpoints at line 59

    int socket_fd = eth_init(sock_addr, SOCK_STREAM, INET_ADDRESS, INET_PORT);

    and 75

    int sended_bytes = send(test_sock_fd, (void*) test_buffer, sizeof (test_buffer), 0);

    5) Start up client project. After when code stops on first breakpoint - press Continue/Resume button in debugger. In CCES code stops at line 133 in ethernet_test_Core0.c file. You can see in Wireshark packet which was sent.

    6) Press Resume button in CCES debugger - it will stop at first line in main() function for core_1

    7) Press Resume again - code for core_0 stops at 138 line, core_1 will be in runtime

    8) In client project you need to do step over - now core_1 stops at 131 line and you can also press step over button in CCES and see packet from core_1 in Wireshark window.

    9) In CCES for core_0 you can now try send packet - send() return amount of sent bytes but you can't see this packet in Wireshark

    But I need to do this action on core_0. That's my problem.

  • 0
    •  Analog Employees 
    on Nov 24, 2020 7:11 AM 4 months ago in reply to CDEADS

    Hello,

    We understand that you have already contacted our private support.To avoid duplication of efforts, please continue the discussion there.

    We will post the final response here for others to benefit.

    Regards,
    Santha kumari.K

  • Hello,

    I've got it.

    Through private email they asked me about setup related information. Here it is:

    Processor and Revision - ADSP - BF609 rev.2.0

    Part number - ADZS-BF609-EZ-BRD

    Hardware platform - ADSP-BF609-EZ-BOARD rev.1.0

    Target Software - ethernet drivers

    Development software - CCES 2.6.0

    Host operating system - Windows 10, x64

    Emulator Device - ICE 2000

    Thanks