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.

CCS/TMS570LC4357: ETHERNET is working only in the debugger mode for this launchpad

Part Number: TMS570LC4357

Tool/software: Code Composer Studio

We have powered the launchpad externally, removed the jumper JP6 and ethernet is working fine when launchpad is connected in the debug mode. After terminating from the debug mode, ethernet is working fine but after powering off and on, the ethernet does not work. Kindly help us out with this issue.

  • Hello Rahul,

    After the board is powered off/on, is the micro-usb cable unplugged? Do you have the same issue if the board is powered only from micro-USB?

  • Hi Wang,

      Yes, we unplugged the micro-usb cable after the board is powered off/on. Our application demands it to be powered from external 5V supply and so we have never tested that scenario with board powered only from micro-usb.

  • Hi Rahul,

    The Micro-USB is used not only for JTAG, but for SCI TX/RX. I'd like to know if your test is affected by SCI status. Can you do a test with micro-USB and external 5V power supply plugged?

  • Hi Wang,

                   We have tested with and without the SCI driver and found that this is not causing the issue. We have verified the same without debugger and with external power. We have identified where controller is getting stuck and I am attaching the snippet below

     while ((phyID == 0) && (phyIdReadCount > 0)) {

             phyID = Dp83640IDGet(hdkif->mdio_base, hdkif->phy_addr);

             phyIdReadCount--;

             //sciDisplayText(sciREGx, txtProgress, sizeof(txtProgress));

      }

    This was identified using LED toggling before (ON) and after (off) the loop but the LED never toggled (always ON).

    Thanks/Regards,

    Rahul Balachandran

  • Rahul,

    Do you use TI TMS570LC4357 Launch pad (a red board) or your own hardware with this chip? The launch pad doesn't need external power supply, we typically use the micro B USB cable to connect it to a host machine, for both power supply and UART.

    I tried the LWIP demo on this card a moment ago, I have no issue to get the phyID and run the test. I attached my binary here, may be you can load via JTAG to see if this work for you? You need a USB cable and an Ethernet cable connect to a network with a DHCP server

    My log:

    HERCULES MICROCONTROLLERS
    Texas Instruments
    Little Endian device
    Initializing ethernet (DHCP)
    DEBUG - Getting PHY ID....SUCCESS
    DEBUG - Getting PHY Alive Status...SUCCESS
    DEBUG - Getting PHY Link Status...SUCCESS
    DEBUG - Setting up Link...SUCCESS
    ..DONE
    Starting Web Server..DONE

    HERCULES MICROCONTROLLERS
    Texas Instruments
    Little Endian device
    Device IP Address: 158.218.116.241
    Webserver accessible @ http:\\158.218.116.241

    Then I can ping it:

    c:\>ping 158.218.116.241

    Pinging 158.218.116.241 with 32 bytes of data:
    Reply from 158.218.116.241: bytes=32 time=4ms TTL=253
    Reply from 158.218.116.241: bytes=32 time=2ms TTL=253
    Reply from 158.218.116.241: bytes=32 time=2ms TTL=253
    Reply from 158.218.116.241: bytes=32 time=2ms TTL=253

    Ping statistics for 158.218.116.241:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
    Approximate round trip times in milli-seconds:
    Minimum = 2ms, Maximum = 4ms, Average = 2ms

    c:\>

    Also, I can use web browser to open this IP address (this demo is a static webserver). 

    Regards, Eric

    7558.Debug.7z

  • Hi Eric,

    Thanks for the information.

    For us Ethernet is working fine in debug mode, for the power supply connected through Micro B USB cable and also through external power.

    Our query:

    We download the code through Micro B USB cable first then we checked in debug mode everything is working fine. After that we terminated the debug mode and power off the device. Again when we power on the device(not in debug mode) Ethernet is not working(both case Micro USB Cable power supply and External power supply mode). After power on when we press the reset switch it is started to work.

    Every time after Power off and Power on, hard reset is required to bring the board to working state. Otherwise it is hanging in the Ethernet Init state itself.

    Could you please check this on your side? because on end product, we cannot press hard reset every time, when product get power off and power on.

    Thanks

    Rahul

  • Hi,

    Thanks for the info! What do you mean the debug mode? In my test case, we used the CCS/JTAG to connect to R5 core and write the program into the flash, if we run this, there is no problem (I used the micro USB for the power supply, I don't have external power jack on the board). 

    If I disconnect the power supply then re-connect it. The program starts to run, but it only prints lots of "0" or "." on the screen, no additional info, like below:

    ..............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

    or

    000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

    If I press either "PORRST" or "RESET", the program flashed can re-start normally. Is this your issue?

    "After that we terminated the debug mode and power off the device". ======> what is debug mode?

    Regards, Eric

  • Hi Eric,

            

    What we mean by debug mode is the debugger(CCSDebug) option in Code composer studio, wherein we run the execution of program step by step.

    Also as you mentioned after disconnecting and reconnecting the power supply, our flashed code starts to run but it gets stuck at some point(Ethernet is not working). Only after pressing "PORRST" or "RESET" button, the flashed code starts functioning normally(Ethernet is working fine).

    Thanks,

    Rahul

  • Hi Eric and Wang,

    Any update on the above issue? Can you please share the work around or solution for the problem asap.

    Thanks,

    Rahul

  • Rahul,

    Thanks for the patience! We are able to provide a workaround by simply inserting some delay in the main() routine, like below:

    void EMAC_LwIP_Main (uint8_t * macAddress)
    {
    unsigned int ipAddr, i;
    uint8_t testChar;
    struct in_addr devIPAddress;


    //iommUnlock();
    //iommMuxEnableMdio();
    //iommMuxEnableMii();
    //iommLock();
    for (i = 0; i < 1000000; i++) {

    }

    sciInit();

    We tested it on a TMS570LC4357 launch pad, by plug/unplug the micro USB cable multiple times, which provides the power support + JTAG + UART. The program can always re-run and network can be restored.

    Hope this work on your end as well, or you may adjust the delay cycle by some trial.

    Regards, Eric

  • Hi Eric,

     Thanks for the workaround. It works like a charm now. Just out of curiosity how did adding additional delay in main function help in power on reset ?

    Thanks/Regards,

    Rahul B