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.

AM4372: EMAC loopback test

Part Number: AM4372

Dear Champs,

My customer is developing AM4372 board to communicate with 2 other boards, e.g. total 3 AM4372 boards will communicate each other using Ethernet, and wants to test both ports of CPSW using EMAC_BasicExample_skAM437x_armBiosExampleProject for it.They will not use UDP or RTP, but will use their own custom protocol. 

They changed 'port num' to '1' as below to test port1 in the EMAC_BasicExample_skAM437x_armBiosExample Project, but found system hang at emac_open(1, ...) call.

My questions are

1. Should they set CPSW as Dual MAC mode to test port1? if so, how they can set CPSW as Dual MAC mode?

2. or what should be modified to run port1 loopback test?

3. For their usecase - 3 boards communication each other - 1st and 2nd, 2nd and 3rd, 3rd and 1st boards, should they use dual mac mode? or switch mode can be used? they used UART before and they will use same scenario in the ethernet connection.

4. what is the meaning of 'port_num' in the EMAC API of TI-RTOS LLD?

5. what is the meaning of channels in the EMAC_CHAN_MAC_ADDR_tag Struct of LLD?

Their test environments are

AM4372 SK EVM and pdk_am437x_1_0_16.

Thanks and Best Regards,

SI.

  • Hi SI.

    One can only call EMAC_socGetInitCfg() with port num = 0 though you may use port 1. please see the function implementation.

    #define EMAC_NUM_MAX_MAC_PORTS 2U

    int32_t EMAC_socGetInitCfg(uint32_t port_num, EMAC_HwAttrs_V4 *cfg)
    {
        int32_t ret = 0;
    
        if (port_num  < EMAC_NUM_MAX_MAC_PORTS -1U)
        {
            *cfg = EMACInitCfg[port_num];
        }
        else
        {
            ret = -1;
        }
    
        return ret;
    }

    The CPSW switch example basically sends the dummy raw broadcast packets and verify if it's received/routed. Is the 3 board test for hardware verification? If so, maybe Processor SDK Linux can be used with dual mac config. If not, what does the custom protocol look like? 

    Regards,

    Garrett

  • Hi Garrett,

    This is not for hardware verification, but for real usecase. They have been used UART to communicate between boards and I think their custom protocol should be simple similar with UART.

    They will use RTOS - ThreadX - and can not use Linux as a OS.

    Could you please explain details what are 'port_num', 'channels'?

    Thanks and Best Regards,

    SI.

  • SI.

    You can refer to the NIMU dual mac example (NIMU_DualMacExample_idkAM572x_armExampleproject) to set up dual mac mode, which used the same emac driver used for am437x. With this example 2 IP interfaces are opened, one per port and then you can ping both ports. You can modify the example to try to sent the packets through the port to other device with his own protocol.

    The channel naming is probably originally from keystone device with CPPI architecture. You can consider it as mac unit, which is equal to port numbers in Sitara.

    Regards,

    Garrett