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.

Compiler/TMS320F28377S: SCI Boot loader probleum

Part Number: TMS320F28377S
Other Parts Discussed in Thread: C2000WARE

Tool/software: TI C/C++ Compiler

I want to program  TMS320F28377S using SCI. For this I am using serial flash programmer provided in C2000 and rom symbole lib given in C2000. I connect SCI A (GPIO 84, GPIO85) with serial port of PC using USB to TTL. And I call "SCI_Boot(0x00)" function from main just before while(1). And from debugger I can confirm this it enter in to this function. After this I run the serial flash programmer and I getting this on command promont  

/***************************************************************************************************************************************************************************************************************************************************/

PS C:\ti\c2000\C2000Ware_1_00_06_00\utilities\flash_programmers\serial_flash_progra
mmer> ./serial_flash_programmer.exe -d f2837xS -k F2837xD_sci_flash_kernels_cpu01.
txt -a blinky_cpu01.txt -b 9600 -p COM9

C2000 Serial Firmware Upgrader
Copyright (c) 2013 Texas Instruments Incorporated. All rights reserved.

getting comm state
building comm DCB
adjusting port settings

calling f021_DownloadKernel CPU1 Kernel
Downloading F2837xD_sci_flash_kernels_cpu01.txt to device...

a==a
8==8
0==68

/**********************************************************************************************************************************************************************************************************************************************/

This is my code.

/*************************************************************************************************************************************************************************/

init_serial_a();                                                       //9600, stop bit, No loopback No parity,8 char bits

//PieCtrlRegs.PIEIER9.bit.INTx1 = 1;
//IER |= M_INT9; //Enable interrupt group 9

 run= SCI_Boot(0x00);                                                  //  Code should stop here and microcontroller enter in to boot mode 

while(1){

GpioDataRegs.GPBTOGGLE.bit.GPIO41=1;

ms(200);

}

/*************************************************************************************************************************************************************************/

To confirm the connections are correct. I configure SCI A to transmit and receive data (baud rate-9600) and test it on the putty.It work fine. So this is not the hardware problem. So please help to solve this issue

  • Please make sure the .txt file you are using to download to the device has not been opened by a text editor. Please re-build the hex file and point serial flash programmer to it without opening it.

    First try this. This may fix it since Windows appends some garbage to txt files when they are opened.

    sal
  • SAL,

    I recompile both files and try to program using them, but still I am getting same error. I also try using download new C2000 setup and use its files but result are same. Please test this at your end.
  • We have tested this. And many customers have used it successfully.

    Can you add the '-v' command line option and also perhaps try a different baud rate.

    sal
  • SAL,

    I try different baud rates (9600, 14400,56000,57600) but result are same. I also added "-v "in command and I am gating this.

    /******************************************************************************************************************************/
    PS C:\Users\sam\Desktop\serial_flash_programmer> ./serial_flash_programmer.exe -d f2837xS -k F2837xD_sci_flash_kernel
    s_cpu01.txt -a blinky_dc_cpu01.txt -b 9600 -p COM9 -v

    C2000 Serial Firmware Upgrader
    Copyright (c) 2013 Texas Instruments Incorporated. All rights reserved.

    getting comm state
    building comm DCB
    adjusting port settings

    calling f021_DownloadKernel CPU1 Kernel
    Downloading F2837xD_sci_flash_kernels_cpu01.txt to device...

    Attempting autobaud to load kernel...
    /*******************************************************************************************************************************/

    One more thing, as i told that I am calling SKI BOOT just before the while(1) but my adc interrupt is working . I think it should stopped working when microcontroller enter in boot mode? (I check this both in emulation and standalone mode)

    So please suggest

  • The interrupts should not stop working when entering the SCI bootloader function.

    It will only stop working if you erase some valuable code in RAM that is being executed. Since the boot loader programs RAM.

    OK. It appears the autobaud function is not working. So you are not properly performing the autobaud lock with the device. This is likely related to your SCI connection for communication.

    Make sure you can perform an autobaud lock with the device when it is executing the SCI bootloader function. For more information see the TRM and this AR: www.ti.com/.../sprabv4b.pdf

    sal
  • SAL,

    I tried as you suggest and I am getting this on command promont. It crosses the first step but again it is checking for autobaud. I try different baud rates (4800,9600,115200) but I always get same result.

    And as you say autobaud is not working and I  take "txt" files from their location instead of copying then by giving direct path on command promont. So please tell how to solve this.

    /*************************************************************************************************************************************************************************************/
    1f==1f
    76==76
    6d==6d
    3==3
    2==2
    8a==8a
    2a==2a
    d0==d0
    94==94
    48==48
    3==3
    ef==ef
    1==1
    9a==9a
    2==2
    6f==6f
    2==2
    9a==9a
    6==6
    0==0
    0==0
    0==0
    Bit rate /s of transfer was: 1336.853149
    Kernel loaded! Booting kernel...
    Done waiting for kernel boot...
    Attempting autobaud to send function message...
    41==bc
    Error with autobaud lock echoback... Please press Ctrl-C to abort.
    /************************************************************************************************************/

  • I am not sure what the problem could be. Can you try using a different USB cable?

    Also, can you try debugging this by loading the Kernel to the device via the debugger (CCS) and running it. Then try to load the flash application to the kernel using the Visual Studio project. Comment out the line of code which downloads the kernel, so that only the flash application is loaded since you are running the kernel on the device via CCS.

    This is a way to cut out the first half of the process, namely loading the kernel, so that you can more easily debug the kernel.

    Let me know if you get this to work by loading and running the kernel via CCS.

    sal
  • Rebuild the sciKernal example from C:\ti\c2000\C2000Ware_1_00_06_00\driverlib\f28004x\examples\flash\CCS
    and use the newly build kernel txt file with flash programmer.

    Also you can refer - 

    CCS/TMS320F280049C: TMS320F280049C - Serial Flash Programmer - C2000 microcontrollers forum - C2000™︎...

    e2e.ti.com
    Part Number: TMS320F280049C Other Parts Discussed in Thread: C2000WARE Tool/software: Code Composer Studio Hi everyone, I’d like to request a support on a example
     

  • There is only so much that can be going wrong. The device is either getting the wrong data and then sending the wrong data back. Meaning the data is corrupted on the way to the device.

    Or the data is wrong from the device to the host. Meaning the data is corrupted on the way to the host from the device.

    I suggest three things:
    1) Please run the flash kernel using CCS. Remove the loading of the kernel from the serial flash programmer this way it is not sent. Load the kernel via CCS, and run it. Then use the serial flash programmer to load the flash application. You can use both IDEs to debug this. Please do this.

    2) Try to add some reset or flush of the SCI at the very beginning of the kernel.

    3) You can also try removing the code that is not needed for single core DFU from the CPU1 kernel. You can remove the InitIPC(), and I think even the InitGPIO(), and even the InitSysCtrl(). Cut the kernel down to its bear bones and bear essentials and try to identify why the data is being corrupted.

    sal
  • SAL,

    Sorry for the delay,

    I discussed the serial flash programmer problem with Mr. Vikas (TI INDIA). and he suggested adding "SciaRegs.SCIHBAUD.bit.BAUD = 0" in SCIA_AutobaudLock() function of SCI_Getfunction.C in F2837xD_sci_flash_kernels_cpu01. But this not work (Please, note that I am using TMS320F28377S microcontroller.) Then I tried the procedure as you suggest. I removed InitIPC(), InitGPIO(), InitSysCtrl() from kernel code and run it in emulation mode. Similarly, I commented "loadProfram()" in f021_DownloadKernal.cpp of serial flash programmer and ran the code using command prompt by the command "serial_flash_programmer.exe -d f2837xD -a test_code.txt -p COM3" and it works, So please suggest further steps, How to run serial programmer in standalone mode.

  • Can you see where the device (C28) is hanging when it is not working from standalone? What LOC is the CPU executing?

    sal
  • In standalone mode, I can't see anything. And in emulation mode when I call SCI_Boot then single stepping stop working.

    And please test this on single core device (tms320f28377s) at your end so we can come on the same page. We are working on this from approx one month but still, we could not find any solution. 
       
  • Hi I got this working on the f2837xs launchpad.

    Please see attached ZIP. It is exactly what is released in C2000Ware.

    sal

    f2837xs.zip

  • Sal,

    I try your files, run it many times. I observed that kernel was loaded successfully in microcontroller (line 2) but when it attempting for autobaud (line4) then it gets reset (line 5) and finally, the error comes. This is repeated result. And I disable the watchdog timer using the function "DisableDog()"


    Mr. Vikas suggest me to add " SciaRegs.SCIHBAUD.bit.BAUD = 0" in F2837xS_sci_flash_kernel file SCI_GetFunction.c-->SCIA_AutobaudLock() but result are same.

    One more thing  I am using LaunchPadXL TMS320F28377S Ver 1.0, in this GPIO 84,85 are not available on pinout. Ther GPIO84 is used for bootloader select switch and GPIO85 is used for iso7240 IC and it is difficult to connect the wire with these pins. Please give the part no of Launchpad you are using, so I try to arrange it.

    6==6
    0==0
    0==0
    0==0
    Bit rate /s of transfer was: 1880.798340 //line1
    Kernel loaded! Booting kernel... //line2
    Done waiting for kernel boot... //line3
    Attempting autobaud to send function message... //line 4
    41==52 //line 5
    Error with autobaud lock echoback... Please press Ctrl-C to abort. //line 6

  • I am using Version 1.0 of the TMS320F28377S C2000 LaunchPad XL.

    GPIO 84/85 are pinned out to the USB connector.

    sal
  • SAL,

    I test boot loader on Launch Pad XL28377S TMS320F28377S VER 1.0. And I follow the following procedure.

    In the first step, I call boot loader in the main function and dump this program in launch pad using the debugger. Here boot configuration switch setting is sw1=High, sw2=High, sw3=High.

    void main()
    {
    InitSysCtrl();
    DisableDog();
    run= SCI_Boot(0x00);
    }

    Then I change setting boot configuration switch to sw1=High, sw2=Low, sw3=High. And then I remove LaunchPad from PC and reconnect it. Then I run the serial flash programmer but the results are same.

    /******************************************************************************************************************************/
    9==a9
    8a==8a
    48==48
    92==92
    41==41
    76==76
    f6==f6
    0==0
    84==84
    fe==fe
    6==6
    0==0
    0==0
    0==0
    Bit rate /s of transfer was: 499.217407
    Kernel loaded! Booting kernel...
    Done waiting for kernel boot...
    Attempting autobaud to send function message...
    /******************************************************************************************************************************/

    I also try by put sw3 low but this makes no effect. and there is no other external device is connected with lunchpad xl .