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.

AM5728: PRU EtherCAT driver stops receiving frames

Part Number: AM5728
Other Parts Discussed in Thread: SYSBIOS

We have an issue where our EtherCAT Master does not see any slaves because the PRU ICSS driver is stopping receiving frames after a ESD test until we reboot our target. 

Using WireShark we see that the EtherCAT Master is sending its messages successfully, it is getting the reply from the slaves but for some reason the EtherCAT Master application does not receive the reply and then returning 0 slave.

Prior to that the Master sees all slaves. Once we do the ESD test, it seems as the Master cannot receive any more ETherCAT frames although it sends frames successfully. This is not systematic but easily repeatable.

Rebooting the system is not acceptable for our application. After analysis, here the statistics that we have found:

it seems that after the reception of a bad CRC frame or a first misaligned frame, the PRU ICSS does not recover from it always receiving misaligned frames.

-- 120sec aSt:Idle nSl:7 TL: 0 3TL: 0 STL: 0--
txBcast: 239751 txMcast: 0 txUcast: 0 txOctets: 106407584 rxBcast: 239763 rxMcast: 0 rxUcast: 0 rxOctets: 106414344--
tx64byte: 82065 tx65_127byte: 1 tx128_255byte: 830 tx256_511byte: 78446 tx512_1023byte: 0 tx1024byte: 78449--
rx64byte: 82075 rx65_127byte: 1 rx128_255byte: 830 rx256_511byte: 78456 rx512_1023byte: 0 rx1024byte: 78459--
lateColl: 0 singleColl: 0 multiColl: 0 excessColl: 0 rxMisAlignmentFrames: 0 stormPrevCounter: 0 macRxError: 0 SFDError: 0 defTx: 0 macTxError: 0--
rxOverSizedFrames: 0 rxUnderSizedFrames: 0 rxCRCFrames: 0 droppedPackets: 0 txOverFlow: 0 txUnderFlow: 0 sqeTestError: 0 TXqueueLevel: 100 CSError: 4194305--

-- 125sec aSt:Idle nSl:7 TL: 0 3TL: 0 STL: 0--
txBcast: 254604 txMcast: 0 txUcast: 0 txOctets: 113101336 rxBcast: 254616 rxMcast: 0 rxUcast: 0 rxOctets: 113108096--
tx64byte: 87016 tx65_127byte: 1 tx128_255byte: 830 tx256_511byte: 83397 tx512_1023byte: 0 tx1024byte: 83400--
rx64byte: 87026 rx65_127byte: 1 rx128_255byte: 830 rx256_511byte: 83406 rx512_1023byte: 0 rx1024byte: 83410--
lateColl: 0 singleColl: 0 multiColl: 0 excessColl: 0 rxMisAlignmentFrames: 0 stormPrevCounter: 0 macRxError: 0 SFDError: 0 defTx: 0 macTxError: 0--
rxOverSizedFrames: 0 rxUnderSizedFrames: 0 rxCRCFrames: 0 droppedPackets: 0 txOverFlow: 0 txUnderFlow: 0 sqeTestError: 0 TXqueueLevel: 100 CSError: 4194305--

-- 130sec aSt:Idle nSl:7 TL: 0 3TL: 0 STL: 0--
txBcast: 269463 txMcast: 0 txUcast: 0 txOctets: 119797792 rxBcast: 269475 rxMcast: 0 rxUcast: 0 rxOctets: 119804552--
tx64byte: 91969 tx65_127byte: 1 tx128_255byte: 830 tx256_511byte: 88350 tx512_1023byte: 0 tx1024byte: 88353--
rx64byte: 91979 rx65_127byte: 1 rx128_255byte: 830 rx256_511byte: 88359 rx512_1023byte: 0 rx1024byte: 88363--
lateColl: 0 singleColl: 0 multiColl: 0 excessColl: 0 rxMisAlignmentFrames: 0 stormPrevCounter: 0 macRxError: 0 SFDError: 0 defTx: 0 macTxError: 0--
rxOverSizedFrames: 0 rxUnderSizedFrames: 0 rxCRCFrames: 0 droppedPackets: 0 txOverFlow: 0 txUnderFlow: 0 sqeTestError: 0 TXqueueLevel: 100 CSError: 4194305--

D: ECAT: master state change from 'Op' to 'Unknown' at 131655885
D: EthercatMaster: Unknown: Setting Ethercat Master State to Initialization at 131656358
D: ECATM: Req Master State From 'Unknown' to 'Init' at 131664020

-- 135sec aSt:Idle nSl:0 TL: 0 3TL: 0 STL: 0--
txBcast: 276385 txMcast: 0 txUcast: 0 txOctets: 122118766 rxBcast: 274323 rxMcast: 0 rxUcast: 0 rxOctets: 121985328--
tx64byte: 95640 tx65_127byte: 1 tx128_255byte: 833 tx256_511byte: 89957 tx512_1023byte: 0 tx1024byte: 89957--
rx64byte: 93580 rx65_127byte: 1 rx128_255byte: 830 rx256_511byte: 89956 rx512_1023byte: 0 rx1024byte: 89956--
lateColl: 0 singleColl: 0 multiColl: 0 excessColl: 0 rxMisAlignmentFrames: 2073 stormPrevCounter: 0 macRxError: 0 SFDError: 0 defTx: 0 macTxError: 0--
rxOverSizedFrames: 0 rxUnderSizedFrames: 0 rxCRCFrames: 1 droppedPackets: 0 txOverFlow: 0 txUnderFlow: 0 sqeTestError: 0 TXqueueLevel: 100 CSError: 4194305--
E: ECATM: Req Master State From 'Unknown' to 'Init' Failed at 135721777
D: ECATM: Req Master State From 'Unknown' to 'Init' at 136768452
E: ECATM: Req Master State From 'Unknown' to 'Init' Failed at 141063808

-- 140sec aSt:Fault SF: 0x00000004 nSl:0 TL: 0 3TL: 0 STL: 0--
txBcast: 278659 txMcast: 0 txUcast: 0 txOctets: 122264238 rxBcast: 274323 rxMcast: 0 rxUcast: 0 rxOctets: 121985328--
tx64byte: 97911 tx65_127byte: 1 tx128_255byte: 833 tx256_511byte: 89957 tx512_1023byte: 0 tx1024byte: 89957--
rx64byte: 93580 rx65_127byte: 1 rx128_255byte: 830 rx256_511byte: 89956 rx512_1023byte: 0 rx1024byte: 89956--
lateColl: 0 singleColl: 0 multiColl: 0 excessColl: 0 rxMisAlignmentFrames: 4336 stormPrevCounter: 0 macRxError: 0 SFDError: 0 defTx: 0 macTxError: 0--
rxOverSizedFrames: 0 rxUnderSizedFrames: 0 rxCRCFrames: 1 droppedPackets: 0 txOverFlow: 0 txUnderFlow: 0 sqeTestError: 0 TXqueueLevel: 100 CSError: 4194305--

-- 145sec aSt:Fault SF: 0x00000004 nSl:0 TL: 0 3TL: 0 STL: 0--
txBcast: 280616 txMcast: 0 txUcast: 0 txOctets: 122389486 rxBcast: 274323 rxMcast: 0 rxUcast: 0 rxOctets: 121985328--
tx64byte: 99868 tx65_127byte: 1 tx128_255byte: 833 tx256_511byte: 89957 tx512_1023byte: 0 tx1024byte: 89957--
rx64byte: 93580 rx65_127byte: 1 rx128_255byte: 830 rx256_511byte: 89956 rx512_1023byte: 0 rx1024byte: 89956--
lateColl: 0 singleColl: 0 multiColl: 0 excessColl: 0 rxMisAlignmentFrames: 6293 stormPrevCounter: 0 macRxError: 0 SFDError: 0 defTx: 0 macTxError: 0--
rxOverSizedFrames: 0 rxUnderSizedFrames: 0 rxCRCFrames: 1 droppedPackets: 0 txOverFlow: 0 txUnderFlow: 0 sqeTestError: 0 TXqueueLevel: 100 CSError: 4194305--

-- 150sec aSt:Fault SF: 0x00000004 nSl:0 TL: 0 3TL: 0 STL: 0--
txBcast: 282573 txMcast: 0 txUcast: 0 txOctets: 122514734 rxBcast: 274323 rxMcast: 0 rxUcast: 0 rxOctets: 121985328--
tx64byte: 101825 tx65_127byte: 1 tx128_255byte: 833 tx256_511byte: 89957 tx512_1023byte: 0 tx1024byte: 89957--
rx64byte: 93580 rx65_127byte: 1 rx128_255byte: 830 rx256_511byte: 89956 rx512_1023byte: 0 rx1024byte: 89956--
lateColl: 0 singleColl: 0 multiColl: 0 excessColl: 0 rxMisAlignmentFrames: 8250 stormPrevCounter: 0 macRxError: 0 SFDError: 0 defTx: 0 macTxError: 0--
rxOverSizedFrames: 0 rxUnderSizedFrames: 0 rxCRCFrames: 1 droppedPackets: 0 txOverFlow: 0 txUnderFlow: 0 sqeTestError: 0 TXqueueLevel: 100 CSError: 4194305--

So it seems that the problem is more TI related than EtherCAT related. 

What do you think? Is this a known issue? How can I address it?

I did test a solution that calls PRUICSS_pruDisable(), PRUICSS_pruReset(), PRUICSS_pruEnable() and then restart the master but it did not solve the issue (I tried only disable/enable and only reset and both).

Thanks,

     Sylvain

  • The RTOs team have been notified. They will respond here.
  • Hi Sylvain, which EtherCAT slave version are you using? also which master?
    thank you,
    Paula
  • Hi Paula,

    Why do you need EtherCAT version? The problem does not point toward EtherCAT but rather toward the PRU ICSS, so I do not understand why this information is relevant?

    Regards,

        Sylvain

  • Sylvain, The Ethercat version would help us to know PRU-ICSS Ethercat slave firmware build revision.
    On the other hand, have you checked if MDIO Alive and Link are correct? First thing is checking PHY is working correctly..

    thank you,
    Paula
  • Hi Paula,

        We are using the EtherCAT Master SOEM version cf76625f4caa3e7f6e9eb241797fdc8440c08fc0 from https://github.com/OpenEtherCATsociety/SOEM.

        For Ethernet Driver, we are using \ti\pdk_am57xx_1_0_5\packages and more specifically the ti\pdk_am57xx_1_0_5\packages\ti\drv\icss_emac.

       The PRU firmware is version:

    #include <ti/drv/icss_emac/firmware/am57x/v2_1/icss_emac_pru0_bin.h>
    #include <ti/drv/icss_emac/firmware/am57x/v2_1/icss_emac_pru1_bin.h>
    #define PRU0_FIRMWARE_NAME PRU0_FIRMWARE // name of the C struct in PRU header file
    #define PRU1_FIRMWARE_NAME PRU1_FIRMWARE // name of the C struct in PRU header file

        What is worrying me is that the statistics rxMisAlignmentFrames and rxCRCFrames seems to be updated by the hardware not the driver. So it seems that we gonna need a work around so either the MAC or the PHY get out of the misalignment problem.

    Moreover the statistics is defined as untested at http://processors.wiki.ti.com/index.php/ICSS_EMAC_LLD_developers_guide:

    rxMisAlignmentFrames Number of frames with uneven number of bytes in an octet

    (This is not tested)

          To summarize, the problem is seem on the EtherCAT Master only, no EtherCAT slave did have such behavior. When the problem is observed, the transmission path is working fine on the EtherCAT Master but all Ethernet frames received by the PRU ICSS EMAC of the EtherCAT Master are reported as misaligned although WireShark report them as well formed. 

    Regards,

           Sylvain

  • Hi Sylvain, thanks for the summary, I will try to involve our icss_emac drv experts here.

    Paula

  • Sylvain, a quick question, are you using TI RTOS processor SDK or Linux Processor SDK?

    thank you,
    Paula
  • We are using TI RTOS processor SDK.

    Thanks,

       Sylvain

  • Sylvain, Could you please clarify (explain us) ESD test? Also, could you please share Wireshark logs?

    thank you,
    Paula
  • Hi Paula,

    The ESD Testing that we are doing is applying a 6 KVolts discharge on our aluminium shelf that interfere with the Ethernet communication. This can corrupt a frame on the Ethernet bus resulting in a bad CRC. Then for an unknown reason we get into a recurring RX Misaligned Problem.

    We did not record the Wireshark logs but if you really needs it we can redo the test and record them.

    Additional information we are using the DP83822 as Phy.

    Thanks,

    Sylvain
  • Hi Sylvain, Thanks for clarifying ESD test. Logs would be really helpful for our expert's further analysis.

    thank you,
    Paula
  • Hi Paula,

    I need some time to put up the setup again.

    But as I said the communication are complete and Wireshark is reporting that the slaves are responding as expected but the master does not receive the frames although they are seen by Wireshark.

    I would like to get some information about the RX Misaligned statistic. Why is it updated and what happen when such condition is seen, how the MAC or PHY recover from such condition.

    Thanks,

    Sylvain
  • Hi Paula,

       Here is the Wireshark trace, the problem happens around packet number 131462 or time 27.506645. After this point the Master transmits, the slave responds but the Master does see the reply.

    Regards,

           Sylvain

    RxMisalign.zip

  • Hi Paula,

    Also note that it is harder to reproduce the problem when using Wireshark since we need to go through a Smart Switch to mirror the packet toward WireShark. We also suspect that the exact frame that cause the problem might not be on the trace since the switch filters bad frames.

    Regards,

    Sylvain
  • Hi Sylvain, a quick question, are we sure Ethercat slave recovers OK after ESD test?, maybe we can try to connect it to another Ethercat master and see how it behaves.

    Also, do you have Redundancy enabled in your master? .. My thinking is that if we connect a redundancy cable to the other Master port (say ETH1), after ESD test, taking advantage fast detection >15us, we could see if the master and slave can keep working ok. If so, we will be sure, master stack and slave are working OK, and the issue would be focused on ETH0.

    thank you,
    Paula
  • Hi Paula, 

      Sylvain is not here today...

       What we have seen so far is that slaves recover and continue to send packets via ethernet (we see the Wireshark trace coming in and the packets look ok).  

    We do not have an easy way to add a second master.  It will require a change in our PCB...

    What can we do with the current setup to troubleshoot the problem?

    Thanks for your help!

    Jean-Michel Audet

  • Hi Jean-Michel, thanks for your reply. I understand if it is not easy to add a second EtherCAT master or a redundancy test. We will work here in trying to reproduce the issue.

    thank you,
    Paula
  • Hi, I was going in the log file (PCAP file) and here is some fact that we can see:

    At line 131470 for exmaple, an ethernet packet is sent by the master (Re. Private_01:01:01) and then, you can see the answer back from the slave comming back (When WC is set to 7, it means that all 7 slaves have contribute to the answer back).
    The master send a Ethercat BRD packet as a broadcast keep alive packet. The slave always answer, but for some reason, the Master does not send command but resentd a broadcast keep alive packet. The only way this can happen is if the master (on the driver side) does not receive the answer back. It match the behaviour that we see by the disalignment, meaning that the packet is dropped.

    I hope this help!
    JM
  • Hi Sylvain, and Jean-Michel, I was able to reproduce the issue using a home-made packet generator, which can generate pkts with odd nibbles and a slightly modified version of our PRU-ICSS EMAC loopback demo (from PDK1.0.5).

    I opened a JIRA so our PRU ICSS EMAC experts can confirm and generate a fix. I will keep you post it.

    thank you,
    Paula
  • Hi Paula,

        Great news, as soon as you have an idea on when we can expect a fix it would be great because we have a lot of pressure here to solve this issue as soon as possible without an hardware change.

        If there anything more we can do to help you then let us know.

    Thanks,

        Sylvain

  • Hi Sylvain, I tested  latest published in TI.com  PSDK 4.0.0.4. And, I get RX misalignment  when using “odd nibble pkts”. However, RX callback functions works OK. Could you please use this PSDK which includes PDK 1.0.7 and let me know your observations after applying ESD test?.

    thank you,

    Paula

  • Hi Paula,

        I download the package, just to make sure, the package is dated 06 26 2017, is this correct?

        From the package installed, I just need to use the am57xx PDK version 1.0.7 rather than the 1.0.5 that we are using now?

        I will start testing soon.

    Thanks,

              Sylvain

  • Hi Sylvain, please install all the tools in the PSDK 4.0.0.4 package. EDMA, NDK, etc, as they are different from previous one, and no sure which other tools are you project using, but, please keep in mind PDK1.0.7 was developed/tested with tools versions from PSDK 4.0.0.4.

    thank you,
    Paula
  • Hi Paula,

    From our point of view, this is a lot of change for the current stage of the project. I will tried using only PDK 1.0.7 unless there are known problems doing so.

    Thanks,

    Sylvain
  • Hi Paula,

    This will be longer then I though there are some changes in the API from 1.0.5 to 1.0.7. I did not make a clean build the first time and I did not see the changes...

    Sylvain
  • Hi Sylvain, you are correct, they are API changes from PDK 1.0.5 to 1.0.7. Some porting effort is required.

    Thank you,

    Paula

  • Hi Paula,

      We did reproduce the problem using the latest SDK, NDK and BIOS, what about you?

    -- 160sec aSt:Servoing  nSl:7 TL: 0 3TL: 0 STL: 0--
     txBcast: 300780 txMcast: 0 txUcast: 0 txOctets: 133945896 rxBcast: 300891 rxMcast: 0 rxUcast: 0 rxOctets: 133994568--
     tx64byte: 102470 tx65_127byte: 1 tx128_255byte: 830 tx256_511byte: 98889 tx512_1023byte: 0 tx1024byte: 98914--
     rx64byte: 102543 rx65_127byte: 1 rx128_255byte: 830 rx256_511byte: 98960 rx512_1023byte: 0 rx1024byte: 98986--
     lateColl: 0 singleColl: 0 multiColl: 0 excessColl: 0 rxMisAlignmentFrames: 0 stormPrevCounter: 0 macRxError: 0 SFDError: 0 defTx: 0 macTxError: 0--
     rxOverSizedFrames: 0 rxUnderSizedFrames: 0 rxCRCFrames: 0 droppedPackets: 0 txOverFlow: 0 txUnderFlow: 0 sqeTestError: 0 TXqueueLevel: 0 CSError: 4194305--
    D: ECAT: master state change from 'Op' to 'Unknown' at 161555096
    D: EthercatMaster: Unknown: Setting Ethercat Master State to Initialization at 161620817
    D: ECATM: Req Master State From 'Unknown' to 'Init' at 161707766
    -- 165sec aSt:Servoing  nSl:0 TL: 0 3TL: 0 STL: 0--
     txBcast: 307396 txMcast: 0 txUcast: 0 txOctets: 136090574 rxBcast: 305310 rxMcast: 0 rxUcast: 0 rxOctets: 135953616--
     tx64byte: 106087 tx65_127byte: 1 tx128_255byte: 833 tx256_511byte: 100289 tx512_1023byte: 0 tx1024byte: 100289--
     rx64byte: 103903 rx65_127byte: 1E: ECATM: Req Master State From 'Unknown' to 'Init' Failed at 165811438
     rx128_255byte: 830 rx256_511byte: 100288 rx512_1023byte: 0 rx1024byte: 100288--
     lateColl: 0 singleColl: 0 multiColl: 0 excessColl: 0 rxMisAlignmentFrames: 2308 stormPrevCounter: 0 macRxError: 0 SFDError: 0 defTx: 0 macTxError: 0--
     rxOverSizedFrames: 0 rxUnderSizedFrames: 0 rxCRCFrames: 1 droppedPackets: 0 txOverFlow: 0 txUnderFlow: 0 sqeTestError: 0 TXqueueLevel: 0 CSError: 4194305--
    D: ECATM: Req Master State From 'Unknown' to 'Init' at 166677275
    E: ECATM: Req Master State From 'Unknown' to 'Init' Failed at 171034435
    -- 170sec aSt:Fault  SF: 0x00000004 SW: 0x00000001 nSl:0 TL: 0 3TL: 0 STL: 0--
     txBcast: 309243 txMcast: 0 txUcast: 0 txOctets: 136206734 rxBcast: 305310 rxMcast: 0 rxUcast: 0 rxOctets: 135953616--
     tx64byte: 107831 tx65_127byte: 1 tx128_255byte: 833 tx256_511byte: 100289 tx512_1023byte: 0 tx1024byte: 100289--
     rx64byte: 103903 rx65_127byte: 1 rx128_255byte: 830 rx256_511byte: 100288 rx512_1023byte: 0 rx1024byte: 100288--
     lateColl: 0 singleColl: 0 multiColl: 0 excessColl: 0 rxMisAlignmentFrames: 3933 stormPrevCounter: 0 macRxError: 0 SFDError: 0 defTx: 0 macTxError: 0--
     rxOverSizedFrames: 0 rxUnderSizedFrames: 0 rxCRCFrames: 1 droppedPackets: 0 txOverFlow: 0 txUnderFlow: 0 sqeTestError: 0 TXqueueLevel: 0 CSError: 4194305--

    Does this package include a new binary for the PRU?

    Regards,

          Sylvain

  • Hi Sylvain, with old PDK 1.0.5, if I send 'odd nibble' pkts I never reach back RX callback functions. With latest PDK 1.0.7 even with 'odd nibble' pkts I reach RX callback functions. That was the main difference.

    About PRU firmware binary, between PDK 1.0.5 and PDK 1.0.7 should be some changes, however, I got a PRU firmware binary from our developers with a potential fix, please see attached zip file. This fix goes on top of PDK1.0.7

    Path: C:\TI\pdk_am57xx_1_0_7\packages\ti\drv\icss_emac\firmware\icss_dualemac\bin

    When testing this firmware bin on top of PDK1.0.7, I am getting similar results as without them in my test setup, that was the reason I wanted you tested first the original PDK 1.0.7 firmware binaries.

    In any case, please use attached and let me know if your master can get RX packets after your ESD test

    Firmware_iccs_dualemac_PDK_1_0_7_potentialRXmisalignFix_bin.zip

    thank you,

    Paula

  • Hi Paula,

    We are using C:\TI\pdk_am57xx_1_0_7\packages\ti\drv\icss_emac\firmware\am57x\bin, can you send me this binary.

    #include <ti/drv/icss_emac/firmware/am57x/v1_0/icss_emac_pru0_bin.h>
    #include <ti/drv/icss_emac/firmware/am57x/v1_0/icss_emac_pru1_bin.h>
    #define PRU0_FIRMWARE_V1_0_NAME PRU0_FIRMWARE_V1_0 // name of the C struct in PRU header file
    #define PRU1_FIRMWARE_V1_1_NAME PRU1_FIRMWARE_V1_0 // name of the C struct in PRU header file

    #include <ti/drv/icss_emac/firmware/am57x/v2_1/icss_emac_pru0_bin.h>
    #include <ti/drv/icss_emac/firmware/am57x/v2_1/icss_emac_pru1_bin.h>
    #define PRU0_FIRMWARE_NAME PRU0_FIRMWARE // name of the C struct in PRU header file
    #define PRU1_FIRMWARE_NAME PRU1_FIRMWARE // name of the C struct in PRU header file

    Thanks,

    Sylvain
  • Hi Sylvain, please see SDK RTOS Migration Guide 

    From there we have: "ICSS EMAC driver component includes source code support for Dual-emac firmware with support for rebuilding. Firmware is no longer supported as header format *.h.In order to align to PRUSS compiler. Additional details for updated firmware binaries are available here"

    You can use Loopback test CCS project as an example. For creating loopback test run pdksetupenv.bat, and pdkProjectCreate.bat

    >pdkProjectCreate.bat AM572x idkAM572x little icss_emac arm

    Also, I re-run my test with Firmware fix, below my observations:

    Test:

    1) Sending ARP packets to modified loopback test: RX received OK

    2) Sending ARP packets with 'odd nibble" to modified loopback test: RX doesn't get callbacks

    3) Sending ARP packets to modified loopback test: RX received OK

    Then, RX recovers OK when "normal packets" are received again.

    Note: for my test I modified loopback test so it doesn't compare Tx and Rx packets, plus few other modifications.

    Thank you,

    Paula

  • Hi Paula,

        Unfortunately, I cannot make the new PRU to work, I have upgraded the link and the version:

    <listOptionValue builtIn="false" value="PRODUCTS=com.ti.sdo.edma3:2.12.4;com.ti.rtsc.NDK:2.25.1.11;com.ti.rtsc.SYSBIOS:6.46.5.55;com.ti.pdk.am57xx:1.0.7;"/>

    <listOptionValue builtIn="false" value="${TI_PDK_INSTALL_DIR}/packages/ti/drv/icss_emac/firmware/icss_dualemac/bin/am572x/a15_0/REV2/icss_dualemac_PRU0.bin ${TI_PDK_INSTALL_DIR}/packages/ti/drv/icss_emac/firmware/icss_dualemac/bin/am572x/a15_0/REV2/icss_dualemac_PRU1.bin"/>

    And customized the initialization files as attached see new and old version.ICCSEmac.zip

    But the Ethernet driver does not transmit and receive frames.

    Can you review my modifications and help me identify what is missing for the port to PDK 1.0.7?

    Thanks,

        Sylvain

  • I did not customize the following file but could need to ICSSInit.zip

    Sylvain

  • Hi Sylvain, I will check the file  and compared with how loopback test do it (attached my main.c - w/ few modif as a reference). A couple of quick questions:

    - In a quick look I didn't see PRUICSS_pruWriteMemory(), do you load firmware in another file?

    - Are you getting any Link and Rx interrupts? if not could you check linkIntNum and rxIntNum are correct?

    If you haven't done it yet, I would suggest you create/build loopback test and step through "main.c" to see how PRU is setup and initialized there.

    4667.main.c
    /**
     * @file   main.c
     *
     * @brief  This file tests the ICSS-EMAC driver APIs
     */
    /*
     * Copyright (c) 2015-2017, Texas Instruments Incorporated
     * All rights reserved.
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions
     * are met:
     *
     * *  Redistributions of source code must retain the above copyright
     *    notice, this list of conditions and the following disclaimer.
     *
     * *  Redistributions in binary form must reproduce the above copyright
     *    notice, this list of conditions and the following disclaimer in the
     *    documentation and/or other materials provided with the distribution.
     *
     * *  Neither the name of Texas Instruments Incorporated nor the names of
     *    its contributors may be used to endorse or promote products derived
     *    from this software without specific prior written permission.
     *
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     *
    */
    
    #ifdef __LINUX_USER_SPACE
    #include <sys/mman.h>
    #include <unistd.h>
    #include "mmap_helper.h"
    #else
    #include <xdc/std.h>
    #endif
    
    #include <stdlib.h>
    #include <stdio.h>
    #include <string.h>
    #include <assert.h>
    
    #ifndef __LINUX_USER_SPACE
    #include <xdc/runtime/Error.h>
    #include <xdc/runtime/System.h>
    #include <xdc/runtime/knl/Cache.h>
    #include <ti/sysbios/BIOS.h>
    #include <ti/sysbios/knl/Task.h>
    #include <ti/sysbios/hal/Core.h>
    #endif
    
    #include <ti/csl/soc.h>
    #include <ti/csl/csl_armGicAux.h>
    
    #ifdef __LINUX_USER_SPACE
    /* ICSS EMAC  PHY address definitions */
    #define BOARD_ICSS_EMAC_PORT0_PHY_ADDR       (0U)
    #define BOARD_ICSS_EMAC_PORT1_PHY_ADDR       (1U)
    #else
    #include <ti/drv/uart/UART_stdio.h>
    #ifdef __JAILHOUSE_INMATE
    #include <ti/drv/uart/soc/UART_soc.h>
    #endif
    #include <ti/board/board.h>
    #endif
    
    #include <ti/drv/pruss/pruicss.h>
    #include <ti/drv/pruss/soc/pruicss_v1.h>
    
    
    #include <ti/drv/icss_emac/test/src/test_common_utils.h>
    
    #include <ti/drv/icss_emac/test/src/tiemac_pruss_intc_mapping.h>
    
    #ifdef __LINUX_USER_SPACE
    #ifdef SOC_AM572x
    #include <ti/drv/icss_emac/firmware/am57x/v1_0/icss_emac_pru0_bin.h>
    #include <ti/drv/icss_emac/firmware/am57x/v1_0/icss_emac_pru1_bin.h>
    #include <ti/csl/soc/am572x/src/csl_device_xbar.h>
    #define PRU0_FIRMWARE_V1_0_NAME      PRU0_FIRMWARE_V1_0        // name of the C struct in PRU header file for PG version 1.x
    #define PRU1_FIRMWARE_V1_1_NAME      PRU1_FIRMWARE_V1_0        // name of the C struct in PRU header file for PG versin 1.x
    
    #include <ti/drv/icss_emac/firmware/am57x/v2_1/icss_emac_pru0_bin.h>
    #include <ti/drv/icss_emac/firmware/am57x/v2_1/icss_emac_pru1_bin.h>
    #define PRU0_FIRMWARE_NAME      PRU0_FIRMWARE        // name of the C struct in PRU header file
    #define PRU1_FIRMWARE_NAME      PRU1_FIRMWARE        // name of the C struct in PRU header file
    #endif
    
    #ifdef SOC_AM571x
    #include <ti/drv/icss_emac/firmware/am57x/v2_1/icss_emac_pru0_bin.h>
    #include <ti/drv/icss_emac/firmware/am57x/v2_1/icss_emac_pru1_bin.h>
    #include <ti/csl/soc/am571x/src/csl_device_xbar.h>
    #define PRU0_FIRMWARE_NAME      PRU0_FIRMWARE        // name of the C struct in PRU header file
    #define PRU1_FIRMWARE_NAME      PRU1_FIRMWARE        // name of the C struct in PRU header file
    #endif
    #else
    #ifdef __JAILHOUSE_INMATE
    #include <ti/drv/icss_emac/firmware/am57x/v1_0/icss_emac_pru0_bin.h>
    #include <ti/drv/icss_emac/firmware/am57x/v1_0/icss_emac_pru1_bin.h>
    #include <ti/csl/soc/am572x/src/csl_device_xbar.h>
    #define PRU0_FIRMWARE_V1_0_NAME      PRU0_FIRMWARE_V1_0        // name of the C struct in PRU header file for PG version 1.x
    #define PRU1_FIRMWARE_V1_1_NAME      PRU1_FIRMWARE_V1_0        // name of the C struct in PRU header file for PG versin 1.x
    
    #include <ti/drv/icss_emac/firmware/am57x/v2_1/icss_emac_pru0_bin.h>
    #include <ti/drv/icss_emac/firmware/am57x/v2_1/icss_emac_pru1_bin.h>
    #define PRU0_FIRMWARE_NAME      PRU0_FIRMWARE        // name of the C struct in PRU header file
    #define PRU1_FIRMWARE_NAME      PRU1_FIRMWARE        // name of the C struct in PRU header file
    #else
    #include <ti/drv/icss_emac/test/src/fw_mem_section.h>
    #endif
    #endif
    
    #ifdef __LINUX_USER_SPACE
    static inline void linux_sleep_ms(unsigned long ms) {
        struct timespec ts;
        ts.tv_sec = (ms)/1000;
        ms = ms - ts.tv_sec*1000;
        ts.tv_nsec = (ms*1000000);
        nanosleep(&ts, NULL);
    }
    #define SLEEP(t) linux_sleep_ms(t)
    #define PRINT printf
    #else
    #define SLEEP Task_sleep
    #define PRINT UART_printf
    #endif
    
    extern uint8_t ICSS_EMAC_testPkt[];
    extern uint32_t ICSS_EMAC_testTotalPktRcvd;
    
    /* number of links which actually came up to test the interface */
    static uint32_t  ICSS_EMAC_testLinkUpCount = 0;
    
    
    
    #ifdef __LINUX_USER_SPACE
    extern tprussdrv *pruss_drv_handle;
    extern tprussdrv *pruss_drv_handle2;
    extern PRUICSS_HwAttrs linux_prussHwAttrs[PRUICCSS_INSTANCE_MAX-1];
    extern PRUICSS_V1_Object linux_prussObjects[PRUICCSS_INSTANCE_MAX-1];
    extern PRUICSS_Config linux_pruss_config[PRUICCSS_INSTANCE_MAX];
    
    pthread_t port0_rxTask_th, port0_txTask_th, port0_ttsCycTask_th, port0_linkTask_th,
              port1_rxTask_th, port1_txTask_th, port1_ttsCycTask_th, port1_linkTask_th,
              port2_rxTask_th, port2_txTask_th, port2_ttsCycTask_th, port2_linkTask_th,
              port3_rxTask_th, port3_txTask_th, port3_ttsCycTask_th, port3_linkTask_th;
    
    int eth0_rxIntNum = 0,
        eth0_txIntNum = 2,
        eth0_linkIntNum = 6,
        eth1_rxIntNum = 1,
        eth1_txIntNum = 3,
        eth1_linkIntNum = 7;
    #endif
    
    PRUICSS_Handle ICSS_EMAC_testPruIcssHandle1 = NULL;
    PRUICSS_Handle ICSS_EMAC_testPruIcssHandle2 = NULL;
    
    
    extern ICSS_EmacHandle ICSS_EMAC_testHandle;
    extern ICSS_EmacHandle ICSS_EMAC_testHandle1;
    extern ICSS_EmacHandle ICSS_EMAC_testHandle2;
    extern ICSS_EmacHandle ICSS_EMAC_testHandle3;
    
    
    extern uint8_t ICSS_EMAC_testLclMac[];
    extern uint8_t ICSS_EMAC_testLclMac1[];
    extern uint8_t ICSS_EMAC_testLclMac2[];
    extern uint8_t ICSS_EMAC_testLclMac3[];
    
    extern uint32_t ICSS_EMAC_testPacketRcvdPort0;
    extern uint32_t ICSS_EMAC_testPacketRcvdPort1;
    extern uint32_t ICSS_EMAC_testPacketRcvdPort2;
    extern uint32_t ICSS_EMAC_testPacketRcvdPort3;
    
    extern uint32_t ICSS_EMAC_testLinkIsrPru1Eth0;
    extern uint32_t ICSS_EMAC_testLinkIsrPru1Eth1;
    extern uint32_t ICSS_EMAC_testLinkIsrPru2Eth0;
    extern uint32_t ICSS_EMAC_testLinkIsrPru2Eth1;
    
    extern uint8_t    ICSS_EMAC_testTtsModePort1;
    extern uint8_t    ICSS_EMAC_testTtsModePort2;
    
    
    /* either idkAM572x or idkAM571x */
    uint8_t ICSS_EMAC_testEvmType = 0;
    
    /* PG version of EVM */
    uint32_t ICSS_EMAC_testPgVersion = 0;
    
    static uint32_t ICSS_EMAC_testPruInstance2Done = 0;
    
    /***********************************************************************/
    /* local functions declaration                                         */
    /***********************************************************************/
    
    /*
     *    ---task to initialize PRU---
     */
    #ifdef __LINUX_USER_SPACE
    void *ICSS_EMAC_testTaskPruss1(void *a0)
    #else
    Void ICSS_EMAC_testTaskPruss1(UArg a0, UArg a1)
    #endif
    {
        Uint8 firmwareLoad_done = FALSE;
        uint32_t count = 0;
        ICSS_EmacTxArgument txArgs;
        uint8_t ret = 0;
    
        memset(&txArgs, 0, sizeof(ICSS_EmacTxArgument));
    
        PRUICSS_pruDisable(ICSS_EMAC_testPruIcssHandle1, ICSS_EMAC_PORT_1-1);
        PRUICSS_pruDisable(ICSS_EMAC_testPruIcssHandle1, ICSS_EMAC_PORT_2-1);
        if(PRUICSS_pruWriteMemory(ICSS_EMAC_testPruIcssHandle1,PRU_ICSS_IRAM(0) ,0,
    #if defined(__LINUX_USER_SPACE) || defined(__JAILHOUSE_INMATE)
                              (uint32_t *) PRU0_FIRMWARE_NAME,
                              sizeof(PRU0_FIRMWARE_NAME)))
    #else
                              (uint32_t *) &pru_imem0_rev2_start,
                              &pru_imem0_rev2_end - &pru_imem0_rev2_start))
    #endif
        {
            if(PRUICSS_pruWriteMemory(ICSS_EMAC_testPruIcssHandle1,PRU_ICSS_IRAM(1) ,0,
    #if defined(__LINUX_USER_SPACE) || defined(__JAILHOUSE_INMATE)
                                  (uint32_t *) PRU1_FIRMWARE_NAME,
                                  sizeof(PRU1_FIRMWARE_NAME)))
    #else
                                  (uint32_t *) &pru_imem1_rev2_start,
                                  &pru_imem1_rev2_end - &pru_imem1_rev2_start))
    #endif
            {
                firmwareLoad_done = TRUE;
            }
        }
    
        if( firmwareLoad_done)
        {
            PRUICSS_pruEnable(ICSS_EMAC_testPruIcssHandle1, ICSS_EMAC_PORT_1-1);
            PRUICSS_pruEnable(ICSS_EMAC_testPruIcssHandle1, ICSS_EMAC_PORT_2-1);
    
            while (!ICSS_EMAC_testPruInstance2Done)
            {
                /*    Do not print during time sensitive TTS testing    */
                if(!(ICSS_EMAC_testTtsModePort1 || ICSS_EMAC_testTtsModePort2))
                {
                    PRINT("\nICSS_EMAC_testTaskPruss1: Waiting for PRU2 Test to complete before testing PRU1\n");
                }
                SLEEP(100);
            }
        
            if (!ICSS_EMAC_testLinkIsrPru1Eth0)
            {
                PRINT("ICSS_EMAC_testTaskPruss1: LINK IS DOWN,skipping PRU1 ETH0\n");
                
            }
            else
            {
                PRINT("ICSS_EMAC_testTaskPruss1: PRU1 ETH0: LINK IS UP, eth0 state: %d\n", ((ICSS_EmacObject*)ICSS_EMAC_testHandle->object)->linkStatus[0]);
        
                ICSS_EMAC_testPacketRcvdPort0 = 1;
        
                txArgs.icssEmacHandle = ICSS_EMAC_testHandle;
                txArgs.lengthOfPacket = ICSS_EMAC_TEST_PKT_SIZE;
                txArgs.portNumber = 1;
                txArgs.queuePriority = 3;
                txArgs.srcAddress = &ICSS_EMAC_testPkt[0];
            
               for (count=0;count < ICSS_EMAC_TEST_PKT_TX_COUNT;count++)
                {
                    if(((ICSS_EmacObject*)ICSS_EMAC_testHandle->object)->linkStatus[0] )
                    {
                        if(ICSS_EMAC_testPacketRcvdPort0 )
                        {
                            ICSS_EMAC_testPacketRcvdPort0 = 0;
                            ICSS_EmacTxPacket(&txArgs, NULL);
                            while(!ICSS_EMAC_testPacketRcvdPort0)
                            {
                                SLEEP(100);
                            }
                        }
                    }
                }
        
            /* update link up count */
            ICSS_EMAC_testLinkUpCount++;
            /* Verification on ETH1 for instance 1 only */
            }
            if (!ICSS_EMAC_testLinkIsrPru1Eth1)
            {
                PRINT("ICSS_EMAC_testTaskPruss1: LINK IS DOWN,skipping PRU1 ETH1\n");
            }
            else
            {
                PRINT("ICSS_EMAC_testTaskPruss1: PRU1 ETH1: LINK IS UP, eth0 state: %d\n", ((ICSS_EmacObject*)ICSS_EMAC_testHandle1->object)->linkStatus[0]);
            
                ICSS_EMAC_testPacketRcvdPort1 = 1;
            
                txArgs.icssEmacHandle = ICSS_EMAC_testHandle1;
                txArgs.lengthOfPacket = ICSS_EMAC_TEST_PKT_SIZE;
                txArgs.portNumber = 2;
                txArgs.queuePriority = 3;
                txArgs.srcAddress = &ICSS_EMAC_testPkt[0];
            
                for (count=0;count < ICSS_EMAC_TEST_PKT_TX_COUNT;count++)
                {
                    if(((ICSS_EmacObject*)ICSS_EMAC_testHandle1->object)->linkStatus[0] )
                    {
                        if(ICSS_EMAC_testPacketRcvdPort1 )
                        {
                            ICSS_EMAC_testPacketRcvdPort1 = 0;
                            ICSS_EmacTxPacket(&txArgs, NULL);
                            while(!ICSS_EMAC_testPacketRcvdPort1)
                            {
                                SLEEP(100);
                            }
                        }
                    }
                }
                ICSS_EMAC_testLinkUpCount++;
            }
            if(ICSS_EMAC_testEvmType == ICSS_EMAC_TEST_BOARD_IDKAM572x)
            {
                PRINT("ICSS_EMAC_testTaskPruss1: Skipping TTS Tests for PRUICSS Instance 1 for AM572x\n");
            }
            else
            {
                while(!ICSS_EMAC_testLinkIsrPru1Eth0 && !ICSS_EMAC_testLinkIsrPru1Eth1)
                {
                    PRINT("\nICSS_EMAC_testTaskPruss1: LINK IS DOWN, pluggin loopback cable for PRU1 ETH0 and PRU1 ETH1.\n");
                }
        
                PRINT("\n============================================================");
                PRINT("\nInitiating TTS tests on ICSS_EMAC_TEST_PRU1ETH0 and ICSS_EMAC_TEST_PRU1ETH1");
        
                /*    Create TTS related semaphores    */
                ret = ICSS_EMAC_testTtsSemCreate();
                assert(ret == 0);
        
                ICSS_EMAC_testTtsModePort1 = 1;
                ICSS_EMAC_testTtsModePort2 = 1;
        
                /*    Wait for TTS test to complete    */
                while(ICSS_EMAC_testTtsModePort1 || ICSS_EMAC_testTtsModePort2)
                {
                    SLEEP(10);
                }
                ICSS_EMAC_testTtsSemDestroy();
        
                PRINT("\n============================================================");
                PRINT("\nTTS tests finished on ICSS_EMAC_TEST_PRU1ETH0 and ICSS_EMAC_TEST_PRU1ETH1");
                PRINT("\n============================================================");
            }
            if (ICSS_EMAC_testTotalPktRcvd == (ICSS_EMAC_TEST_PKT_TX_COUNT * ICSS_EMAC_testLinkUpCount))
            {
                PRINT("\nAll tests have passed\n");
            }
            else
                PRINT("ICSS_EMAC_testTaskPruss1: total Pkts received: %d\n", ICSS_EMAC_testTotalPktRcvd);
        
            ICSS_EMAC_testInterruptDisable(ICSS_EMAC_testHandle);
            ICSS_EMAC_testInterruptDisable(ICSS_EMAC_testHandle1);
    
            ICSS_EmacDeInit(ICSS_EMAC_testHandle, ICSS_EMAC_MODE_MAC1|ICSS_EMAC_MODE_DUALMAC);
            ICSS_EmacDeInit(ICSS_EMAC_testHandle1, ICSS_EMAC_MODE_MAC2|ICSS_EMAC_MODE_DUALMAC);
        }
        else
        {
            PRINT("ICSS_EMAC_testTaskPruss2: firmware load failure\n");
        }
    }
    
    #ifdef __LINUX_USER_SPACE
    void *ICSS_EMAC_testTaskPruss2(void *a0)
    #else
    Void ICSS_EMAC_testTaskPruss2(UArg a0, UArg a1)
    #endif
    {
        Uint8 firmwareLoad_done = FALSE;
        uint32_t count = 0;
        int8_t ret = 0;
    
        ICSS_EmacTxArgument txArgs;
        memset(&txArgs, 0, sizeof(ICSS_EmacTxArgument));
    #ifdef __LINUX_USER_SPACE
        ICSS_EMAC_testPgVersion = 2;
    #else
        ICSS_EMAC_testPgVersion = (HW_RD_REG32(CSL_MPU_CTRL_MODULE_WKUP_CORE_REGISTERS_REGS + CTRL_WKUP_ID_CODE) & 0xf0000000) >> 28;
    #endif
    
    
        PRINT("ICSS_EMAC_testTaskPruss2: ICSS_EMAC_testPgVersion: 0x%x\n", ICSS_EMAC_testPgVersion);
        PRUICSS_pruDisable(ICSS_EMAC_testPruIcssHandle2, ICSS_EMAC_PORT_1-1);
        PRUICSS_pruDisable(ICSS_EMAC_testPruIcssHandle2, ICSS_EMAC_PORT_2-1);
    
    #ifdef SOC_AM572x
        if (ICSS_EMAC_testPgVersion >= 2)
        {
            if(PRUICSS_pruWriteMemory(ICSS_EMAC_testPruIcssHandle2,PRU_ICSS_IRAM(0) ,0,
    #if defined(__LINUX_USER_SPACE) || defined(__JAILHOUSE_INMATE)
                                  (uint32_t *) PRU0_FIRMWARE_NAME,
                                  sizeof(PRU0_FIRMWARE_NAME)))
    #else
                                  (uint32_t *) &pru_imem0_rev2_start,
                              &pru_imem0_rev2_end - &pru_imem0_rev2_start))
    #endif
            {
                if(PRUICSS_pruWriteMemory(ICSS_EMAC_testPruIcssHandle2,PRU_ICSS_IRAM(1) ,0,
    #if defined(__LINUX_USER_SPACE) || defined(__JAILHOUSE_INMATE)
                                      (uint32_t *) PRU1_FIRMWARE_NAME,
                                      sizeof(PRU1_FIRMWARE_NAME)))
    #else
                                      (uint32_t *) &pru_imem1_rev2_start,
                                  &pru_imem1_rev2_end - &pru_imem1_rev2_start))
    #endif
                {
                    firmwareLoad_done = TRUE;
                }
            }
        }
        else
        {
            if(PRUICSS_pruWriteMemory(ICSS_EMAC_testPruIcssHandle2,PRU_ICSS_IRAM(0) ,0,
    #if defined(__LINUX_USER_SPACE) || defined(__JAILHOUSE_INMATE)
                                  (uint32_t *) PRU0_FIRMWARE_V1_0_NAME,
                                  sizeof(PRU0_FIRMWARE_V1_0_NAME)))
    #else
                                  (uint32_t *) &pru_imem0_rev1_start,
                              &pru_imem0_rev1_end - &pru_imem0_rev1_start))
    #endif
            {
                if(PRUICSS_pruWriteMemory(ICSS_EMAC_testPruIcssHandle2,PRU_ICSS_IRAM(1) ,0,
    #if defined(__LINUX_USER_SPACE) || defined(__JAILHOUSE_INMATE)
                                      (uint32_t *) PRU1_FIRMWARE_V1_1_NAME,
                                      sizeof(PRU1_FIRMWARE_V1_1_NAME)))
    #else
                                      (uint32_t *) &pru_imem1_rev1_start,
                                  &pru_imem1_rev1_end - &pru_imem1_rev1_start))
    #endif
                {
                    firmwareLoad_done = TRUE;
                }
            }
        }
    #else
         if(PRUICSS_pruWriteMemory(ICSS_EMAC_testPruIcssHandle2,PRU_ICSS_IRAM(0) ,0,
    #if defined(__LINUX_USER_SPACE) || defined(__JAILHOUSE_INMATE)
                                  (uint32_t *) PRU0_FIRMWARE_NAME,
                                  sizeof(PRU0_FIRMWARE_NAME)))
    #else
                                  (uint32_t *) &pru_imem0_rev2_start,
                              &pru_imem0_rev2_end - &pru_imem0_rev2_start))
    #endif
        {
            if(PRUICSS_pruWriteMemory(ICSS_EMAC_testPruIcssHandle2,PRU_ICSS_IRAM(1) ,0,
    #if defined(__LINUX_USER_SPACE) || defined(__JAILHOUSE_INMATE)
                                  (uint32_t *) PRU1_FIRMWARE_NAME,
                                  sizeof(PRU1_FIRMWARE_NAME)))
    #else
                                  (uint32_t *) &pru_imem1_rev2_start,
                                  &pru_imem1_rev2_end - &pru_imem1_rev2_start))
    #endif
            {
                firmwareLoad_done = TRUE;
            }
        }
    #endif
    
    
        if( firmwareLoad_done)
        {
            PRUICSS_pruEnable(ICSS_EMAC_testPruIcssHandle2, ICSS_EMAC_PORT_1-1);
            PRUICSS_pruEnable(ICSS_EMAC_testPruIcssHandle2, ICSS_EMAC_PORT_2-1);
    
    
            while (!ICSS_EMAC_testLinkIsrPru2Eth0)
            {
                PRINT("ICSS_EMAC_testTaskPruss2: LINK IS DOWN, pluggin loopback cable for PRU2 ETH0\n");
                SLEEP(100);
            }
            ICSS_EMAC_testLinkUpCount++;
            PRINT("ICSS_EMAC_testTaskPruss2: PRU2 ETH0: LINK IS UP, eth0 state: %d, link up count: %d\n",
                  ((ICSS_EmacObject*)ICSS_EMAC_testHandle2->object)->linkStatus[0], ICSS_EMAC_testLinkUpCount);
        
            ICSS_EMAC_testPacketRcvdPort2 = 1;
        
            txArgs.icssEmacHandle = ICSS_EMAC_testHandle2;
            txArgs.lengthOfPacket = ICSS_EMAC_TEST_PKT_SIZE;
            txArgs.portNumber = 1;
            txArgs.queuePriority = 3;
            txArgs.srcAddress = &ICSS_EMAC_testPkt[0];
            
            for (count=0;count < ICSS_EMAC_TEST_PKT_TX_COUNT;count++)
            {
                if(((ICSS_EmacObject*)ICSS_EMAC_testHandle2->object)->linkStatus[0] )
                {
                    if(ICSS_EMAC_testPacketRcvdPort2 )
                    {
                        ICSS_EMAC_testPacketRcvdPort2 = 0;
                        ICSS_EmacTxPacket(&txArgs, NULL);
                        while(!ICSS_EMAC_testPacketRcvdPort2)
                        {
                            SLEEP(100);
    						ICSS_EMAC_testPacketRcvdPort2 = 1; //PC-- added to escape while loop when testing with packet generator - packet with errors
                        }
                    }
                }
            }
            //if(ICSS_EMAC_testEvmType == ICSS_EMAC_TEST_BOARD_IDKAM571x) //PC-- original commented by,
            if(1) //PC-- I only want to use PRU2 ETH0 on IDKAM572x for a test
            {
                UART_printf("ICSS_EMAC_testTaskPruss2: Skipping ICSS_EMAC_TEST_PRU2ETH1 for AM571x\n");
                UART_printf("ICSS_EMAC_testTaskPruss2: Skipping TTS Tests for PRUICSS Instance 2 for AM571x\n");
                UART_printf("PC-- ICSS_EMAC_testTaskPruss2: Skipping ICSS_EMAC_TEST_PRU2ETH1 for a test\n");
            }
            else
            {
                while (!ICSS_EMAC_testLinkIsrPru2Eth1)
                {
                    PRINT("ICSS_EMAC_testTaskPruss2: LINK IS DOWN,skipping PRU2 ETH1\n");
                }
                ICSS_EMAC_testLinkUpCount++;
                PRINT("ICSS_EMAC_testTaskPruss2: PRU2 ETH1: LINK IS UP, eth0 state: %d, link up count: %d\n",
                      ((ICSS_EmacObject*)ICSS_EMAC_testHandle3->object)->linkStatus[0], ICSS_EMAC_testLinkUpCount);
        
                ICSS_EMAC_testPacketRcvdPort3 = 1;
                txArgs.icssEmacHandle = ICSS_EMAC_testHandle3;
                txArgs.lengthOfPacket = ICSS_EMAC_TEST_PKT_SIZE;
                txArgs.portNumber = 2;
                txArgs.queuePriority = 3;
                txArgs.srcAddress = &ICSS_EMAC_testPkt[0];
                for (count=0;count < ICSS_EMAC_TEST_PKT_TX_COUNT;count++)
                {
                    if(((ICSS_EmacObject*)ICSS_EMAC_testHandle3->object)->linkStatus[0] )
                    {
                        if(ICSS_EMAC_testPacketRcvdPort3 )
                        {
                            ICSS_EMAC_testPacketRcvdPort3 = 0;
                            ICSS_EmacTxPacket(&txArgs, NULL);
                            while(!ICSS_EMAC_testPacketRcvdPort3)
                            {
                                SLEEP(100);
                            }
                        }
                    }
                 }
        
                while(!ICSS_EMAC_testLinkIsrPru2Eth0 && !ICSS_EMAC_testLinkIsrPru2Eth1)
                {
                    PRINT("\nICSS_EMAC_testTaskPruss2: LINK IS DOWN, pluggin loopback cable for PRU2 ETH0 and PRU2 ETH1.\n");
                }
        
                PRINT("\n============================================================");
                PRINT("\nInitiating TTS tests on ICSS_EMAC_TEST_PRU2ETH0 and ICSS_EMAC_TEST_PRU2ETH1");
        
                /*    Create TTS related semaphores    */
                ret = ICSS_EMAC_testTtsSemCreate();
                assert(ret == 0);
        
                ICSS_EMAC_testTtsModePort1 = 1;
                ICSS_EMAC_testTtsModePort2 = 1;
        
                /*    Wait for TTS test to complete    */
                while(ICSS_EMAC_testTtsModePort1 || ICSS_EMAC_testTtsModePort2)
                {
                    SLEEP(10);
                }
                ICSS_EMAC_testTtsSemDestroy();
    
                PRINT("\n============================================================");
                PRINT("\nTTS tests finished on ICSS_EMAC_TEST_PRU2ETH0 and ICSS_EMAC_TEST_PRU2ETH1");
                PRINT("\n============================================================");
            }
        
            ICSS_EMAC_testPruInstance2Done = 1;
            PRINT("\nDone with PRU-ICSS Instance 2 Testing\n");
        
        
            ICSS_EMAC_testGetPruStats(1, ICSS_EMAC_testHandle2);
            ICSS_EMAC_testInterruptDisable(ICSS_EMAC_testHandle2);
            ICSS_EmacDeInit(ICSS_EMAC_testHandle2, ICSS_EMAC_MODE_MAC1|ICSS_EMAC_MODE_DUALMAC);
    
            if(ICSS_EMAC_testEvmType == ICSS_EMAC_TEST_BOARD_IDKAM572x)
            {
                ICSS_EMAC_testGetPruStats(2, ICSS_EMAC_testHandle3);
                ICSS_EMAC_testInterruptDisable(ICSS_EMAC_testHandle3);
                ICSS_EmacDeInit(ICSS_EMAC_testHandle3, ICSS_EMAC_MODE_MAC2|ICSS_EMAC_MODE_DUALMAC);
            }
            /* for AM572x, this will be printed after PRU-ICSS instance 1 testing */
    #ifdef SOC_AM572x
            if (ICSS_EMAC_testTotalPktRcvd == (ICSS_EMAC_TEST_PKT_TX_COUNT*ICSS_EMAC_testLinkUpCount))
            {
                PRINT("All tests have passed\n");
            }
    #endif
        }
        else
        {
            PRINT("ICSS_EMAC_testTaskPruss2: firmware load failure\n");
        }
    }
    
    /*
     *  ======== main ========
     */
    int32_t ICSS_EMAC_testPruIcssInstance1Setup(void)
    {
    
        PRUICSS_IntcInitData pruss_intc_initdata = PRUSS_INTC_INITDATA;
        PRUICSS_Config  *cfg;
        ICSS_EmacInitConfig* icss_emacTestInitCfg0;
        ICSS_EmacInitConfig* icss_emacTestInitCfg1;
        ICSS_EmacFwStaticMmap *pIcssEmacStaticMMap;
        ICSS_EmacFwDynamicMmap *pIcssEmacDynamicMMap;
    
    #ifdef __LINUX_USER_SPACE
        int status;
        int priority = 20;
        pthread_attr_t pthread_attr;
        struct sched_param sched_param;
    
        linux_init((void**)&pruss_drv_handle, linux_prussHwAttrs, PRUICCSS_INSTANCE_ONE);
        cfg = linux_pruss_config;
    #else
        Task_Params taskParams;
        int32_t ret  = PRUICSS_socGetInitCfg(&cfg);
        if (ret  != PRUICSS_RETURN_SUCCESS)
            return (ret);
    #endif
    
        ICSS_EMAC_testPruIcssHandle1 = PRUICSS_create((PRUICSS_Config*) cfg,PRUICCSS_INSTANCE_ONE);
    
        /* PRUSS Internal PINMUX settings for AM571x */
        if(ICSS_EMAC_testEvmType == ICSS_EMAC_TEST_BOARD_IDKAM571x)
        {
            PRUICSS_setGpMuxSel(ICSS_EMAC_testPruIcssHandle1, PRUICCSS_PRU1, 4);
        }
    
    #ifndef __LINUX_USER_SPACE
        /* For PRU1 Eth0 */
        CSL_xbarMpuIrqConfigure(CSL_XBAR_INST_MPU_IRQ_141, CSL_XBAR_PRUSS1_IRQ_HOST8);  /* link ISR */
        CSL_xbarMpuIrqConfigure(CSL_XBAR_INST_MPU_IRQ_142, CSL_XBAR_PRUSS1_IRQ_HOST2);  /* RX PKT ISR */
        CSL_xbarMpuIrqConfigure(CSL_XBAR_INST_MPU_IRQ_143, CSL_XBAR_PRUSS1_IRQ_HOST4);  /* TX PKT ISR */
    
        /* For PRU1 Eth1 */
        CSL_xbarMpuIrqConfigure(CSL_XBAR_INST_MPU_IRQ_144, CSL_XBAR_PRUSS1_IRQ_HOST9);  /* link ISR */
        CSL_xbarMpuIrqConfigure(CSL_XBAR_INST_MPU_IRQ_145, CSL_XBAR_PRUSS1_IRQ_HOST3);  /* RX PKT ISR */
        CSL_xbarMpuIrqConfigure(CSL_XBAR_INST_MPU_IRQ_146, CSL_XBAR_PRUSS1_IRQ_HOST5);  /* TX PKT ISR */
    #endif
    
        /*PRU1ETH 0 initializations*/
        ICSS_EMAC_testHandle = (ICSS_EmacHandle)malloc(sizeof(ICSS_EmacConfig));
    
        icss_emacTestInitCfg0 = (ICSS_EmacInitConfig*)malloc(sizeof(ICSS_EmacInitConfig));
    
        if ((ICSS_EMAC_testHandle == NULL) || (icss_emacTestInitCfg0 == NULL))
        {
            PRINT("main: malloc returned null\n");
        }
        icss_emacTestInitCfg0->phyAddr[0]=BOARD_ICSS_EMAC_PORT0_PHY_ADDR;
        icss_emacTestInitCfg0->portMask = ICSS_EMAC_MODE_MAC1;
        icss_emacTestInitCfg0->ethPrioQueue = ICSS_EMAC_QUEUE1;
        icss_emacTestInitCfg0->halfDuplexEnable = 0;
        icss_emacTestInitCfg0->enableIntrPacing = ICSS_EMAC_ENABLE_PACING;
        icss_emacTestInitCfg0->ICSS_EmacIntrPacingMode = ICSS_EMAC_INTR_PACING_MODE1;
        icss_emacTestInitCfg0->pacingThreshold = 100;
        icss_emacTestInitCfg0->learningEn = 0;
        icss_emacTestInitCfg0->macId = ICSS_EMAC_testLclMac;
    
        ICSS_EMAC_testDrvInit(ICSS_EMAC_testHandle,1);
    
    #ifdef __LINUX_USER_SPACE
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle->object)->linkInt_fd = prussdrv_open(pruss_drv_handle, eth0_linkIntNum);
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle->object)->rxInt_fd = prussdrv_open(pruss_drv_handle, eth0_rxIntNum);
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle->object)->txInt_fd = prussdrv_open(pruss_drv_handle, eth0_txIntNum);
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle->object)->ttsCycInt_fd = prussdrv_open(pruss_drv_handle, eth0_txIntNum);
    #endif
    
        /*    Enable interrupt mode for TTS Cyclic Packet    */
        icss_emacTestInitCfg0->ICSS_EmacTTSEnableCycPktInterrupt = ICSS_EMAC_TTS_CYC_INTERRUPT_ENABLE;
    
    #ifdef __LINUX_USER_SPACE
        icss_emacTestInitCfg0->rxIntNum   = eth0_rxIntNum;
        icss_emacTestInitCfg0->linkIntNum = eth0_linkIntNum;
        icss_emacTestInitCfg0->txIntNum   = eth0_txIntNum;
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle->object)->pruss_drv_handle = pruss_drv_handle;
    #else
        icss_emacTestInitCfg0->linkIntNum=CSL_armGicGetGicIdForIrqInputLine(141);
        icss_emacTestInitCfg0->rxIntNum = CSL_armGicGetGicIdForIrqInputLine(142);
        icss_emacTestInitCfg0->txIntNum = CSL_armGicGetGicIdForIrqInputLine(143);
    #endif
    
    
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle->object)->pruIcssHandle = ICSS_EMAC_testPruIcssHandle1;
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle->object)->emacInitcfg = icss_emacTestInitCfg0;
    
    
    
        if (icss_emacGetFwMMapInitConfig(0, &pIcssEmacStaticMMap, &pIcssEmacDynamicMMap) != 0)
        {
            PRINT("ICSS_EMAC_testPruIcssInstance2Setup: invalid instance Id when calling icss_emacGetFwStaticConfig\n");
            return -1;
        }
        icss_emacSetFwMMapInitConfig(ICSS_EMAC_testHandle, 0, pIcssEmacStaticMMap, pIcssEmacDynamicMMap);
    
    
        ICSS_EmacInit(ICSS_EMAC_testHandle,&pruss_intc_initdata,ICSS_EMAC_MODE_MAC1|ICSS_EMAC_MODE_DUALMAC);
        /* Test ICSS_EmacDeInit */
        ICSS_EmacDeInit(ICSS_EMAC_testHandle, ICSS_EMAC_MODE_MAC1|ICSS_EMAC_MODE_DUALMAC);
        ICSS_EmacInit(ICSS_EMAC_testHandle,&pruss_intc_initdata,ICSS_EMAC_MODE_MAC1|ICSS_EMAC_MODE_DUALMAC);
    
        ICSS_EmacRegisterPort0ISRCallback(ICSS_EMAC_testHandle, (ICSS_EmacCallBack)ICSS_EMAC_testLinkIsrCb, (void*)ICSS_EMAC_TEST_PRU1ETH0);
        ICSS_EmacRegisterHwIntRx(ICSS_EMAC_testHandle, (ICSS_EmacCallBack)ICSS_EMAC_testCallbackRxPacket);
        ICSS_EmacRegisterHwIntTx(ICSS_EMAC_testHandle, (ICSS_EmacCallBack)ICSS_EMAC_testCallbackTxComplete);
        ICSS_EmacRegisterHwIntTTSCyc(ICSS_EMAC_testHandle, (ICSS_EmacCallBack)ICSS_EMAC_testTtsCycPort1Callback);
        /*PRU1 ETH1  Initializations*/
        ICSS_EMAC_testHandle1 = (ICSS_EmacHandle)malloc(sizeof(ICSS_EmacConfig));
    
        icss_emacTestInitCfg1 = (ICSS_EmacInitConfig*)malloc(sizeof(ICSS_EmacInitConfig));
        if ((ICSS_EMAC_testHandle1 == NULL) || (icss_emacTestInitCfg1 == NULL))
        {
            PRINT("main: malloc returned null\n");
        }
    
        icss_emacTestInitCfg1->phyAddr[0]= BOARD_ICSS_EMAC_PORT1_PHY_ADDR;
        icss_emacTestInitCfg1->portMask = ICSS_EMAC_MODE_MAC2;
        icss_emacTestInitCfg1->ethPrioQueue = ICSS_EMAC_QUEUE3;
        icss_emacTestInitCfg1->enableIntrPacing = ICSS_EMAC_DISABLE_PACING;
        icss_emacTestInitCfg1->pacingThreshold = 100;
        icss_emacTestInitCfg1->learningEn = 0;
        icss_emacTestInitCfg1->macId = ICSS_EMAC_testLclMac1;
    
        ICSS_EMAC_testDrvInit(ICSS_EMAC_testHandle1, 1);
    
    #ifdef __LINUX_USER_SPACE
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle1->object)->linkInt_fd = prussdrv_open(pruss_drv_handle, eth1_linkIntNum);
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle1->object)->rxInt_fd = prussdrv_open(pruss_drv_handle, eth1_rxIntNum);
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle1->object)->txInt_fd = prussdrv_open(pruss_drv_handle, eth1_txIntNum);
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle1->object)->ttsCycInt_fd = prussdrv_open(pruss_drv_handle, eth1_txIntNum);
    #endif
    
        /*    Enable interrupt mode for TTS Cyclic Packet    */
        icss_emacTestInitCfg1->ICSS_EmacTTSEnableCycPktInterrupt = ICSS_EMAC_TTS_CYC_INTERRUPT_ENABLE;
    
    #ifdef __LINUX_USER_SPACE
        icss_emacTestInitCfg1->rxIntNum   = eth1_rxIntNum;
        icss_emacTestInitCfg1->linkIntNum = eth1_linkIntNum;
        icss_emacTestInitCfg1->txIntNum   = eth1_txIntNum;
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle1->object)->pruss_drv_handle = pruss_drv_handle;
    #else
        icss_emacTestInitCfg1->linkIntNum=CSL_armGicGetGicIdForIrqInputLine(144);
        icss_emacTestInitCfg1->rxIntNum = CSL_armGicGetGicIdForIrqInputLine(145);
        icss_emacTestInitCfg1->txIntNum = CSL_armGicGetGicIdForIrqInputLine(146);
    #endif
        
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle1->object)->pruIcssHandle = ICSS_EMAC_testPruIcssHandle1;
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle1->object)->emacInitcfg = icss_emacTestInitCfg1;
    
        if (icss_emacGetFwMMapInitConfig(0, &pIcssEmacStaticMMap, &pIcssEmacDynamicMMap) != 0)
        {
            PRINT("ICSS_EMAC_testPruIcssInstance2Setup: invalid instance Id when calling icss_emacGetFwStaticConfig\n");
            return -1;
        }
        icss_emacSetFwMMapInitConfig(ICSS_EMAC_testHandle1, 0, pIcssEmacStaticMMap, pIcssEmacDynamicMMap);
    
        ICSS_EmacInit(ICSS_EMAC_testHandle1,&pruss_intc_initdata,ICSS_EMAC_MODE_MAC2|ICSS_EMAC_MODE_DUALMAC);
        /* Test ICSS_EmacDeInit */
        ICSS_EmacDeInit(ICSS_EMAC_testHandle1, ICSS_EMAC_MODE_MAC2|ICSS_EMAC_MODE_DUALMAC);
        ICSS_EmacInit(ICSS_EMAC_testHandle1,&pruss_intc_initdata,ICSS_EMAC_MODE_MAC2|ICSS_EMAC_MODE_DUALMAC);
    
        ICSS_EmacRegisterPort1ISRCallback(ICSS_EMAC_testHandle1, (ICSS_EmacCallBack)ICSS_EMAC_testLinkIsrCb, (void*)ICSS_EMAC_TEST_PRU1ETH1);
        ICSS_EmacRegisterHwIntRx(ICSS_EMAC_testHandle1,(ICSS_EmacCallBack) ICSS_EMAC_testCallbackRxPacket1);
        ICSS_EmacRegisterHwIntTx(ICSS_EMAC_testHandle1,(ICSS_EmacCallBack) ICSS_EMAC_testCallbackTxComplete);
        ICSS_EmacRegisterHwIntTTSCyc(ICSS_EMAC_testHandle1, (ICSS_EmacCallBack)ICSS_EMAC_testTtsCycPort2Callback);
    
    #ifdef __LINUX_USER_SPACE
        pthread_attr_init(&pthread_attr);
        pthread_attr_setinheritsched(&pthread_attr, PTHREAD_EXPLICIT_SCHED);
        pthread_attr_setschedpolicy(&pthread_attr, SCHED_FIFO);
        sched_param.sched_priority = priority;
        pthread_attr_setschedparam(&pthread_attr, &sched_param);
    
        if (status = pthread_create(&port0_linkTask_th,
                    &pthread_attr, ICSS_EMacOsLinkTaskFnc, (void *)ICSS_EMAC_testHandle)) {
            printf("ERROR: \"port0_linkTaskFnc\" task-create failed (%d)\n", status);
            return (-2);
        }
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle->object)->rxTaskHandle = &port0_rxTask_th;
        if (status = pthread_create(&port0_rxTask_th,
                    &pthread_attr, ICSS_EMacOsRxTaskFnc, (void *)ICSS_EMAC_testHandle)) {
            printf("ERROR: \"port0_rxTaskFnc\" task-create failed (%d)\n", status);
            return (-2);
        }
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle->object)->txTaskHandle = &port0_txTask_th;
        if (status = pthread_create(&port0_txTask_th,
                    &pthread_attr, ICSS_EMacOsTxTaskFnc, (void *)ICSS_EMAC_testHandle)) {
            printf("ERROR: \"port0_txTaskFnc\" task-create failed (%d)\n", status);
            return (-2);
        }
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle->object)->ttsCycTaskHandle = &port0_ttsCycTask_th;
        if (status = pthread_create(&port0_ttsCycTask_th,
                    &pthread_attr, ICSS_EMacOsTTSCycTaskFnc, (void *)ICSS_EMAC_testHandle)) {
            printf("ERROR: \"port0_ttsCycTaskFnc\" task-create failed (%d)\n", status);
            return (-2);
        }
    
        if (status = pthread_create(&port1_linkTask_th,
                    &pthread_attr, ICSS_EMacOsLinkTaskFnc, (void *)ICSS_EMAC_testHandle1)) {
            printf("ERROR: \"port1_linkTaskFnc\" task-create failed (%d)\n", status);
            return (-2);
        }
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle1->object)->rxTaskHandle = &port1_rxTask_th;
        if (status = pthread_create(&port1_rxTask_th,
                    &pthread_attr, ICSS_EMacOsRxTaskFnc, (void *)ICSS_EMAC_testHandle1)) {
            printf("ERROR: \"port1_rxTaskFnc\" task-create failed (%d)\n", status);
            return (-2);
        }
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle1->object)->txTaskHandle = &port1_txTask_th;
        if (status = pthread_create(&port1_txTask_th,
                    &pthread_attr, ICSS_EMacOsTxTaskFnc, (void *)ICSS_EMAC_testHandle1)) {
            printf("ERROR: \"port1_txTaskFnc\" task-create failed (%d)\n", status);
            return (-2);
        }
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle1->object)->ttsCycTaskHandle = &port1_ttsCycTask_th;
        if (status = pthread_create(&port1_ttsCycTask_th,
                    &pthread_attr, ICSS_EMacOsTTSCycTaskFnc, (void *)ICSS_EMAC_testHandle1)) {
            printf("ERROR: \"port1_ttsCycTaskFnc\" task-create failed (%d)\n", status);
            return (-2);
        }
        pthread_attr_destroy(&pthread_attr);
    #else  // TI-RTOS
        Task_Params_init(&taskParams);
        taskParams.priority = 15;
        taskParams.instance->name = (char*)"port0_rxTaskFnc";
        taskParams.stackSize = 0x1000;
        taskParams.arg0 = (UArg)ICSS_EMAC_testHandle;
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle->object)->rxTaskHandle = Task_create((ti_sysbios_knl_Task_FuncPtr)ICSS_EMacOsRxTaskFnc, &taskParams, NULL);
    
        if(((ICSS_EmacObject*)ICSS_EMAC_testHandle->object)->rxTaskHandle==NULL)
        {
            return -2;
        }
    
        Task_Params_init(&taskParams);
        taskParams.priority = 15;
        taskParams.instance->name = (char*)"port0_txTaskFnc";
        taskParams.stackSize = 0x1000;
        taskParams.arg0 = (UArg)ICSS_EMAC_testHandle;
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle->object)->txTaskHandle = Task_create((ti_sysbios_knl_Task_FuncPtr)ICSS_EMacOsTxTaskFnc, &taskParams, NULL);
    
        if(((ICSS_EmacObject*)ICSS_EMAC_testHandle->object)->txTaskHandle==NULL)
        {
            return -2;
        }
    
        Task_Params_init(&taskParams);
        taskParams.priority = 15;
        taskParams.instance->name = (char*)"port0_linkTaskFnc";
        taskParams.stackSize = 0x1000;
        taskParams.arg0 = (UArg)ICSS_EMAC_testHandle;
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle->object)->linkTaskHandle = Task_create((ti_sysbios_knl_Task_FuncPtr)ICSS_EMacOsLinkTaskFnc, &taskParams, NULL);
    
        if(((ICSS_EmacObject*)ICSS_EMAC_testHandle->object)->linkTaskHandle==NULL)
        {
            return -2;
        }
    
        Task_Params_init(&taskParams);
        taskParams.priority = 15;
        taskParams.instance->name = (char*)"port0_ttsCycTaskFnc";
        taskParams.stackSize = 0x1000;
        taskParams.arg0 = (UArg)ICSS_EMAC_testHandle;
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle->object)->ttsCycTaskHandle = Task_create((ti_sysbios_knl_Task_FuncPtr)ICSS_EMacOsTTSCycTaskFnc, &taskParams, NULL);
    
        if(((ICSS_EmacObject*)ICSS_EMAC_testHandle->object)->ttsCycTaskHandle==NULL)
        {
            return -2;
        }
        
        Task_Params_init(&taskParams);
        taskParams.priority = 15;
        taskParams.instance->name = (char*)"port1_rxTaskFnc";
        taskParams.stackSize = 0x1000;
        taskParams.arg0 = (UArg)ICSS_EMAC_testHandle1;
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle1->object)->rxTaskHandle = Task_create((ti_sysbios_knl_Task_FuncPtr)ICSS_EMacOsRxTaskFnc, &taskParams, NULL);
    
        if(((ICSS_EmacObject*)ICSS_EMAC_testHandle1->object)->rxTaskHandle==NULL)
        {
            return -2;
        }
    
    
        Task_Params_init(&taskParams);
        taskParams.priority = 15;
        taskParams.instance->name = (char*)"port1_txTaskFnc";
        taskParams.stackSize = 0x1000;
        taskParams.arg0 = (UArg)ICSS_EMAC_testHandle1;
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle1->object)->txTaskHandle = Task_create((ti_sysbios_knl_Task_FuncPtr)ICSS_EMacOsTxTaskFnc, &taskParams, NULL);
    
        if(((ICSS_EmacObject*)ICSS_EMAC_testHandle1->object)->txTaskHandle==NULL)
        {
            return -2;
        }
    
        Task_Params_init(&taskParams);
        taskParams.priority = 15;
        taskParams.instance->name = (char*)"port1_linkTaskFnc";
        taskParams.stackSize = 0x1000;
        taskParams.arg0 = (UArg)ICSS_EMAC_testHandle1;
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle1->object)->linkTaskHandle = Task_create((ti_sysbios_knl_Task_FuncPtr)ICSS_EMacOsLinkTaskFnc, &taskParams, NULL);
    
        if(((ICSS_EmacObject*)ICSS_EMAC_testHandle1->object)->linkTaskHandle==NULL)
        {
            return -2;
        }
    
        Task_Params_init(&taskParams);
        taskParams.priority = 15;
        taskParams.instance->name = (char*)"port1_ttsCycTaskFnc";
        taskParams.stackSize = 0x1000;
        taskParams.arg0 = (UArg)ICSS_EMAC_testHandle1;
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle1->object)->ttsCycTaskHandle = Task_create((ti_sysbios_knl_Task_FuncPtr)ICSS_EMacOsTTSCycTaskFnc, &taskParams, NULL);
    
        if(((ICSS_EmacObject*)ICSS_EMAC_testHandle1->object)->ttsCycTaskHandle==NULL)
        {
            return -2;
        }
    #endif
    
        ICSS_EMAC_testInterruptInit(ICSS_EMAC_testHandle);
        ICSS_EMAC_testInterruptInit(ICSS_EMAC_testHandle1);
    
        ICSS_EMAC_testInterruptEnable(ICSS_EMAC_testHandle1);
        ICSS_EMAC_testInterruptEnable(ICSS_EMAC_testHandle);
        return 0;
    }
    
    int32_t ICSS_EMAC_testPruIcssInstance2Setup(void)
    {
        PRUICSS_IntcInitData pruss_intc_initdata = PRUSS_INTC_INITDATA;
        PRUICSS_Config  *cfg;
        ICSS_EmacInitConfig* icss_emacTestInitCfg0;
        ICSS_EmacInitConfig* icss_emacTestInitCfg1;
        
    
        ICSS_EmacFwStaticMmap *pIcssEmacStaticMMap;
        ICSS_EmacFwDynamicMmap *pIcssEmacDynamicMMap;
    
    #ifdef __LINUX_USER_SPACE
        int status;
        int priority = 20;
        pthread_attr_t pthread_attr;
        struct sched_param sched_param;
    
        linux_init((void**)&pruss_drv_handle2, linux_prussHwAttrs, PRUICCSS_INSTANCE_TWO);
        cfg = linux_pruss_config;
    #else
        Task_Params taskParams;
        int32_t ret  = PRUICSS_socGetInitCfg(&cfg);
        if (ret  != PRUICSS_RETURN_SUCCESS)
        {
            return (ret);
        }
    #endif
    
        ICSS_EMAC_testPruIcssHandle2 = PRUICSS_create((PRUICSS_Config*)cfg,PRUICCSS_INSTANCE_TWO);
    
        /* PRUSS Internal PINMUX settings for AM571x */
        if(ICSS_EMAC_testEvmType == ICSS_EMAC_TEST_BOARD_IDKAM571x)
        {
            PRUICSS_setGpMuxSel(ICSS_EMAC_testPruIcssHandle2, PRUICCSS_PRU0, 4);
            PRUICSS_setGpMuxSel(ICSS_EMAC_testPruIcssHandle2, PRUICCSS_PRU1, 4);
        }
    
    #ifndef __LINUX_USER_SPACE
        /* For PRU2 Eth0 */
        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 */
        if (ICSS_EMAC_testEvmType  == ICSS_EMAC_TEST_BOARD_IDKAM572x)
        {
        /* For PRU2 Eth1 */
            CSL_xbarMpuIrqConfigure(CSL_XBAR_INST_MPU_IRQ_134, CSL_XBAR_PRUSS2_IRQ_HOST9);  /* link ISR */
            CSL_xbarMpuIrqConfigure(CSL_XBAR_INST_MPU_IRQ_135, CSL_XBAR_PRUSS2_IRQ_HOST3);  /* RX PKT ISR */
            CSL_xbarMpuIrqConfigure(CSL_XBAR_INST_MPU_IRQ_136, CSL_XBAR_PRUSS2_IRQ_HOST5);  /* TX PKT ISR */
        }
    #endif
    
        /*PRU2 ETH0 initializations*/
        ICSS_EMAC_testHandle2 = (ICSS_EmacHandle)malloc(sizeof(ICSS_EmacConfig));
    
        icss_emacTestInitCfg0 = (ICSS_EmacInitConfig*)malloc(sizeof(ICSS_EmacInitConfig));
        if ((ICSS_EMAC_testHandle2 == NULL) || (icss_emacTestInitCfg0 == NULL))
        {
            PRINT("main: malloc returned null\n");
        }
        icss_emacTestInitCfg0->phyAddr[0]=BOARD_ICSS_EMAC_PORT0_PHY_ADDR;
        icss_emacTestInitCfg0->portMask = ICSS_EMAC_MODE_MAC1;
        icss_emacTestInitCfg0->ethPrioQueue = ICSS_EMAC_QUEUE1;
        icss_emacTestInitCfg0->halfDuplexEnable = 0;
        icss_emacTestInitCfg0->enableIntrPacing = ICSS_EMAC_ENABLE_PACING;//ICSS_EMAC_ENABLE_PACING;
        icss_emacTestInitCfg0->ICSS_EmacIntrPacingMode = ICSS_EMAC_INTR_PACING_MODE2;
        icss_emacTestInitCfg0->pacingThreshold = 0;
        icss_emacTestInitCfg0->learningEn = 0;
        icss_emacTestInitCfg0->macId = ICSS_EMAC_testLclMac2;
    
        ICSS_EMAC_testDrvInit(ICSS_EMAC_testHandle2,2);
    
    #ifdef __LINUX_USER_SPACE
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle2->object)->linkInt_fd = prussdrv_open(pruss_drv_handle2, eth0_linkIntNum);
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle2->object)->rxInt_fd = prussdrv_open(pruss_drv_handle2, eth0_rxIntNum);
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle2->object)->txInt_fd = prussdrv_open(pruss_drv_handle2, eth0_txIntNum);
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle2->object)->ttsCycInt_fd = prussdrv_open(pruss_drv_handle2, eth0_txIntNum);
    #endif
    
        /*Enable interrupt mode for TTS Cyclic Packet    */
        icss_emacTestInitCfg0->ICSS_EmacTTSEnableCycPktInterrupt = ICSS_EMAC_TTS_CYC_INTERRUPT_ENABLE;
    
    #ifdef __LINUX_USER_SPACE
        icss_emacTestInitCfg0->rxIntNum   = eth0_rxIntNum;
        icss_emacTestInitCfg0->linkIntNum = eth0_linkIntNum;
        icss_emacTestInitCfg0->txIntNum   = eth0_txIntNum;
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle2->object)->pruss_drv_handle = pruss_drv_handle2;
    #else
        icss_emacTestInitCfg0->rxIntNum = CSL_armGicGetGicIdForIrqInputLine(137);
        icss_emacTestInitCfg0->linkIntNum=CSL_armGicGetGicIdForIrqInputLine(127);
        icss_emacTestInitCfg0->txIntNum = CSL_armGicGetGicIdForIrqInputLine(129);
    #endif
    
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle2->object)->pruIcssHandle = ICSS_EMAC_testPruIcssHandle2;
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle2->object)->emacInitcfg = icss_emacTestInitCfg0;
    
        if (icss_emacGetFwMMapInitConfig(1, &pIcssEmacStaticMMap, &pIcssEmacDynamicMMap) != 0)
        {
            PRINT("ICSS_EMAC_testPruIcssInstance2Setup: invalid instance Id when calling icss_emacGetFwStaticConfig\n");
            return -1;
        }
    
        icss_emacSetFwMMapInitConfig(ICSS_EMAC_testHandle2, 1, pIcssEmacStaticMMap, pIcssEmacDynamicMMap);
    
        ICSS_EmacInit(ICSS_EMAC_testHandle2,&pruss_intc_initdata,ICSS_EMAC_MODE_MAC1|ICSS_EMAC_MODE_DUALMAC);
        /* Test ICSS_EmacDeInit */
        ICSS_EmacDeInit(ICSS_EMAC_testHandle2,ICSS_EMAC_MODE_MAC1|ICSS_EMAC_MODE_DUALMAC);
        ICSS_EmacInit(ICSS_EMAC_testHandle2,&pruss_intc_initdata,ICSS_EMAC_MODE_MAC1|ICSS_EMAC_MODE_DUALMAC);
    
        ICSS_EmacRegisterPort0ISRCallback(ICSS_EMAC_testHandle2, (ICSS_EmacCallBack)ICSS_EMAC_testLinkIsrCb, (void*)ICSS_EMAC_TEST_PRU2ETH0);
        ICSS_EmacRegisterHwIntRx(ICSS_EMAC_testHandle2, (ICSS_EmacCallBack)ICSS_EMAC_testCallbackRxPacket2);
        ICSS_EmacRegisterHwIntTx(ICSS_EMAC_testHandle2, (ICSS_EmacCallBack)ICSS_EMAC_testCallbackTxComplete);
        ICSS_EmacRegisterHwIntTTSCyc(ICSS_EMAC_testHandle2, (ICSS_EmacCallBack)ICSS_EMAC_testTtsCycPort1Callback);
    
        if (ICSS_EMAC_testEvmType  ==  ICSS_EMAC_TEST_BOARD_IDKAM572x)
        {
            /*PRU2 ETH1 initializations*/
            ICSS_EMAC_testHandle3 = (ICSS_EmacHandle)malloc(sizeof(ICSS_EmacConfig));
        
            
            icss_emacTestInitCfg1 = (ICSS_EmacInitConfig*)malloc(sizeof(ICSS_EmacInitConfig));
            if ((ICSS_EMAC_testHandle3 == NULL) || (icss_emacTestInitCfg1 == NULL))
            {
                PRINT("main: malloc returned null\n");
            }
            icss_emacTestInitCfg1->phyAddr[0]= BOARD_ICSS_EMAC_PORT1_PHY_ADDR;
        
            icss_emacTestInitCfg1->portMask = ICSS_EMAC_MODE_MAC2;
            icss_emacTestInitCfg1->ethPrioQueue = ICSS_EMAC_QUEUE3;
            icss_emacTestInitCfg1->enableIntrPacing = ICSS_EMAC_DISABLE_PACING;
            icss_emacTestInitCfg1->pacingThreshold = 100;
        
            icss_emacTestInitCfg1->learningEn = 0;
        
        
            icss_emacTestInitCfg1->macId = ICSS_EMAC_testLclMac3;
        
            ICSS_EMAC_testDrvInit(ICSS_EMAC_testHandle3, 2);
    
    #ifdef __LINUX_USER_SPACE
            ((ICSS_EmacObject*)ICSS_EMAC_testHandle3->object)->linkInt_fd = prussdrv_open(pruss_drv_handle2, eth1_linkIntNum);
            ((ICSS_EmacObject*)ICSS_EMAC_testHandle3->object)->rxInt_fd = prussdrv_open(pruss_drv_handle2, eth1_rxIntNum);
            ((ICSS_EmacObject*)ICSS_EMAC_testHandle3->object)->txInt_fd = prussdrv_open(pruss_drv_handle2, eth1_txIntNum);
            ((ICSS_EmacObject*)ICSS_EMAC_testHandle3->object)->ttsCycInt_fd = prussdrv_open(pruss_drv_handle2, eth1_txIntNum);
    #endif
    
            /*    Enable interrupt mode for TTS Cyclic Packet    */
            icss_emacTestInitCfg1->ICSS_EmacTTSEnableCycPktInterrupt = ICSS_EMAC_TTS_CYC_INTERRUPT_ENABLE;
    
    #ifdef __LINUX_USER_SPACE
            icss_emacTestInitCfg1->rxIntNum   = eth1_rxIntNum;
            icss_emacTestInitCfg1->linkIntNum = eth1_linkIntNum;
            icss_emacTestInitCfg1->txIntNum   = eth1_txIntNum;
            ((ICSS_EmacObject*)ICSS_EMAC_testHandle3->object)->pruss_drv_handle = pruss_drv_handle2;
    #else
            icss_emacTestInitCfg1->rxIntNum = CSL_armGicGetGicIdForIrqInputLine(135);
            icss_emacTestInitCfg1->linkIntNum=CSL_armGicGetGicIdForIrqInputLine(134);
            icss_emacTestInitCfg1->txIntNum = CSL_armGicGetGicIdForIrqInputLine(136);
    #endif
    
    
            ((ICSS_EmacObject*)ICSS_EMAC_testHandle3->object)->pruIcssHandle = ICSS_EMAC_testPruIcssHandle2;
            ((ICSS_EmacObject*)ICSS_EMAC_testHandle3->object)->emacInitcfg = icss_emacTestInitCfg1;
    
    
    
             if (icss_emacGetFwMMapInitConfig(1, &pIcssEmacStaticMMap, &pIcssEmacDynamicMMap) != 0)
             {
                 PRINT("ICSS_EMAC_testPruIcssInstance2Setup: invalid instance Id when calling icss_emacGetFwStaticConfig\n");
                 return -1;
             }
             icss_emacSetFwMMapInitConfig(ICSS_EMAC_testHandle3, 1, pIcssEmacStaticMMap, pIcssEmacDynamicMMap);
    
    
            ICSS_EmacInit(ICSS_EMAC_testHandle3,&pruss_intc_initdata,ICSS_EMAC_MODE_MAC2|ICSS_EMAC_MODE_DUALMAC);
            /* Test ICSS_EmacDeInit */
            ICSS_EmacDeInit(ICSS_EMAC_testHandle3, ICSS_EMAC_MODE_MAC2|ICSS_EMAC_MODE_DUALMAC);
            ICSS_EmacInit(ICSS_EMAC_testHandle3,&pruss_intc_initdata,ICSS_EMAC_MODE_MAC2|ICSS_EMAC_MODE_DUALMAC);
            ICSS_EmacRegisterPort1ISRCallback(ICSS_EMAC_testHandle3, (ICSS_EmacCallBack)ICSS_EMAC_testLinkIsrCb, (void*)ICSS_EMAC_TEST_PRU2ETH1);
            ICSS_EmacRegisterHwIntRx(ICSS_EMAC_testHandle3, (ICSS_EmacCallBack)ICSS_EMAC_testCallbackRxPacket3);
            ICSS_EmacRegisterHwIntTx(ICSS_EMAC_testHandle3, (ICSS_EmacCallBack)ICSS_EMAC_testCallbackTxComplete);
            ICSS_EmacRegisterHwIntTTSCyc(ICSS_EMAC_testHandle3, (ICSS_EmacCallBack)ICSS_EMAC_testTtsCycPort2Callback);
        }
    
    #ifdef __LINUX_USER_SPACE
        pthread_attr_init(&pthread_attr);
        pthread_attr_setinheritsched(&pthread_attr, PTHREAD_EXPLICIT_SCHED);
        pthread_attr_setschedpolicy(&pthread_attr, SCHED_FIFO);
        sched_param.sched_priority = priority;
        pthread_attr_setschedparam(&pthread_attr, &sched_param);
    
        if (status = pthread_create(&port2_linkTask_th,
                                    &pthread_attr, ICSS_EMacOsLinkTaskFnc, (void *)ICSS_EMAC_testHandle2)) {
            printf("ERROR: \"port2_linkTaskFnc\" task-create failed (%d)\n", status);
            return (-2);
        }
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle2->object)->rxTaskHandle = &port2_rxTask_th;
        if (status = pthread_create(&port2_rxTask_th,
                                    &pthread_attr, ICSS_EMacOsRxTaskFnc, (void *)ICSS_EMAC_testHandle2)) {
            printf("ERROR: \"port2_rxTaskFnc\" task-create failed (%d)\n", status);
            return (-2);
        }
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle2->object)->txTaskHandle = &port2_txTask_th;
        if (status = pthread_create(&port2_txTask_th,
                                    &pthread_attr, ICSS_EMacOsTxTaskFnc, (void *)ICSS_EMAC_testHandle2)) {
            printf("ERROR: \"port2_txTaskFnc\" task-create failed (%d)\n", status);
            return (-2);
        }
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle2->object)->ttsCycTaskHandle = &port2_ttsCycTask_th;
        if (status = pthread_create(&port2_ttsCycTask_th,
                                    &pthread_attr, ICSS_EMacOsTTSCycTaskFnc, (void *)ICSS_EMAC_testHandle2)) {
            printf("ERROR: \"port2_ttsCycTaskFnc\" task-create failed (%d)\n", status);
            return (-2);
        }
    
        if (ICSS_EMAC_testEvmType  == ICSS_EMAC_TEST_BOARD_IDKAM572x)
        {
            if (status = pthread_create(&port3_linkTask_th,
                                        &pthread_attr, ICSS_EMacOsLinkTaskFnc, (void *)ICSS_EMAC_testHandle3)) {
                printf("ERROR: \"port3_linkTaskFnc\" task-create failed (%d)\n", status);
                return (-2);
            }
            ((ICSS_EmacObject*)ICSS_EMAC_testHandle3->object)->rxTaskHandle = &port3_rxTask_th;
            if (status = pthread_create(&port3_rxTask_th,
                                        &pthread_attr, ICSS_EMacOsRxTaskFnc, (void *)ICSS_EMAC_testHandle3)) {
                printf("ERROR: \"port3_rxTaskFnc\" task-create failed (%d)\n", status);
                return (-2);
            }
            ((ICSS_EmacObject*)ICSS_EMAC_testHandle3->object)->txTaskHandle = &port3_txTask_th;
            if (status = pthread_create(&port3_txTask_th,
                                        &pthread_attr, ICSS_EMacOsTxTaskFnc, (void *)ICSS_EMAC_testHandle3)) {
                printf("ERROR: \"port3_txTaskFnc\" task-create failed (%d)\n", status);
                return (-2);
            }
            ((ICSS_EmacObject*)ICSS_EMAC_testHandle3->object)->ttsCycTaskHandle = &port3_ttsCycTask_th;
            if (status = pthread_create(&port3_ttsCycTask_th,
                                        &pthread_attr, ICSS_EMacOsTTSCycTaskFnc, (void *)ICSS_EMAC_testHandle3)) {
                printf("ERROR: \"port3_ttsCycTaskFnc\" task-create failed (%d)\n", status);
                return (-2);
            }
        }
        pthread_attr_destroy(&pthread_attr);
    #else // TI-RTOS
        Task_Params_init(&taskParams);
        taskParams.priority = 15;
        taskParams.instance->name = (char*)"port2_rxTaskFnc";
        taskParams.stackSize = 0x1000;
        taskParams.arg0 = (UArg)ICSS_EMAC_testHandle2;
    
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle2->object)->rxTaskHandle = Task_create((ti_sysbios_knl_Task_FuncPtr)ICSS_EMacOsRxTaskFnc, &taskParams, NULL);
        if(((ICSS_EmacObject*)ICSS_EMAC_testHandle2->object)->rxTaskHandle==NULL)
        {
            return -2;
        }
    
        Task_Params_init(&taskParams);
        taskParams.priority = 15;
        taskParams.instance->name = (char*)"port2_txTaskFnc";
        taskParams.stackSize = 0x1000;
        taskParams.arg0 = (UArg)ICSS_EMAC_testHandle2;
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle2->object)->txTaskHandle = Task_create((ti_sysbios_knl_Task_FuncPtr)ICSS_EMacOsTxTaskFnc, &taskParams, NULL);
    
        if(((ICSS_EmacObject*)ICSS_EMAC_testHandle2->object)->txTaskHandle==NULL)
        {
            return -2;
        }
    
        Task_Params_init(&taskParams);
        taskParams.priority = 15;
        taskParams.instance->name = (char*)"port2_linkTaskFnc";
        taskParams.stackSize = 0x1000;
        taskParams.arg0 = (UArg)ICSS_EMAC_testHandle2;
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle2->object)->linkTaskHandle = Task_create((ti_sysbios_knl_Task_FuncPtr)ICSS_EMacOsLinkTaskFnc, &taskParams, NULL);
    
        if(((ICSS_EmacObject*)ICSS_EMAC_testHandle2->object)->linkTaskHandle==NULL)
        {
            return -2;
        }
    
        Task_Params_init(&taskParams);
        taskParams.priority = 15;
        taskParams.instance->name = (char*)"port2_ttsCycTaskFnc";
        taskParams.stackSize = 0x1000;
        taskParams.arg0 = (UArg)ICSS_EMAC_testHandle2;
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle2->object)->ttsCycTaskHandle = Task_create((ti_sysbios_knl_Task_FuncPtr)ICSS_EMacOsTTSCycTaskFnc, &taskParams, NULL);
    
        if(((ICSS_EmacObject*)ICSS_EMAC_testHandle2->object)->ttsCycTaskHandle==NULL)
        {
            return -2;
        }
    
        if (ICSS_EMAC_testEvmType  == ICSS_EMAC_TEST_BOARD_IDKAM572x)
        {
            Task_Params_init(&taskParams);
            taskParams.priority = 15;
            taskParams.instance->name = (char*)"port3_rxTaskFnc";
            taskParams.stackSize = 0x1000;
            taskParams.arg0 = (UArg)ICSS_EMAC_testHandle3;
        
            ((ICSS_EmacObject*)ICSS_EMAC_testHandle3->object)->rxTaskHandle = Task_create((ti_sysbios_knl_Task_FuncPtr)ICSS_EMacOsRxTaskFnc, &taskParams, NULL);
            if(((ICSS_EmacObject*)ICSS_EMAC_testHandle3->object)->rxTaskHandle==NULL)
            {
                return -2;
            }
    
            Task_Params_init(&taskParams);
            taskParams.priority = 15;
            taskParams.instance->name = (char*)"port3_txTaskFnc";
            taskParams.stackSize = 0x1000;
            taskParams.arg0 = (UArg)ICSS_EMAC_testHandle3;
            ((ICSS_EmacObject*)ICSS_EMAC_testHandle3->object)->txTaskHandle = Task_create((ti_sysbios_knl_Task_FuncPtr)ICSS_EMacOsTxTaskFnc, &taskParams, NULL);
        
        
            if(((ICSS_EmacObject*)ICSS_EMAC_testHandle3->object)->txTaskHandle==NULL)
            {
                return -2;
            }
    
    
        Task_Params_init(&taskParams);
        taskParams.priority = 15;
        taskParams.instance->name = (char*)"port3_linkTaskFnc";
        taskParams.stackSize = 0x1000;
        taskParams.arg0 = (UArg)ICSS_EMAC_testHandle3;
        ((ICSS_EmacObject*)ICSS_EMAC_testHandle3->object)->linkTaskHandle = Task_create((ti_sysbios_knl_Task_FuncPtr)ICSS_EMacOsLinkTaskFnc, &taskParams, NULL);
    
        if(((ICSS_EmacObject*)ICSS_EMAC_testHandle3->object)->linkTaskHandle==NULL)
        {
            return -2;
        }
    
            Task_Params_init(&taskParams);
            taskParams.priority = 15;
            taskParams.instance->name = (char*)"port3_ttsCycTaskFnc";
            taskParams.stackSize = 0x1000;
            taskParams.arg0 = (UArg)ICSS_EMAC_testHandle3;
            ((ICSS_EmacObject*)ICSS_EMAC_testHandle3->object)->ttsCycTaskHandle = Task_create((ti_sysbios_knl_Task_FuncPtr)ICSS_EMacOsTTSCycTaskFnc, &taskParams, NULL);
    
            if(((ICSS_EmacObject*)ICSS_EMAC_testHandle3->object)->ttsCycTaskHandle==NULL)
            {
                return -2;
            }
        }
    #endif
    
        ICSS_EMAC_testInterruptInit(ICSS_EMAC_testHandle2);
        
        ICSS_EMAC_testTimerSetup(ICSS_EMAC_testHandle2);
    
        if (ICSS_EMAC_testEvmType  == ICSS_EMAC_TEST_BOARD_IDKAM572x)
        {
            ICSS_EMAC_testInterruptInit(ICSS_EMAC_testHandle3);
        }
    
        return 0;
    }
    
    
    #ifdef __LINUX_USER_SPACE
    uint32_t num_iteration = 10;
    uint32_t cycle_period_port1 = ICSS_EMAC_TEST_TTS_CYCLE_PERIOD_PORT1;
    uint32_t cycle_period_port2 = ICSS_EMAC_TEST_TTS_CYCLE_PERIOD_PORT2;
    uint32_t config_time =   ICSS_EMAC_TEST_TTS_CONFIG_TIME;
    int main(int argc, char **argv)
    {
    #ifdef SOC_AM572x
        uint32_t numPorts = 2;
    #endif
    #ifdef SOC_AM571x
        uint32_t numPorts = 4;
    #endif
        int status;
        int switchTask_priority = 10;
        int ttsTask_priority = 10;
        pthread_t ICSS_EMAC_testTaskPruss1_th, ICSS_EMAC_testTaskPruss2_th, ICSS_EMAC_testPort1TxTask_th, ICSS_EMAC_testPort2TxTask_th;
        pthread_attr_t pthread_attr;
        struct sched_param sched_param;
    
        if(argc > 1)
        {
            num_iteration =  atoi(argv[1]);
            cycle_period_port1  = atoi(argv[2]);
            cycle_period_port2  = atoi(argv[3]);
            config_time   = atoi(argv[4]);
        }
    
        // Set board type: BOARD_IDKAM571x or BOARD_IDKAM572x
        FILE *fp = popen("cat /proc/device-tree/model", "r");
        char *ln = NULL;
        size_t len = 0;
    
        getline(&ln, &len, fp);
        if(strstr(ln, "TI AM5728 IDK") != NULL)
        {
            ICSS_EMAC_testEvmType =ICSS_EMAC_TEST_BOARD_IDKAM572x;
            PRINT("board type is AM572IDK\n");
        }
        else if (strstr(ln, "TI AM5718 IDK") != NULL)
        {
            ICSS_EMAC_testEvmType =ICSS_EMAC_TEST_BOARD_IDKAM571x;
            PRINT("board type is AM571IDK\n");
        } else
        {
            PRINT("board type %s is not supported\n", ln);
        }
    
        /* Prompt to set core affinity for AM572x */
        if(ICSS_EMAC_testEvmType == ICSS_EMAC_TEST_BOARD_IDKAM572x)
        {
            PRINT("Set core affinity before continuing the process: taskset -p 2 [pid] \n");
            PRINT("Enter character: ");
            getchar();
        }
    
    #ifdef SOC_AM571x
        ICSS_EMAC_testPruIcssInstance1Setup();
    #endif
        ICSS_EMAC_testPruIcssInstance2Setup();
    
        pthread_attr_init(&pthread_attr);
        pthread_attr_setinheritsched(&pthread_attr,PTHREAD_EXPLICIT_SCHED);
        pthread_attr_setschedpolicy(&pthread_attr, SCHED_RR);
        sched_param.sched_priority = switchTask_priority;
        pthread_attr_setschedparam(&pthread_attr, &sched_param);
    
        mlockall(MCL_FUTURE);
    
    #ifdef SOC_AM571x
        if ((status = pthread_create(&ICSS_EMAC_testTaskPruss1_th, &pthread_attr, ICSS_EMAC_testTaskPruss1, NULL))) {
            printf("ERROR: \"SwitchTask1\" task-create failed (%d)\n", status);
            return (-1);
        }
    #endif
        if ((status = pthread_create(&ICSS_EMAC_testTaskPruss2_th, NULL, ICSS_EMAC_testTaskPruss2, NULL))) {
            printf("ERROR: \"SwitchTask2\" task-create failed (%d)\n", status);
            return (-1);
        }
        // Set TTS tasks priority
        pthread_attr_setschedpolicy(&pthread_attr, SCHED_FIFO);
        sched_param.sched_priority = ttsTask_priority;
        pthread_attr_setschedparam(&pthread_attr, &sched_param);
    
        if ((status = pthread_create(&ICSS_EMAC_testPort1TxTask_th, &pthread_attr, ICSS_EMAC_testPort1TxTask, NULL))) {
            printf("ERROR: \"ttsPort1TxTask\" task-create failed (%d)\n", status);
            return (-1);
        }
        if ((status = pthread_create(&ICSS_EMAC_testPort2TxTask_th, &pthread_attr, ICSS_EMAC_testPort2TxTask, NULL))) {
            printf("ERROR: \"ttsPort2TxTask\" task-create failed (%d)\n", status);
            return (-1);
        }
    
    #ifdef SOC_AM571x
        pthread_join(ICSS_EMAC_testTaskPruss1_th, NULL);
    #endif
        pthread_join(ICSS_EMAC_testTaskPruss2_th, NULL);
        pthread_join(ICSS_EMAC_testPort1TxTask_th, NULL);
        pthread_join(ICSS_EMAC_testPort2TxTask_th, NULL);
    
        pthread_attr_destroy(&pthread_attr);
    
        return(0);
    }
    #else // RTOS
        Error_Block eb;
        Task_Params taskParams;
    int main()
    {
        Board_IDInfo info;
        uint32_t numPorts = 4;
        Board_STATUS boardInitStatus =0;
    
    #ifdef __JAILHOUSE_INMATE
    #define BOARD_UART_INSTANCE 2
        UART_HwAttrs uart_hwAttrs;
    
        /* Make sure non-interrupt mode is used for UART */
        /* Get the UART default configuration */
        UART_socGetInitCfg(BOARD_UART_INSTANCE, &uart_hwAttrs);
        /* Disabling interrupt mode, forcing UART to use the polling mode */
        uart_hwAttrs.enableInterrupt = 0;
        /* Write back the config */
        UART_socSetInitCfg(BOARD_UART_INSTANCE, &uart_hwAttrs);
    
        Board_initCfg cfg = BOARD_INIT_UART_STDIO | BOARD_INIT_MODULE_CLOCK | BOARD_INIT_ICSS_ETH_PHY;
    #else
        Board_initCfg cfg = BOARD_INIT_UART_STDIO | BOARD_INIT_PINMUX_CONFIG | BOARD_INIT_MODULE_CLOCK | BOARD_INIT_ICSS_ETH_PHY;
    #endif
    
        Error_init(&eb);
        boardInitStatus  = Board_init(cfg);
    
        if (boardInitStatus !=0)
        {
            printf("Board_init failure\n");
            return(0);
        }
    
    #ifdef __JAILHOUSE_INMATE
        PRINT("boardName: %s\n", "idkAM572x");
        ICSS_EMAC_testEvmType =ICSS_EMAC_TEST_BOARD_IDKAM572x;
    #else
        memset(&info, 0,sizeof(Board_IDInfo));
        Board_getIDInfo(&info);
        PRINT("boardName: %s\n", info.boardName);
        if (!(strcmp(info.boardName, "AM571IDK")))
        {
            ICSS_EMAC_testEvmType =ICSS_EMAC_TEST_BOARD_IDKAM571x;
            PRINT("board type is AM571IDK, numPorts: %d\n", numPorts);
        }
        else
        {
            ICSS_EMAC_testEvmType =ICSS_EMAC_TEST_BOARD_IDKAM572x;
            PRINT("board type is AM572IDK, numPorts: %d\n", numPorts);
         }
    #endif
    
    #if defined (idkAM571x)
        Task_Params_init(&taskParams);
        taskParams.priority = 10;
        taskParams.instance->name = "SwitchTask1";
        Task_create(ICSS_EMAC_testTaskPruss1, &taskParams, &eb);
    #endif
    
        Task_Params_init(&taskParams);
        taskParams.priority = 10;
        taskParams.instance->name = "SwitchTask2";
        Task_create(ICSS_EMAC_testTaskPruss2, &taskParams, &eb);
    
    
        Task_Params_init(&taskParams);
        taskParams.priority = 10;
        taskParams.instance->name = "Port1TxTask";
        Task_create(ICSS_EMAC_testPort1TxTask, &taskParams, &eb);
    
        Task_Params_init(&taskParams);
        taskParams.priority = 10;
        taskParams.instance->name = "Port2TxTask";
        Task_create(ICSS_EMAC_testPort2TxTask, &taskParams, &eb);
    
    #if defined (idkAM571x)
        ICSS_EMAC_testPruIcssInstance1Setup();
    #endif
        ICSS_EMAC_testPruIcssInstance2Setup();
    
        BIOS_start();
        return(0);
    }
    #endif
    
    
    

    thank you,

    Paula

  • No I did remove PRUICSS_pruWriteMemory(), so I guess this could be the problem.
  • What does replace PRU0_FIRMWARE and PRU1_FIRMWARE in PDK 1.0.7 to know the name of the binary to pass to PRUICSS_pruWriteMemory()?
  • Seems to be (uint32_t *) &pru_imem1_rev2_start, &pru_imem1_rev2_end - &pru_imem1_rev2_start and (uint32_t *) &pru_imem0_rev2_start, &pru_imem0_rev2_end - &pru_imem0_rev2_start ?
  • Sylvain, pru_imem0_rev2_start, and pru_imem1_rev2_start, please follow loopback main.c flow.. they may be more changes that were missing. It could take some time, but at least everything is one file

    Paula
  • Where are does symbols defined? Does not seems to be part of the PRU binary?
    undefined reference to `pru_imem0_rev2_end'
    undefined reference to `pru_imem0_rev2_start'
    undefined reference to `pru_imem1_rev2_end'
    undefined reference to `pru_imem1_rev2_start'
  • you need to include:
    #include <ti/drv/icss_emac/test/src/fw_mem_section.h>
  • The header file <ti/drv/icss_emac/test/src/fw_mem_section.h> provide the definition, I need to now where those variables are declared?
  • In the C:\TI\pdk_am57xx_1_0_7\packages\ti\build\pruss\lnk_a8_a9_a15_REV2.cmd
  • Getting close, two problems to go:

    1. c:/ti/gcc-arm-none-eabi-4_9-2015q3/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld.exe:C:/ti/pdk_am57xx_1_0_7/packages/ti/build/pruss/lnk_a8_a9_a15_REV2.cmd:10: warning: memory region `APP_CACHED_DATA_BLK1_MEM' not declared

      Where does APP_CACHED_DATA_BLK1_MEM should be declared and what is the value to use?

    2. In function `MuxIntcP_create': AM572X/muxintcp/MuxIntcP_tirtos.c:60: undefined reference to `ti_sysbios_family_shared_vayu_IntXbar_connect__E'

      Expecting that ti_sysbios_family_shared_vayu_IntXbar_connect__E is part of SYSBIOS library, need to look at my linking order... any comments?

    Regards,

    Sylvain

  • Sylvan, just to confirm, did you add flags for linking icss_dualemac binaries as shown below and as shown in attached snapshot?. Also did you add command line lnk_a8_a9_a15_REV2.cmd, as shown in attached snapshot?

    -static

    ${PDK_INSTALL_PATH}/ti/drv/icss_emac/firmware/icss_dualemac/bin/am572x/a15_0/REV1/icss_dualemac_PRU0.bin ${PDK_INSTALL_PATH}/ti/drv/icss_emac/firmware/icss_dualemac/bin/am572x/a15_0/REV1/icss_dualemac_PRU1.bin ${PDK_INSTALL_PATH}/ti/drv/icss_emac/firmware/icss_dualemac/bin/am572x/a15_0/REV2/icss_dualemac_PRU0.bin ${PDK_INSTALL_PATH}/ti/drv/icss_emac/firmware/icss_dualemac/bin/am572x/a15_0/REV2/icss_dualemac_PRU1.bin

    thank you,

    Paula

  • I do include only rev2 since this is the one we are using:

    I think I'm missing the -static before the bin, will try that...

    Regards,

        Sylvain

  • No change, this is my linker line:

    "C:/ti/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-gcc.exe" -Wl,--start-group -mcpu=cortex-a15 -marm -mfloat-abi=hard -mfpu=vfpv4 -fno-exceptions -Dam5728 -DDEBUG -DSOC_AM572x -DKEOS_DEVICE=rtos_ti -DKEOS_HARDWARE=AM572X -Dcore0 -DDEBUGOUT -ffunction-sections -fdata-sections -g -gdwarf-3 -gstrict-dwarf -Wall -Wl,-Map,"armbase_ms7.map" -nostartfiles -nodefaultlibs -static -Wl,--gc-sections -L"C:/stash/keos/Projects/rtos_ti/AM572X/A15/Debug-KR293" -L"C:/ti/bios_6_46_05_55/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/fpu" -Wl,--defsym,CORE0=1 -Wl,--defsym,STACKSIZE=0x10000 -Wl,--defsym,HEAPSIZE=0x400 -Wl,-TC:/ti/pdk_am57xx_1_0_7/packages/ti/build/pruss/lnk_a8_a9_a15_REV2.cmd -static C:/ti/pdk_am57xx_1_0_7/packages/ti/drv/icss_emac/firmware/icss_dualemac/bin/am572x/a15_0/REV2/icss_dualemac_PRU0.bin C:/ti/pdk_am57xx_1_0_7/packages/ti/drv/icss_emac/firmware/icss_dualemac/bin/am572x/a15_0/REV2/icss_dualemac_PRU1.bin -o"armbase_ms7.out" "./Sources/Communications/EthercatMaster/KaEthercatMaster.o" "./Sources/Communications/EthercatSlave/KaEthercatSlave.o" "./Sources/Communications/EthercatSlave/KaFoeUpgrade.o" "./Sources/Controller/KaController.o" "./Sources/Controller/KaFwUpdater.o" "./Sources/Controller/KaStateInit.o" "./Sources/Controller/KaStateProcessor.o" "./Sources/KaActuatorConfig.o" "./Sources/KaHardware.o" "./Sources/KaLogger.o" "./Sources/KaRobotBase.o" "./Sources/Kinematics/KaControlModel.o" "./Sources/NVRAM/KaNVRAM.o" "./Sources/NVRAM/M95256/KaM95256.o" "./Sources/Safeties/KaSafeties.o" "./Sources/Sensor/KaSensor.o" "./Sources/Sensor/KaSensorButton.o" "./Sources/Sensor/KaSensorManager.o" "./Sources/Sensor/KaSensorMiscSimulation.o" "./Sources/Sensor/KaSensorReadAdc.o" "./Sources/Sensor/KaSensorTemperature.o" "./Sources/Sensor/KaSensorVoltage.o" -Wl,-T"configPkg/linker.cmd" -Wl,--start-group -lgcc -lm -lrdimon -lc -lstdc++ -lkeos_a15 -Wl,--end-group

    and the result:

    makefile:189: recipe for target 'armbase_ms7.out' failed
    c:/ti/gcc-arm-none-eabi-4_9-2015q3/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld.exe:C:/ti/pdk_am57xx_1_0_7/packages/ti/build/pruss/lnk_a8_a9_a15_REV2.cmd:10: warning: memory region `APP_CACHED_DATA_BLK1_MEM' not declared
    C:/stash/keos/Projects/rtos_ti/AM572X/A15/Debug-KR293\libkeos_a15.a(MuxIntcP_tirtos.o): In function `MuxIntcP_create':
    C:/stash/keos/Kernel/File/drivers/AM572X/muxintcp/MuxIntcP_tirtos.c:60: undefined reference to `ti_sysbios_family_shared_vayu_IntXbar_connect__E'

    Regards,

    Sylvain
  • Sylvain, could you try to add ",${PDK_INSTALL_PATH}/ti/build/pruss/lnk_a8_a9_a15_REV2.cmd" in the linker command files as shown in my above post? Instead of using -WL, just for a test

    thank you
    Paula
  • I did move the line "",${TI_PDK_INSTALL_DIR}/packages/ti/build/pruss/lnk_a8_a9_a15_REV2.cmd"" from Misceleanous to Libraries linker window, but no much success: new linker line is:

    "C:/ti/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-gcc.exe" -Wl,--start-group -mcpu=cortex-a15 -marm -mfloat-abi=hard -mfpu=vfpv4 -fno-exceptions -Dam5728 -DDEBUG -DSOC_AM572x -DKEOS_DEVICE=rtos_ti -DKEOS_HARDWARE=AM572X -Dcore0 -DDEBUGOUT -ffunction-sections -fdata-sections -g -gdwarf-3 -gstrict-dwarf -Wall -Wl,-Map,"armbase_ms7.map" -nostartfiles -nodefaultlibs -static -Wl,--gc-sections -L"C:/stash/keos/Projects/rtos_ti/AM572X/A15/Debug-KR293" -L"C:/ti/bios_6_46_05_55/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/fpu" -Wl,--defsym,CORE0=1 -Wl,--defsym,STACKSIZE=0x10000 -Wl,--defsym,HEAPSIZE=0x400 -static C:/ti/pdk_am57xx_1_0_7/packages/ti/drv/icss_emac/firmware/icss_dualemac/bin/am572x/a15_0/REV2/icss_dualemac_PRU0.bin C:/ti/pdk_am57xx_1_0_7/packages/ti/drv/icss_emac/firmware/icss_dualemac/bin/am572x/a15_0/REV2/icss_dualemac_PRU1.bin -o"armbase_ms7.out" "./Sources/Communications/EthercatMaster/KaEthercatMaster.o" "./Sources/Communications/EthercatSlave/KaEthercatSlave.o" "./Sources/Communications/EthercatSlave/KaFoeUpgrade.o" "./Sources/Controller/KaController.o" "./Sources/Controller/KaFwUpdater.o" "./Sources/Controller/KaStateInit.o" "./Sources/Controller/KaStateProcessor.o" "./Sources/KaActuatorConfig.o" "./Sources/KaHardware.o" "./Sources/KaLogger.o" "./Sources/KaRobotBase.o" "./Sources/Kinematics/KaControlModel.o" "./Sources/NVRAM/KaNVRAM.o" "./Sources/NVRAM/M95256/KaM95256.o" "./Sources/Safeties/KaSafeties.o" "./Sources/Sensor/KaSensor.o" "./Sources/Sensor/KaSensorButton.o" "./Sources/Sensor/KaSensorManager.o" "./Sources/Sensor/KaSensorMiscSimulation.o" "./Sources/Sensor/KaSensorReadAdc.o" "./Sources/Sensor/KaSensorTemperature.o" "./Sources/Sensor/KaSensorVoltage.o" -Wl,-T"configPkg/linker.cmd" -Wl,--start-group -Wl,-T",C:/ti/pdk_am57xx_1_0_7/packages/ti/build/pruss/lnk_a8_a9_a15_REV2.cmd" -lgcc -lm -lrdimon -lc -lstdc++ -lkeos_a15 -Wl,--end-group

    Same results.
  • Can you send me your linker command line?

    Thanks,

    Sylvain
  • Sylvain, below GNU Linker summary from loopback test project:

    -mfloat-abi=hard -Dam5728 -Dcore0 -DSOC_AM572x -DidkAM572x -DMEM_BARRIER_DISABLE -g -gdwarf-3 -gstrict-dwarf -Wall -Wl,-Map,"ICSS_EMAC_BasicExample_idkAM572x_wSoCFile_armTestproject.map" -nostartfiles -Wl,--gc-sections -L"C:/TI/bios_6_46_05_55/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/fpu" -L"$(BIOS_INSTALL_PATH)/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/fpu" -Wl,--defsym,CORE0=1 -Wl,--defsym,STACKSIZE=0x10000 -Wl,--defsym,HEAPSIZE=0x400 -static C:/TI/pdk_am57xx_1_0_7/packages/MyExampleProjects/ICSS_EMAC_BasicExample_idkAM572x_wSoCFile_armTestproject/../../ti/drv/icss_emac/firmware/icss_dualemac/bin/am572x/a15_0/REV1/icss_dualemac_PRU0.bin C:/TI/pdk_am57xx_1_0_7/packages/MyExampleProjects/ICSS_EMAC_BasicExample_idkAM572x_wSoCFile_armTestproject/../../ti/drv/icss_emac/firmware/icss_dualemac/bin/am572x/a15_0/REV1/icss_dualemac_PRU1.bin C:/TI/pdk_am57xx_1_0_7/packages/MyExampleProjects/ICSS_EMAC_BasicExample_idkAM572x_wSoCFile_armTestproject/../../ti/drv/icss_emac/firmware/icss_dualemac/bin/am572x/a15_0/REV2/icss_dualemac_PRU0.bin C:/TI/pdk_am57xx_1_0_7/packages/MyExampleProjects/ICSS_EMAC_BasicExample_idkAM572x_wSoCFile_armTestproject/../../ti/drv/icss_emac/firmware/icss_dualemac/bin/am572x/a15_0/REV2/icss_dualemac_PRU1.bin

    thank you,
    Paula
  • What is -Map,"ICSS_EMAC_BasicExample_idkAM572x_wSoCFile_armTestproject.map" it probably includes APP_CACHED_DATA_BLK1_MEM?