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.

TMDS273GPEVM: TMDS273GPEVM Ethernet Communication between two ECUs Demo Example

Part Number: TMDS273GPEVM

Hello,

Does anyone know which Demo example we can use to test the Ethernet communication between 2 ECU's in the following SDK?

SDK : mcu_plus_sdk_am273x_08_05_00_24

EVM : TMDS273GPEVM 

  • Hi Sara,

    You can do the communication between the evm.

    If you are using two AM273 ECVM then please follow below steps

    You can run AM273x MCU+ SDK: Enet Lwip TCP Client Example (ti.com) on one EVM and  AM273x MCU+ SDK: Enet Lwip TCP Server Example (ti.com) this example and another EVM. Configure the IP address properly. You will be able to communicate between two evm.

    Let me know if you face any issue.

    BR

    Nilabh A.

  • Thanks very much for your reply.

    Could you please let us know if it is possible to configure the IP statically without using DHCP server  or home router ? and if yes , could you please refer us to the exact location in the code to configure the IP statically ?

    Thanks,

  • Yes you can do static IP setup:

    In the file: examples\networking\lwip\enet_cpsw_tcpserver\app_main.c

    1. Comment out DHCP setup function: App_allocateIPAddress();

    Next step is to give static ip :

    2. Replace function App_setupNetif(); with code below:

    static void App_setupNetif()
    {
         ip4_addr_t ipaddr, netmask, gw;
    
         ip4_addr_set_zero(&gw);
         ip4_addr_set_zero(&ipaddr);
         ip4_addr_set_zero(&netmask);
         
        LWIP_PORT_INIT_GW(&gw);
        LWIP_PORT_INIT_IPADDR(&ipaddr);
        LWIP_PORT_INIT_NETMASK(&netmask);
        DebugP_log("Starting lwIP, local interface IP is %s\r\n", ip4addr_ntoa(&ipaddr));
    
         for (uint32_t i = 0U; i < ENET_SYSCFG_NETIF_COUNT; i++)
         {
             /* Open the netif and get it populated*/
             LwipifEnetApp_netifOpen(NETIF_INST_ID0 + i, &ipaddr, &netmask, &gw);
             g_pNetif[NETIF_INST_ID0 + i] = LwipifEnetApp_getNetifFromId(NETIF_INST_ID0);
             netif_set_status_callback(g_pNetif[NETIF_INST_ID0 + i], App_netifStatusChangeCb);
             netif_set_link_callback(g_pNetif[NETIF_INST_ID0 + i], App_netifLinkChangeCb);
             netif_set_up(g_pNetif[NETIF_INST_ID0 + i]);
        }
        LwipifEnetApp_startSchedule(g_pNetif[ENET_SYSCFG_DEFAULT_NETIF_IDX]);
    }

    3. In the same file in section below add following lines of code

    /* ========================================================================== */
    /*                           Macros & Typedefs                                */
    /* ========================================================================== */
    #define LWIP_PORT_INIT_IPADDR(addr)   IP4_ADDR((addr), 192,168,1,200)
    #define LWIP_PORT_INIT_GW(addr)       IP4_ADDR((addr), 192,168,1,1)
    #define LWIP_PORT_INIT_NETMASK(addr)  IP4_ADDR((addr), 255,255,255,0)
    You can modify IP address as per your wish.
    This same change needs to be done for both the examples. Let me know if you face any issue.
    BR
    Nilabh A.
  • Thanks very much for your reply , This is very clear 

    We could able to make a communication between the ECU and the PC but it is still not working between he two ECUs

    We have applied the mentioned steps as in the ticket in both examples (TCP_Client/TCP_Server)
    But whenever the connection is started it gives this message (Port1: Link Down) and connection is closed as shown in attached image.

    1. Could you please confirm that we should apply the mentioned steps in both examples without changes?
    2. Do we miss any other configurations ?

     We just need to highlight that we used connection from ecu to ecu without pc connection and using static ip allocation not dhcp .

    Thanks,

  • Hi Sara,

    Can you explain what steps you followed for loading the binaries on both evm.

    This is happening because the two evm are connected even before application starts on both. Say for example you load binary on one evm and run it(while your second evm is powered on) next you load binary on second evm. Once the application starts on second evm it does phy reset which will show on first evm as link down and then again it will come as link up.

    Now can you please tell me if you are able to communicate properly after those prints?

  • Hello Anand,

    Thanks for your reply,

    Everything is working good now,

    Thanks,