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.

TMS570LC4357: EMAC loopBack example not working

Part Number: LAUNCHXL2-570LC43
Other Parts Discussed in Thread: TMS570LC4357, HALCOGEN

Hello,

I am a new to the EMAC module and I have few questions.

Currently,  working with LAUNCHXL2 TMS570LC4357 Launchpad and made all the changes described in the following link http://processors.wiki.ti.com/index.php/LAUNCHXL2_570LC43:_lwIP_Demo. in my halcogen file.

with the lwip example, I can see the RJ-45 port leds are blinking (Orange and Green) and I can see in the command window regarding the phy everything is " SUCCESS".  But if I want to send data packets using

this example how can I do it?

I created a new halcogen file with the same settings described and tried the EMAC Loopback test to transmit the data packet. In this case, I cannot even see the RJ-45 ports led blinking. But the return value of the

functions are TRUE for both  EMACHWInit(emacAddress) and EMACTransmit(&hdkif_data[0], &pack[0]). To test it, I cut the ethernet cable and connected Pin 1 TX+ to Pin 3 RX+ and connected Pin 2 TX- to Pin 6 RX-.

How can I test whether it is working? where I can see the transmit data and receive data i.e. in which registers?  

Please point to me in the right direction?

Thanks and Regards

Teja

 

  • Hello Teja,

    There are 3 loopback tests regarding Ethernet. One is EMAC internal loopback. One is PHY internal loopback, and another one is external loopback through the RJ-45.

    The loopback generated from HALCoGen is for EMAC internal loopback.
  • Hello Wang,

    Thanks for the reply..

    But my point is, even though I disabled the checkbox of the loopback function in the HALCoGen and send the data packet using EMACTransmit() function. I do not see any data packets that are sent through the cable in the wireshark.

    Please let me know how can i solve this problem?

    Regards
    Teja
  • Hello Teja,

    Did you enable the ECLK? The PHY on Launchpad uses the ECLK as the clock source. If you use MII, this clock has to be 25MHz. If you use the RMII, the clock should be 50MHz.

    Please configure the ECLK to 25MHz since the Launchpad supports MII mode by default.
  • Hello Wang,

    I enabled the ECLK and set the clock to 25MHz in HALCoGen settings as mentioned in the lwip demo website. But I have no success in transmitting the data packet. Do i need to change the R5-MPU-PMU settings in the HALCoGen ?

    If possible could you send me a example project file which i can test it on my launchpad. Its is quite important for me.

    Regards,
    Teja
  • Hello Teja,

    I use LWIP as you did. I have external loopback code on HDK rather than Launchpad. I developed the loopback code used for HDK product test. My code is not HALCoGen based. I can post the files as your reference if you want.
  • Hello Wang,

    My question is how to transmit a data packet using EMAC in launchpad. Please provide an answer for this because I am unable to send the packets using the example in the Texas wiki.

    Could you please share the files related to this question?

    Regards,
    Teja
  • Part Number: LAUNCHXL2-570LC43

    Hello Everyone,

    I am using TMS570LC4357 launchpad and trying to implement EMAC loopback example as described. I am using EMACHWInit(emacAddress)  to initialise the launchpad EMAC module , but I am unable to see the toggle Leds at the RJ-45 port. But the return value of the function is EMAC_ERR_OK. 

    Similarly, I want to transmit the data packet using EMACTransmit(&hdkif_data[0], &pack[0]) function. The function executes only once and in the second time it enters in the while loop function "while (EMAC_BUF_DESC_EOQ !=(EMACSwizzleData(curr_bd->flags_pktlen) & EMAC_BUF_DESC_EOQ))" . 

    I want see the data packets in the PC using wireshark. I like to have an external loopback so, I disabled loopback in the EMAC module.

    Please someone let me know what are the changes should be done in the Halcogen to make it work?

    Thanks & Regards

    Teja 

  • Hello Teja,

    The TMS570LC4357 EMAC loopback example from the HALCoGen doesn't work.

    There is a potential race condition where the EMAC may read the "next" pointer of a descriptor as NULL before appending additional descriptors to the list by patching the pointer. The TRM has a suggested workaround (32.2.6.2 in TRM), but the driver from the HALCoGen doesn't implement this workaround.

    I have submitted the bug ticket before.
  • Hi QJ,

    Can you help in providing a working example for the mentioned launchpad? The workaround was not helpful here...

  • Hello SImon,

    Just found the problem. The example will work if the cache is disabled.
  • Hello Wang,

    Is it possible to share the HALCOGen generated files of the loop back example that you have tested. Because for me even though I disabled the cache in "R5-MPU-PMU" tab, I have no success.

    Thanks & Regards
    Teja
  • Hello Teja,

     if cache is enabled, please use write through for SRAM (MPU region 3)