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.

Serial Flash Programmer is very slow and can't set baud rate.

Other Parts Discussed in Thread: TMS320F28069M, CONTROLSUITE

I'm trying to load a program to my device (TMS320F28069M) via the serial flash programmer (following this guide: www.ti.com/.../sprabv4a.pdf ).

When I run it the following way, it works, but takes about 10-20 minutes to upload:

serial_flash_programmer.exe -d f2806x -k f28069_flash_kernel.txt -a proj_lab09.txt -p COM8 -w -v

The documentation says that if I don't explicitly set the baud rate, it defaults to 9600, and that is pretty slow, so I figured I'd increase it:

serial_flash_programmer.exe -d f2806x -k f28069_flash_kernel.txt -a proj_lab09.txt -p COM8 -b 115200 -w -v

And it stops working at all. It gets stuck at "Downloading proj_lab09.txt to device...", but the LEDs that light up when I don't explicitly set the baud rate do not light up any more, and it doesn't get to the "Kernel Loaded" message which appears relatively quickly otherwise. After then I tried doing that with all different baud rates that I could think of: 9600, 38400, 57600... Nothing works.

So the question is, why doesn't it work, and how do I make the upload faster?

  • It looks like you are able to successfully load the kernel into RAM. Is this correct?

    When are you able to load the kernel successfully and when are not able to?

    sal
  • When I do not explicitly set the baud rate with -b, it works (1st example). When I set the baud rate, it stops working entirely, not even loading the kernel (2nd example).
    My problem is that it takes very long, and changing the baud rate seems to be breaking it entirely.

  • The kernel is loaded into RAM using the SCI bootloader in ROM. This bootloader is running at the internal oscillator frequency, 10MHz. 115200 is too high of a baud rate for the SCI to be able to communicate when the device is running at 10MHz. You will need to use a lower baud rate.

    The SCI bootloader is slow, but the kernel has been optimized to download and flash your application much more quickly.

    sal
  • When I set the baud rate to 9600, or even 1200, it doesn't work either. No number I tried works. And when I don't set the baud rate, the kernel loads quickly (about 10 seconds), but the program then loads for over 10 minutes (the size of proj_lab09.txt is 195 KB).

    Also I noticed that when I don't set the baud rate, D8 (red) is on all the time, and D7 (blue) flashes occasionally. And when I do set it, D8 just flashes once, and then both are off.

    Here is the output of a successful upload (took 17 minutes to complete just now):

    >serial_flash_programmer.exe -d f2806x -k f28069_flash_kernel.txt -a proj_lab09.txt -p COM8 -w -v
    
    C2000 Serial Firmware Upgrader
    Copyright (c) 2013 Texas Instruments Incorporated.  All rights reserved.
    
    getting comm state
    building comm DCB
    adjusting port settings
    
    calling f05_DownloadImage
    Downloading proj_lab09.txt to device...
    
    Kernel AutoBaud Successful
    Kernel Loaded
    Done Waiting for kernel boot...attempting autobaud
    Application AutoBaud Successful
    Application Load Successful
    Press any key to exit...
    

    And here is the output when it gets stuck:

    >serial_flash_programmer.exe -d f2806x -k f28069_flash_kernel.txt -a proj_lab09.txt -p COM8 -b 9600 -w -v
    
    C2000 Serial Firmware Upgrader
    Copyright (c) 2013 Texas Instruments Incorporated.  All rights reserved.
    
    getting comm state
    building comm DCB
    adjusting port settings
    
    calling f05_DownloadImage
    Downloading proj_lab09.txt to device...
    

  • That is unexpected. What version of controlSUITE are you using?

    Can you try running it from Visual Studio project?

    sal
  • ControlSUITE version is 3.4.2.

    Ok, so rebuilding the programmer (with VS 2012) solved the problem, at least partially. Now it works with baud rates of 38400 and lower. But it still takes 11 minutes to upload the program, which is very weird, because 195KB * 8 / 38.4Kbps = 41s. Is it normal? Is there any way to make the process any faster, so that it takes max. 3 minutes? For example by making it all run at the full 90 MHz of the CPU to allow higher baud rates?
  • There is no way to speed up the SCI bootloader.

    How long does it take to load the kernel? How long does it take to load the flash application?

    sal
  • OPT Bootloader work slow. This is normal.

    Why does the kernel loads the program so slowly. SCI can be overclocked to 1.4 Mbit. The Kernel can operate at 90 MHz.

  • serial_flash_programmer.exe -d f2806x -k f28069_flash_kernel.txt -a proj_lab09.txt -p COM8 -b 38400 -w -v

    With these settings uploading the kernel (7 KB) took 33(+-2) seconds, and the program (195 KB) took another 17 minutes (+- 10s). (The 11 min. measurement from last week was probably wrong.)

    Without the -b flag it was 32(+-2)s for the kernel and 16:45 (+-10s) for the program.

    With -b 9600 it was also 32s for the kernel and 16:45 for the program.

    Seems like the flag is being ignored entirely (which is weird, because setting the baud rate too high still breaks it). Also the upload of the program seems to be slower than the upload of the kernel: 34/7*195/60 = 15.8 min, which is less than the over 16.5 min that it actually takes.

  • To compare, I have a 268KB program and it loads kernel+program within a few minutes at 38400 baud. I would think the issue is not the kernel or serial_flash_programmer, the bottleneck is probably at the OS or hardware level. What are you using for hardware? It seems the hardware is ignoring the higher baud rate and continuing at 9600.
  • The hardware is the LaunchPadXL TMS320F28069M connected via USB (2.0) cable to the PC. The OS is windows 10 pro x64. I'm using the "USB Serial Port (COM8)" that appears in the hardware manager when I connect the board.
  • I just tested it on another PC, and it indeed loaded in under a minute.
  • Wonderful. Thanks for the collaboration from Andrew and Fulano.

    It is great when we get participation like this on the forum!

    Glad you got it working Dmitri!

    sal