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/TMS320F28069M: Sci_echoback example fails after unplugging and plugging back the USB connector

Part Number: TMS320F28069M
Other Parts Discussed in Thread: C2000WARE, CONTROLSUITE

Tool/software: Code Composer Studio

I run the "sci_echoback" example and it works properly. However, if I unplug and then, plug again the USB connector (which connects the PC with the LaunchPad F28069M) the communciation does not work. The computer recognizes the COM port correctly, but the board does not echoback what i write on the console/terminal.

After unplug and plug, it is necessary to press the reset buttom of the board so the example works properly again.


Is there any way via software to "fix" the example? By fixing the example I mean that it is not longer necessary to press the reset button for the communication to work correctly if I have previously disconnected the USB wire.

Thanks

  • Hi,

    Please also mention the Software package,version you are using, for us to help you better.(Like C2000Ware Version 3.2.0.0) .are you using C2000Ware? 

    I do not have a F28069 to try it out at my end for now. But do you see the "Hello World" Message on the console after your run after replugging?

    when you halt the CPU after replugging where does the code halt? is it in while(SciaRegs.SCIFFRX.bit.RXFFST !=1) loop waiting for the Rx Data? 

    Regards,

    Sudharsanan

  • The example is from ControlSuite v150. I added a "InitFlash()" function in the "main" in order to permanently load the program on the device. 

    The "InitFlash()" function is copy from other example of ControlSuite:

    #pragma CODE_SECTION(InitFlash, "secureRamFuncs")
    void InitFlash(void)
    {
    asm(" EALLOW"); // Enable EALLOW protected register access
    FlashRegs.FPWR.bit.PWR = 3; // Pump and bank set to active mode
    FlashRegs.FSTATUS.bit.V3STAT = 1; // Clear the 3VSTAT bit
    FlashRegs.FSTDBYWAIT.bit.STDBYWAIT = 0x01FF; // Sleep to standby transition cycles
    FlashRegs.FACTIVEWAIT.bit.ACTIVEWAIT = 0x01FF; // Standby to active transition cycles
    FlashRegs.FBANKWAIT.bit.RANDWAIT = 3; // Random access waitstates
    FlashRegs.FBANKWAIT.bit.PAGEWAIT = 3; // Paged access waitstates
    FlashRegs.FOTPWAIT.bit.OTPWAIT = 5; // OTP waitstates
    FlashRegs.FOPT.bit.ENPIPE = 1; // Enable the flash pipeline
    asm(" EDIS"); // Disable EALLOW protected register access

    // Force a complete pipeline flush to ensure that the write to the last register
    // configured occurs before returning. Safest thing is to wait 8 full cycles.

    asm(" RPT #6 || NOP");

    } // end of InitFlash()

    The InitFlash() works fine (I add some lines to check it by blinking leds). The problem is that the board do not send any data after unplug and plug the USB. For the program to work properly after unplug and plug the USB, it is necessary to press the reset buttom of the board which is tedious

    Thanks

  • Hi,

    While the InitFlash() just initializes the flash controller. As I asked in my earlier mail, please let me know:

    But do you see the "Hello World" Message on the console after your run after replugging?

    when you halt the CPU after replugging where does the code halt? is it in while(SciaRegs.SCIFFRX.bit.RXFFST !=1) loop waiting for the Rx Data? 

    Regards,

    Sudharsanan

  • I did not see the "Hello Word" Message on the console. However, I thought that maybe the PC needs some time to recognize the COM port so I added a delay just above the  "msg = "\r\n\n\nHello World!\0"" line and now, I'm able to see the Hello Word message.

    Yes, the code halts waiting for the Rx Data, in the  (SciaRegs.SCIFFRX.bit.RXFFST !=1) {}
       

    Thanks

  • Ok. Thanks for the update. Are you now able to get both Tx and Rx working or stuck? 

    Regards,

    Sudharsanan

  • Hi,

    After sending the "Hello Word", "You will enter a character, and the DSP will echo it back!" and ""\r\nEnter a character: \0" the program stops (in the while loop) waiting for the incoming character.

    Thanks

  • Hi,

    Thanks for the additional information. Can you check if any Error flag is getting set in SCIRXST register? 

    Please check section 13.14.2.6 SCIRXST Register of F28069 device TRM. There are different flags to indicate Error in Rx status. Please see if any of those is getting set, when it does not work. 

    Regards,

    Sudharsanan