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.

TDA4VM: Ethernet in A72

Part Number: TDA4VM
Other Parts Discussed in Thread: SYSBIOS

Hello,

I want to send data through ethernet from A72 core. I went through the following docs : 8.5. Developing Ethernet based applications with Linux + RTOS — Processor SDK RTOS J721E but have some doubts. Also while going through this link :Ethernet Firmware: Ethernet Firmware differentiating features demos, I came across various steps for setting up the environment for A72. Is it the right approach ? Please suggest .

Thanks and Regards ,

Meghant Acharya 

  • Hi Meghant,

    You can just run the Linux SDK for basic evaluation of A72, it's much simpler. Download and install this : https://www.ti.com/tool/download/PROCESSOR-SDK-LINUX-J721E

    Follow instructions from SDK User Guide on the same page

    Regards

    Vineet

  • Thank you  for your response . Currently, I am trying to build the enet_loopback_test and enet_nimu_example for A72 core. I have done the following command in pdk/packages/ti/build. ---> $make -s enet_loopback_test BOARD=j721e_evm CORE=mpu1_0. I am getting following error:

    ~/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/pdk_jacinto_07_03_00_29/packages/ti/build$ make -s enet_loopback_test BOARD=j721e_evm CORE=mpu1_0 # Invoking configuro...making package.mak (because of package.bld) ...generating interfaces for package configuro (because package/package.xdc.inc is older than package.xdc) ...configuring sysbios_a72.xa53fg from package/cfg/sysbios_a72_pa53fg.cfg ...# !!! Apply Timer clock freq. change for J721E generating custom ti.sysbios library makefile ... Starting build of library sources ...making /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/pdk_jacinto_07_03_00_29/packages/ti/binary/enet_loopback_test/obj/j721e_evm/mpu1_0/release/configuro/package/cfg/sysbios_a72_pa53fg.src/sysbios/sysbios.aa53fg ...asma53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/family/arm/IntrinsicsSupport_asm_gnu.sv8A ...asma53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/family/arm/gicv3/Hwi_asm_gnu.sv8A ...asma53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/family/arm/gicv3/Hwi_asm_switch_gnu.sv8A ...asma53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/family/arm/gicv3/Hwi_asm_vecs_gnu.sv8A ...asma53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/family/arm/v8a/Cache_asm_gnu.sv8A ...asma53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/family/arm/v8a/Core_asm_gnu.sv8A ...asma53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/family/arm/v8a/TaskSupport_asm_gnu.sv8A ...asma53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/family/arm/v8a/Timer_asm_gnu.sv8A ...asma53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/family/arm/v8a/TimestampProvider_asm_gnu.sv8A ...asma53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/timers/dmtimer/Timer_asm_gnu.sv8A ...cla53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/BIOS.c ...cla53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/family/arm/IntrinsicsSupport.c ...cla53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/knl/Clock.c ...cla53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/knl/Idle.c ...cla53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/knl/Intrinsics.c ...cla53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/knl/Event.c ...cla53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/knl/Mailbox.c ...cla53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/knl/Queue.c ...cla53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/knl/Semaphore.c ...cla53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/knl/Swi.c ...cla53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/knl/Task.c ...cla53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/heaps/HeapBuf.c ...cla53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/heaps/HeapMem.c ...cla53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/gates/GateHwi.c ...cla53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/gates/GateSwi.c ...cla53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/gates/GateMutex.c ...cla53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/hal/Cache.c ...cla53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/hal/Hwi.c ...cla53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/hal/Hwi_stack.c ...cla53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/hal/Hwi_startup.c ...cla53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/hal/Seconds.c ...cla53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/hal/SecondsClock.c ...cla53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/family/arm/gicv3/Hwi.c ...cla53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/family/arm/v8a/Cache.c ...cla53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/family/arm/v8a/Core.c ...cla53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/family/arm/v8a/Mmu.c ...cla53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/family/arm/v8a/TaskSupport.c ...cla53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/family/arm/v8a/Timer.c ...cla53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/family/arm/v8a/TimestampProvider.c ...cla53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/timers/dmtimer/Timer.c ...cla53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/family/arm/a15/TimerSupport.c ...cla53fg /home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/bios_6_83_02_07/packages/ti/sysbios/rts/gnu/ReentSupport.c ...ara53fg arm_IntrinsicsSupport_asm_gnu.o gicv3_Hwi_asm_gnu.o gicv3_Hwi_asm_switch_gnu.o gicv3_Hwi_asm_vecs_gnu.o v8a_Cache_asm_gnu.o v8a_Core_asm_gnu.o v8a_TaskSupport_asm_gnu.o v8a_Timer_asm_gnu.o v8a_TimestampProvider_asm_gnu.o dmtimer_Timer_asm_gnu.o _BIOS.o arm_IntrinsicsSupport.o knl_Clock.o knl_Idle.o knl_Intrinsics.o knl_Event.o knl_Mailbox.o knl_Queue.o knl_Semaphore.o knl_Swi.o knl_Task.o heaps_HeapBuf.o heaps_HeapMem.o gates_GateHwi.o gates_GateSwi.o gates_GateMutex.o hal_Cache.o hal_Hwi.o hal_Hwi_stack.o hal_Hwi_startup.o hal_Seconds.o hal_SecondsClock.o gicv3_Hwi.o v8a_Cache.o v8a_Core.o v8a_Mmu.o v8a_TaskSupport.o v8a_Timer.o v8a_TimestampProvider.o dmtimer_Timer.o a15_TimerSupport.o gnu_ReentSupport.o ...Build of libraries done.# Configuro done!# Compiling j721e_evm:j721e:mpu1_0:release:enet_loopback_test: enet_loopback.c# Compiling j721e_evm:j721e:mpu1_0:release:enet_loopback_test: ../common/bios_mmu.cmake[2]: *** No rule to make target '/home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/pdk_jacinto_07_03_00_29/packages/ti/csl/lib/j721e/a72/release/ti.csl.aa72fg', needed by '/home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/pdk_jacinto_07_03_00_29/packages/ti/binary/enet_loopback_test/bin/j721e_evm/enet_loopback_test_mpu1_0_release.xa72fg'.  Stop./home/elxsi1/ti/ti-processor-sdk-rtos-j721e-evm-07_03_00_07/pdk_jacinto_07_03_00_29/packages/ti/build/makerules/common.mk:405: recipe for target 'mpu1_0' failedmake[1]: *** [mpu1_0] Error 2makefile:361: recipe for target 'enet_loopback_test' failed 

    The reason we are going through this example is because we wanted to use ethernet module in A72 core to transmit data and this example could be used as a reference. Also for A72 core , we have to select CORE= mpu1_0 right ?

    Please Suggest.

    Thanks and Regards .

  • Hi Meghant,

    I see that you want send data through ethernet from A72 and currently you are trying to build a RTOS application for A72.

    Rather than doing that, I would suggest downloading and installing Linux SDK as suggested. You will be able to run linux on A72 and write user space socket applications.

    If you do require to push forward with RTOS, can you please tell me which SDK version are you using?

    Regards,

    Tanmay

  • Thank you @Tanmay Patil for your response .  I am using pdk 07_03_00_07. For ethernet in sdk Linux are there any example application ? Is this link correct 3.2.2.8. CPSW2g Ethernet — Processor SDK Linux for J721e Documentation ? Also here it is for MCU domain CPSW2G. For main domain is there any doc?

    Thanks and Regards .

  • il Do we need to use Virtual Mac for the Main domain A72 Linux ethernet mentioned in this link : 3.2.2.9. CPSWng virtual MAC (remoteproc) — Processor SDK Linux for J721e Documentation ? Thanks and Regards

  • Hi . I wanted to send data through ethernet from A72 core in sdk rtos application.  I am using pdk 07_03_00_07. Thanks and Regards .

  • Thank you , for your response. I wanted to know how to integrate ethernet related functions ( like sending and receiving data) in user applications for the A72 core. Is this reference link correct : Ethernet Firmware: Ethernet Firmware differentiating features demos

    Thanks and Regards .

    Meghant Acharya

  • Hi Meghant,

    When you run run linux on A72, the default bootflow loads ethfw on MAIN domain R50_0 which opens up channels for A72 to send and receive packets. More information for the ethfw can be found here : http://software-dl.ti.com/jacinto7/esd/processor-sdk-rtos-jacinto7/latest/exports/docs/ethfw/docs/user_guide/index.html

    I wanted to know how to integrate ethernet related functions ( like sending and receiving data) in user applications for the A72 core

    In linux user space, you can directly write the socket applications and run them to send data.

    File - soc_send.c 

    #include <sys/socket.h>
    #include <netinet/in.h>
    #include <arpa/inet.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <unistd.h>
    #include <errno.h>
    #include <string.h>
    #include <sys/types.h>
    
    int main()
    {
        int listenfd = 0, client_sock = 0;
        struct sockaddr_in serv_addr; 
        uint32_t n;
    
        char buf[65];
        listenfd = socket(AF_INET, SOCK_STREAM, 0);
        memset(&serv_addr, '0', sizeof(serv_addr));
    
        serv_addr.sin_family = AF_INET;
        serv_addr.sin_addr.s_addr = htonl(INADDR_ANY);
        serv_addr.sin_port = htons(5005); 
    
        bind(listenfd, (struct sockaddr*)&serv_addr, sizeof(serv_addr)); 
    
        listen(listenfd, 10); 
    
        while(1)
        {
            client_sock = accept(listenfd, (struct sockaddr*)NULL, NULL); 
            printf("Client Socket Found...");
            sprintf(buf,"Socket Application Working");
            printf("Sending data : %s(%ld)\n", buf, strlen(buf));
            n = send(client_sock, buf, strlen(buf), 0);
            if (n == -1) {
                printf("*******Error Sending Data*********\n");
                break;
            }
    
        }
    }

    File - receive.c

    #include <sys/socket.h>
    #include <sys/types.h>
    #include <netinet/in.h>
    #include <netdb.h>
    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>
    #include <unistd.h>
    #include <errno.h>
    #include <arpa/inet.h> 
    
    int main(int argc, char *argv[])
    {
        int sockfd = 0, n = 0;
        char recvBuff[65];
        struct sockaddr_in serv_addr; 
    
        if(argc != 2)
        {
            printf("\n Usage: %s <ip of server> \n",argv[0]);
            return 1;
        } 
    
        memset(recvBuff, '0',sizeof(recvBuff));
        if((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
        {
            printf("\n Error : Could not create socket \n");
            return 1;
        } 
    
        memset(&serv_addr, '0', sizeof(serv_addr)); 
    
        serv_addr.sin_family = AF_INET;
        serv_addr.sin_port = htons(5005); 
        serv_addr.sin_addr.s_addr = inet_addr(argv[1]);
    
    
        if( connect(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0)
        {
           printf("\n Error : Connect Failed \n");
           return 1;
        }
    
        n = recv(sockfd, recvBuff, 65, 0);
        recvBuff[n] = 0;
    
        if(n < 0)
        {
            printf("\n Read error \n");
        } 
        else printf("Data Received : %s\n", recvBuff);
    
        return 0;
    }

    To get you started, I have provided you with an example application. soc_send.c to be complied and run on A72 and receive.c to be run on your host pc with ip address of board as an argument (assign ip address to a link with ifconfig first).

    Regards,

    Tanmay

  • Thank you for the response and the example application. This was very helpful. 

  • Thank you   . I wanted to know the definitions of the functions/api like socket, bind and listen and in which files I can find as I am unable to understand what exactly these functions/api do . Is this link correct : NDK Stack Documentation: src/stack/fdt/socket.c File Reference ?

    Thank you .Regards

    Meghant Acharya 

  • Hi Meghant,

    These are common linux socket application functions. You can google them. They all even have man pages on any linux distribution.

    you can see here (https://www.tutorialspoint.com/unix_sockets/socket_core_functions.htm) for starters.

    This is the implementation in NDK to run socket applications in RTOS. This is not something you will be using in linux user space.

    Regards,

    Tanmay

  • Thank you  for the response .

  • Thank you @Tanmay Patil for your response . Apologies for asking too many questions .I wanted to know about the virtual net driver for A72 core. Is it same to this socket application or is it different ?. Thank you .

  • Hi Meghant,

    The socket applications are user space code. The virtual net driver is something which runs below it. They are different.

    you can see this(https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-jacinto7/08_00_00_08/exports/docs/linux/Foundational_Components/Kernel/Kernel_Drivers/Network/CPSWng_virt_mac.html) for more information.

    Regards,

    Tanmay

  • Thank you for your response .

  • Hi Meghant,

    But in one of your above answers you mentioned that default bootlflow loads ethfw in MCU DOMAIN R50_0

    Sorry, it was incorrect. It should be MAIN DOMAIN R50_0. I have edited the response above.

    As per my understanding the ethfw is used to configure the CPSW9G in MAIN DOMAIN. After configuring that , we can use the linux socket applications to send/receive data. Is my understanding correct?

    This is correct.

    Also I wanted to ask that is it possible to access ethernet in both MCU DOMAIN R5 and MAIN DOMAIN A72 .  Please Suggest

    It is possible to access ethernet in any core, but you cannot access CPSW9g switch. That is only accesible from ethfw. To access ethernet on a core, you have run a ethfw_client application on the OS of that core.

    Regards,

    Tanmay

  • Thank you  for the response. So you are saying that it is possible to access ethernet simultaneously in MCU DOMAIN R5 using CPSW2G and MAIN DOAMIN A72 core using CPSW9G ? Thanks. Is there any procedure to follow to configure for both switches ? Thanks  

  • Hi Meghant,

    So you are saying that it is possible to access ethernet simultaneously in MCU DOMAIN R5 using CPSW2G and MAIN DOAMIN A72 core using CPSW9G

    Yes, it is possible.

    Is there any procedure to follow to configure for both switches ? Thanks  

    CPSW2G switch can be run from MCU Domain R5 using the enet examples from PDK or MCUSW (I suggest for you to try these standalone examples first to make sure they are working). You can load them on the cores by using remoteproc while linux is booting up. I am not very sure about resource collisions that might ocuur. If they do occur, you might have to sort them out.

    Note- to load binaries via remoteproc, you can see this (https://software-dl.ti.com/jacinto7/esd/processor-sdk-rtos-jacinto7/08_00_00_12/exports/docs/psdk_rtos/docs/user_guide/developer_notes_mcu1_0_sysfw.html#mcu1-0-loading-scenarios)

    Regards,

    Tanmay 

  • Thank you for your response. I wanted to know the difference between the Virtual mac for Eth ( MCUSW: Eth Virtual Mac User Guide (ti.com)) in MCUSW and the virtual net driver present in the ethfw. Can we use this virtual mac in MCUSW for A72 ? Thanks .

  • Hello, 

    A gentle reminder for reply to this query . 

    Thank you .

  • Hi Meghant,

    I wanted to know the difference between the Virtual mac for Eth ( MCUSW: Eth Virtual Mac User Guide (ti.com)) in MCUSW and the virtual net driver present in the ethfw

    The mcusw virtual mac for eth module is AUTOSAR compliant. The virtual net driver is not there in ethfw, it is present in linux and is a linux compliant driver. Both of them are quite different.

    Can we use this virtual mac in MCUSW for A72 ?

    I have to check weather a standalone case is possible, but you can't use it along with linux.

    Anyway, may I know why you want to use mcusw virtual mac driver for A72?

    Regards,

    Tanmay

  • I cam across in the documentation and was unable to understand whether the mcusw virtual mac is applicable or not . That is the reason for the query . Thank you for the response

  • Thank you for response .I am trying to follow the site 3.2.2.9. CPSWng virtual MAC (remoteproc) — Processor SDK Linux for J721e Documentation . And trying to enable driver and user interface. After writing the socket applications how to integrate it into the processor sdk Linux .Thank you  

  • Hi Meghant,

    After you write the socket applications, copy them to the /home/root/ of the SD card.

    Then compile them using gcc as you would do on a normal linux PC and a executable will be generated. 

    Regards,

    Tanmay