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-AM57X: PRU Ethernet dual switch issue

Part Number: PROCESSOR-SDK-AM57X
Other Parts Discussed in Thread: AM5726

Hello

I'm using AM572x IDK board with TI-RTOS SDK 06.01 and I have a problem when two pairs of PRU-ICSS cores work in switch mode.

I cannot see packets (such as ICMP (from ping utility)), that were received from PRU2.1 port.

When I plug an ethernet cable from my PC to the board J8 connector, I cannot see software link interrupts (ICSS_EmacLinkISR function call), but the connector LED works fine.

But all work, when I plug cable to J6 connector on IDK board.

Also all work, when I plug cable to J3 (PRU1.0) or J5 (PRU1.1) connector on IDK board.

Also, if I change the PRU init sequence, all works successful on PRU2 and PRU1.0, but I have the same problem on PRU1.1 (J5 connector).

To change PRU init sequence (init PRU2 and then PRU1), you need to swap lines 191 and 197 in file net_init_api.c.

That looks like a bug with the last inited PRU core (and not the bug in my pinmux file).

To reproduce that I made a test project:

switch_test_host.zip

Some notes about test project:

  • In that project BOARD_INIT_PINMUX_CONFIG define was disabled for Board_init call. You need to init all required pin muxes in MLO.
  • IP address to first inited PRU pair is 192.168.7.4/24 (PRU1 by default).
  • IP address to second inited PRU pair is 192.168.4.4/24 (PRU2 by default).
  • Default gateway IP address is 192.168.1.1.
  • You need to select PRU1 connectors J3 and J5 instead of gigabit J10 and J12 (by resistors soldering, for example).

What can I do to fix that?

My working environment: Ubuntu 16.04.6 x64 (LTS), CCS 9.1.0, TI-RTOS SDK 06.01.

With regards,
Alex

  • Hi Alex,

    Have you tried the ICSS_EMAC_SwitchExample_idkAM572x_wSoCFile_armTestproject or the ICSS_EMAC_SwitchExample_idkAM572x_wSoCLib_armTestproject in the Processor SDK RTOS 6.1.0 on the idkAM572x?

    Ming

  • Hi Ming,

    Yes, I was written my project based on ICSS_EMAC_SwitchExample_idkAM572x_wSoCFile_armTestproject project.

    Original project works on PRU2 only (for my board).

    But I need to use PRU1 switch pair and PRU2 switch pair together.

    With regards,
    Alex

  • Hi Alex,

    According the "6.1 100Mb Ethernet Ports on PRU-ICSS Table 4" of AM572x IDK  Hardware Guide (http://www.ti.com/lit/ug/sprui64e/sprui64e.pdf), J3 PRU1ETH0, (0x0 on PRU1) and J5 PRU1ETH1 (0x1 on PRU1) are not available in default configuration. MII pins multiplexed with RGMII0 and RGMII1. You will need to change the pinmux to make it work.

    Ming

  • Hello Ming,

    Yes, you are right, and that requirements have been already done.

    As you can see in my problem description, PRU1ETH0 and PRU1ETH1 work fine in my example project.

    I have problems with PRU2ETH1 port link detection (PRU2ETH0 also works fine).

    Also, all pinmux configuration must be applied in SBL (MLO file), because of code & hardware compatibility.

    With regards,
    Alex

  • Hi Alex,

    I noticed that the ICSS_EMAC_SwitchExample_idkAM572x_wSocFile_armTestproject is using the following set up for PRU2_0:

    icss_emacTestInitCfg0->rxIntNum = CSL_armGicGetGicIdForIrqInputLine(137);

    icss_emacTestInitCfg0->linkIntNum=CSL_armGicGetGicIdForIrqInputLine(127);

    icss_emacTestInitCfg0->txIntNum = CSL_armGicGetGicIdForIrqInputLine(129);

    in your switch_test_host is using the following set up for PRU2_0:

    // pru 1 <-- this looks like a typo, because the pru_index is 0 for PRU1

    switchEmacCfg->linkIntNum=CSL_armGicGetGicIdForIrqInputLine(81);

    switchEmacCfg->rxIntNum = CSL_armGicGetGicIdForIrqInputLine(82);

    switchEmacCfg->txIntNum=CSL_armGicGetGicIdForIrqInputLine(143);

    If you are using the idkAM572x, then the above should be the same as the ICSS_EMAC_SwitchExample_idkAM572x_wSocFile_armTestproject.

    Ming

     

  • Hi Ming,

    I changed my Net_interruptInit function as you suggest. Now it looks that:

    void Net_interruptInit(ICSS_EmacInitConfig* switchEmacCfg, uint32_t pru_index)
    {
        if (!pru_index)
        {
            //pru 1
            CSL_xbarMpuIrqConfigure(CSL_XBAR_INST_MPU_IRQ_81, CSL_XBAR_PRUSS1_IRQ_HOST8);  /* link ISR */
            CSL_xbarMpuIrqConfigure(CSL_XBAR_INST_MPU_IRQ_82, CSL_XBAR_PRUSS1_IRQ_HOST2);  /* RX PKT ISR */
            CSL_xbarMpuIrqConfigure(CSL_XBAR_INST_MPU_IRQ_143, CSL_XBAR_PRUSS1_IRQ_HOST4);  /* TX PKT ISR */
            switchEmacCfg->linkIntNum=CSL_armGicGetGicIdForIrqInputLine(81);
            switchEmacCfg->rxIntNum = CSL_armGicGetGicIdForIrqInputLine(82);
            switchEmacCfg->txIntNum=CSL_armGicGetGicIdForIrqInputLine(143);
        }
        else
        {
            //pru 2
            CSL_xbarMpuIrqConfigure(CSL_XBAR_INST_MPU_IRQ_127, CSL_XBAR_PRUSS2_IRQ_HOST8);  /* link ISR */
            CSL_xbarMpuIrqConfigure(CSL_XBAR_INST_MPU_IRQ_137, CSL_XBAR_PRUSS2_IRQ_HOST2);  /* RX PKT ISR */
            CSL_xbarMpuIrqConfigure(CSL_XBAR_INST_MPU_IRQ_129, CSL_XBAR_PRUSS2_IRQ_HOST4);  /* TX PKT ISR */
            switchEmacCfg->linkIntNum=CSL_armGicGetGicIdForIrqInputLine(127);
            switchEmacCfg->rxIntNum = CSL_armGicGetGicIdForIrqInputLine(137);
            switchEmacCfg->txIntNum=CSL_armGicGetGicIdForIrqInputLine(129);
        }
    }

    After that changes were made, project behavior was not changed.

    Sorry, but you are not right about the typo. Because that function receives:

    • pru_index = 0 for PRU1
    • pru_index = 1 for PRU2

    With regards,
    Alex

  • Hi Alex,

    I think it should be the following:

    void Net_interruptInit(ICSS_EmacInitConfig* switchEmacCfg, uint32_t pru_index)
    {
        if (pru_index==0)
        {
            //pru 1
            CSL_xbarMpuIrqConfigure(CSL_XBAR_INST_MPU_IRQ_81, CSL_XBAR_PRUSS1_IRQ_HOST8);  /* link ISR */
            CSL_xbarMpuIrqConfigure(CSL_XBAR_INST_MPU_IRQ_82, CSL_XBAR_PRUSS1_IRQ_HOST2);  /* RX PKT ISR */
            CSL_xbarMpuIrqConfigure(CSL_XBAR_INST_MPU_IRQ_143, CSL_XBAR_PRUSS1_IRQ_HOST4);  /* TX PKT ISR */
            switchEmacCfg->linkIntNum=CSL_armGicGetGicIdForIrqInputLine(81);
            switchEmacCfg->rxIntNum = CSL_armGicGetGicIdForIrqInputLine(82);
            switchEmacCfg->txIntNum=CSL_armGicGetGicIdForIrqInputLine(143);
        }
        else
        {
            //pru 2
            CSL_xbarMpuIrqConfigure(CSL_XBAR_INST_MPU_IRQ_127, CSL_XBAR_PRUSS2_IRQ_HOST8);  /* link ISR */
            CSL_xbarMpuIrqConfigure(CSL_XBAR_INST_MPU_IRQ_137, CSL_XBAR_PRUSS2_IRQ_HOST2);  /* RX PKT ISR */
            CSL_xbarMpuIrqConfigure(CSL_XBAR_INST_MPU_IRQ_129, CSL_XBAR_PRUSS2_IRQ_HOST4);  /* TX PKT ISR */
            switchEmacCfg->linkIntNum=CSL_armGicGetGicIdForIrqInputLine(127);
            switchEmacCfg->rxIntNum = CSL_armGicGetGicIdForIrqInputLine(137);
            switchEmacCfg->txIntNum=CSL_armGicGetGicIdForIrqInputLine(129);
        }
    }
    Best regards,
    Ming
  • Hi Ming,

    I did as you say, but that wasn't helped.

    With regards,
    Alex

  • Hi Alex,

    I thought the original example(ICSS_EMAC_SwitchExample_idkAM572x_wSoCFile_armTestproject project) from the Processor SDK RTOS for AM57xx works for PRU2ETH0 and PRU2ETH1. What changes you have been made to the sbl on pinmux. Would you mind send us the pinmux changes you made for Board Library?

    Ming

  • Hi Ming,

    First of all, I reproduced that issue on default pinmux without any PDK changes (yes, PRU1ETHx cores will not work too).

    To fix PRU1ETHx working, you can use that files:

    pdk_diff.zip

    You need to generate board* files from pinmux tool & apply board patch with that line:

    patch pdk_am57xx_1_0_16/packages/ti/board/src/idkAM572x/idkAM572x_ethernet_config.c < idkAM572x_ethernet_config.c.dif

    All required files are located in pdk_diff.zip

    With regards,
    Alex

  • Alex,

    It's not straight forward to enable 4 PRU emac ports on AM572x IDK. 

    Would it be possible for you to switch to AM571x IDK since you could have 4 ICSS ENET ports plus 2 CPSW ENET ports simultaneously.  This is enabled from a jumper and we can provide a pinmux file for this configuration.

    Regards,
    Garrett

  • Garrett,

    Sorry, but I have only AM572x IDK board. And I need to use AM572x SoC (for custom board with AM5726).

    With regards,
    Alex

  • Hello Garrett

    What about my problem? Do you have some news?

    With regards,
    Alex

  • Alex,

    I don't have an modified IDK board for enabling the 4-port EMAC ports to replicate your issue. Where did you get the instruction or guidance of hardware/pinmux modification?

    Regards,
    Garrett

  • Garrett,

    I created my project as an analog of example.

    Garrett Ding said:
    Where did you get the instruction or guidance of hardware/pinmux modification?

    I saw the board schematic file with a pinmux tool and found & fix pin conflicts.

    ATTENTION: you CAN reproduce that bug WITHOUT any IDK hardware upgrades. You need to use that project (WITHOUT removing initialization of PRU1.x cores).

    Also, you can try to reproduce it on any of the similar boards. As I know, my project is board-independent.

    With regards,
    Alex

  • Hello,

    Do you have some news about my problem?

    With regards,
    Alex

  • Alex,

    I did try your test project, but didn't see the LED on from J8 whereas the default ICSS_EMAC_SwitchExample_idkAM572x_wSoCFile_armTestproject works fine when I plug an ethernet cable from my PC. I could not ping both ports (J6/J8) ...

    We have a Ethernet/IP industrial sw with the switch logic integrated, and support TCP/IP which you may have a try. I am not sure if this help or actually distract you...

    http://software-dl.ti.com/processor-industrial-sw/esd/PRU-ICSS-ETHERNETIP-ADAPTER/latest/index_FDS.html

    http://software-dl.ti.com/processor-industrial-sw/esd/docs/indsw/ethernetIP_adapter/ethernetIP_adapter.html

    https://processors.wiki.ti.com/index.php/ICSS_EIP_Adapter_Developer_Guide

    Regards,

    Garrett

  • The steps required to create Stand alone switch application from Ethernet/IP application:

    Regards,

    Garrett

  • Garrett,

    Without hardware updating only PRU2ETHx interfaces have to work (and that's normally).

    But if you can see earlier, if you connect PRU2ETH1 connector to the board after starting (without connecting PRU2ETH0), it will not be detected & pinged.

    Also you mustn't start board with PRU2ETH0 connector already connected and mustn't disable PRU1ETHx interfaces initialization.

    What should I do to fix that? I don't need to use Ethernet/IP industrial SDK.

    With regards,
    Alex