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.

TMS570LS3137: EMAC and lwIp Demo: EOQ Bit is never set

Part Number: TMS570LS3137
Other Parts Discussed in Thread: HALCOGEN, TMS570LC4357,

I am trying to build and run the "HALCoGen Ethernet Driver and lwIP Integration Demonstration" (http://processors.wiki.ti.com/index.php/HALCoGen_Ethernet_Driver_and_lwIP_Integration_Demonstration

I am using "Version 00.02.00 of Demo"

Compiler Version: "TI v16.9.0.LTS"

When I run the application, I get through the "Initializing ethernet" steps and my terminal window reads as follows:

After that, the application gets stuck in the following while loop in "hdkif.c" on line 315:

/* TODO: (This is a workaround) Wait for the EOQ bit is set */
while (EMAC_BUF_DESC_EOQ != (curr_bd->flags_pktlen & EMAC_BUF_DESC_EOQ));

Could someone please help me figure out what I am doing wrong?

  • Hello Matt,

    The device you used is LS3137 which is big-endian device, the value in curr_bd->flags_pkt should be swizzled.

    hdkif_swizzle_data(..) is defined in hdkif.c
  • Thanks QJ for your quick response, but I am still having issues.

    First off, I was using the "Version 00.02.00 Demo", which does NOT have hdkif_swizzle_data(..) in the hdkif.c file.

    Now I am using the "Version 00.03.00 Demo", which does have hdkif_swizzle_data(..), but it is using the defined symbol "_TMS570LC43x_" to condition the "swizzle".

    uint32 hdkif_swizzle_data(uint32 word) {
    
    #if defined(_TMS570LC43x_)
    	return
    		(((word << 24) & 0xFF000000) |
    		((word <<  8) & 0x00FF0000)  |
    		((word >>  8) & 0x0000FF00)  |
    		((word >> 24) & 0x000000FF));
    #else
    	return word;
    #endif
    }
    

    Like you said, I am using the LS3137 device.  So, based on how the code is set up, the "word" will not be "swizzled".

    I also, don't think it needs to be "swizzled". I say that because the original value of curr_bd->flags_pktlen is : 11100000000000000000000101011110b

    It appears that the bit flags are on left hand side just like the value of EMAC_BUF_DESC_EOQ which is: 00010000000000000000000000000000b 

    It seems to me that the code is correct but the 28th bit never gets set. 

    How or what is suppose to set that bit flag?  I feel like I have missed some step in the demo setup process, I don't think I should have to edit code for a demo.

    Thanks!

  • Hello Matt,

    The Version 00.03.00 Demo is designed for RM57 and TMS570LC4357. If you want to use it for TMS570LS3137 and RM48 etc, you have to do some modifications.

    Which board are you using? Do you use MII or RMII?
  • Hello Matt,

    I just tested Version 00.03.00 LWIP on TMS570LS3137 HDK. It works well. The swizzle is not required for TMS570LS31x.
  • Thanks for all your help. Turns out it was a set up issue.

    The Hardware Setup step says "Enable the Ethernet on EVM by setting switch S2 bit to On".

    I read in the TMS570LS31x Hercules Development Kit (HDK) User Guide that: "To use Ethernet, S2:4 should be enabled and all other have to be disabled."

    Apparently, S2:1, 2 and 3 had been previously set to On.

    Once I fixed that things started working.

    Thanks again for your help.