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 programming

Other Parts Discussed in Thread: UNIFLASH, TMS570LS3137, SEGGER

Hi

I need a simple setup for flash programming, for production of prototype boards.

What do i need?

Benny.

  • hi ,

    you can use TI Uni flash tool .

    http://processors.wiki.ti.com/index.php/Category:CCS_UniFlash

    for programming options : refer this video :

    http://focus.ti.com/docs/training/catalog/events/event.jhtml?sku=OLT213022

    regards

    Nanda

  • Hello Benny,

    In addition to our UniFlash software with emulator solution mentioned by Nanda, Segger also has a simple device programming solution that supports this device.

  • Hi

    I am using a XDS100v2 & uniFlash (v3) to export the memory from a TMS570LS3137.

    Exporting ~2,3MB takes almost 2 hours. Does this sound about right? (I expect it'll take roughly the same time to program it (not including verify), but i don't have the correct program yet, so can't test it)

    I am using it in a prototype test equipment and would prefer programming to be done (alot) faster than 2 hours. 

    How fast would a XDS220 be for a file that size? 

    When we hit serial production, programming would ideally be less than 30secs. Is that achieveable and with what programmer? (I don't need debug functions, only flash erase, program & verify)

    /Palle

  • Hello Palle,

    The UniFlash team does not believe 2 hours should be a normal time.  They have requested me to see if you would generate and give to us a debug server log so they can see where the bottleneck is.  Here is the link to the wiki page that shows how to do this: http://processors.wiki.ti.com/index.php/Troubleshooting_CCSv5#CCS_Diagnostic_Logs

  • Hi John

    I only had uniflash installed, and I couldn't find any examples on enabling logging in uniflash.

    So I installed CCSv4.2.4.00033 (on the wiki page for XDS100, they only mention a free license for CCSv4: http://processors.wiki.ti.com/index.php/XDS100#Q:_Can_I_use_Code_Composer_Studio_v4_with_XDS100.3F ) and I produced attached file. 

    /Palle

    edit: I am planning on using command line from LabVIEW to program during production with uniflash.bat and I have attached a 2nd log from the -log option in uniflash dos utility.

    debugserver.zip
  • Hi Palle,

    The CCS team indicated CCS v4.2.4 is too old for them to see the info they want.  Here are the instructions they give to get the log from UniFlash:

    1)      Run command prompt

    2)      cd to the path <install\uniflash\uniflashv3\eclipse>

    3)      Set the following two environment variables to configure logging

    set TI_DS_ENABLE_LOGGING=1

    set TI_DS_LOGGING_OUTPUT=c:/path/file.log

    4)      Launch UniFlash from the command line

    They do seem to think that the bottleneck is in the XDS100v2 and a faster emulator class like the XDS200 or XDS560 would see a speed improvement, but they do not have any numbers to quantify this.

  • Hi John

    I attached the log file

    /Palle

  • Hi John

    I received a program and tried to program it and it succeeded.

    I used the uniflash.bat with the following command:  uniflash -ccxml C:/ti/TMS570/TMS570uniflash.ccxml -programBin C:/ti/TMS570/braending/sp1_es.out 0x00000000 C:/ti/TMS570/braending/ecc_sp1_es.out 0xf0400000

    which generated the following output (dos prompt clipped the output):   

    CortexR4: Finish Writing Flash @ Address 0x00227BB0 of Length 0x00007FF0
    CortexR4: Writing Flash @ Address 0x0022FBA0 of Length 0x00007FF0
    CortexR4: Verifying Flash @ Address 0x0022FBA0 of length 0x00007FF0
    CortexR4: Finish Writing Flash @ Address 0x0022FBA0 of Length 0x00007FF0
    CortexR4: Writing Flash @ Address 0x00237B90 of Length 0x00007FF0
    CortexR4: Verifying Flash @ Address 0x00237B90 of length 0x00007FF0
    CortexR4: Finish Writing Flash @ Address 0x00237B90 of Length 0x00007FF0
    CortexR4: Writing Flash @ Address 0x0023FB80 of Length 0x00007FF0
    CortexR4: Verifying Flash @ Address 0x0023FB80 of length 0x00007FF0
    CortexR4: Finish Writing Flash @ Address 0x0023FB80 of Length 0x00007FF0
    CortexR4: Writing Flash @ Address 0x00247B70 of Length 0x00007FF0
    CortexR4: Verifying Flash @ Address 0x00247B70 of length 0x00007FF0
    CortexR4: Finish Writing Flash @ Address 0x00247B70 of Length 0x00007FF0
    CortexR4: Writing Flash @ Address 0x0024FB60 of Length 0x000050BE
    CortexR4: Verifying Flash @ Address 0x0024FB60 of length 0x000050C0
    CortexR4: Finish Writing Flash @ Address 0x0024FB60 of Length 0x000050BE
    > Finish Loading.
    > Loading Binary file: C:/ti/TMS570/braending/ecc_sp1_es.out
    CortexR4: Writing Flash @ Address 0xF0400000 of Length 0x00006E57
    CortexR4: Verifying Flash @ Address 0xF0400000 of length 0x00006E58
    CortexR4: Finish Writing Flash @ Address 0xF0400000 of Length 0x00006E57
    > Finish Loading.
    > Disconnecting from target.
    <END: 14:34:45 GMT+0100 (CET)>
    <Operation Time: 430.336s>
    <Total Time: 438.742s>
     

    Now, I cannot connect to the target anymore, I get the following error no matter what I try:

    C:\ti\uniflashv3\ccs_base\scripting\examples\uniflash\cmdLine>uniflash -ccxml C:/ti/TMS570/TMS570uniflash.ccxml -operation Erase
    ***** Texas Instruments Universal Flash Programmer *****
    <START: 16:19:15 GMT+0100 (CET)>
    > Configuring the Flash Programmer with the given configuration ...
    > Flash Manager is configured for the following part: TMS570LS3137
    > Connecting to the target for Flash operations ...
    SEVERE: CortexR4: Error connecting to the target: (Error -1206 @ 0x0) Unable to
    access the DAP. Reset the device, and retry the operation. If error persists, co
    nfirm configuration, power-cycle the board, and/or try more reliable JTAG settin
    gs (e.g. lower TCLK). (Emulation package 5.1.232.0)
    SEVERE: emulation failure occurred
    SEVERE: Error connecting to the target: emulation failure occurred
    > Error connecting to target.
    <END: 16:19:20 GMT+0100 (CET)>
    <Total Time: 5.344s>

    I attached log files for the programming and the failed erase command.

    /Palle

    erasefails.zip
  • Hello Palle,

    It is possible to program the device in such a way that it prevents an emulator from accessing the device.

    The addresses where your ECC is being programmed does not line up to the addresses you are programming the Data to.  If you have ECC detection/correction enabled, you may be in a continuous ECC error loop that the emulator cannot break into. 

    Another way that will prevent accesses to the device from JTAG is an incorrectly configured PLL that causes the device to run too fast or a loop that continuously calls something like PBIST.

    You can try holding the reset button on the device until the software connects.

    Or download the latest version of CCS (with the XDS100 you will not have any issues using it), configure a project for the TMS570LS3137, connect to the device and try halting the cpu.  Once you have the CPU halted, try to just erase the device from CCS Flash Tools menu.

  • Hi John

    Thanks for the quick reply. 

    I installed CCS5.5 and made a project, but I cannot connect to the target (The same error pops up instantly), so I can't halt the cpu.  Tomorrow when I get back to the office, I'll see if I can reset the device when trying to connect.

    Regarding the addresses, along with the program, I got an example code with the addresses, but I must have misinterpreted them

    /Palle

  • Hi John

    I could not connect to the target when resetting, so I have found a new TMS570 to flash.

    The addresses I use, I got from a colleague that have been using a lauterbach to flash the same target as I am trying to flash with a XDS100v2 and uniflash, and it works fine when he does it.
    An extract from the script he is using:

    ;========================================================================
    ; Flash declaration

    FLASH.RESet
    ; Program flash
    FLASH.Create 1. 0x00000000--0x0001ffff 0x8000 TARGET Byte 0. /EraseALIAS 0xf0400000--0xf0403fff ; Bank 0
    FLASH.Create 1. 0x00020000--0x0017ffff 0x20000 TARGET Byte 0. /EraseALIAS 0xf0404000--0xf042ffff ; Bank 0
    FLASH.Create 2. 0x00180000--0x002fffff 0x20000 TARGET Byte 1. /EraseALIAS 0xf0430000--0xf045ffff ; Bank 1
    ; Program flash ECC
    FLASH.Create 1. 0xf0400000--0xf0403fff 0x1000 TARGET Byte 0. /EraseALIAS 0x00000000--0x0001ffff ; Bank 0
    FLASH.Create 1. 0xf0404000--0xf042ffff 0x4000 TARGET Byte 0. /EraseALIAS 0x00020000--0x0017ffff ; Bank 0
    FLASH.Create 2. 0xf0430000--0xf045ffff 0x4000 TARGET Byte 1. /EraseALIAS 0x00180000--0x002fffff ; Bank 1

    ;========================================================================

    I assumed that the files was supposed to be placed at the beginning and forward for both data space and ECC space. I am slightly puzzled that the filesizes are not in ratio 8:1 (as I read the user guide, there should be 64bits of data and 8bits of ECC, or am I reading it wrong? (section 2.2.3.2 (page 107) in the user guide))
    Filesizes are:
    sp1_es.out - 2,444,318 bytes
    ecc_sp1_es.out - 28,247 bytes

    John Hall said:

    The addresses where your ECC is being programmed does not line up to the addresses you are programming the Data to. If you have ECC detection/correction enabled, you may be in a continuous ECC error loop that the emulator cannot break into.

    Because the filesizes is not ratio 8:1? or else I don't understand how you can see that.

    In the datasheet page 67 + 68 for the TMS570LS3137, the 3MB flash is located at 0x0000 0000 to 0x002F FFFF and the flash data space ECC is located at 0xF040 0000 to 0xF04F FFFF, so if the files are correct, that should be the correct locations?

    I found a formula to calculate the location for the ECC in the user guide (TMS570LS31x/21x 16/32-Bit RISC Flash Microcontroller Technical Reference Manual (Rev. B)), but I don't get the addresses from the datasheet specifying the memory locations, see image below.

    I hope you can help.

    /Palle

  • The way I could tell the ECC was not lining up to your data was from this segment of your results:

    CortexR4: Verifying Flash @ Address 0x0024FB60 of length 0x000050C0
    CortexR4: Finish Writing Flash @ Address 0x0024FB60 of Length 0x000050BE
    This would give an ECC range for the data of 0xF0449F6C - 0xF044A983
    > Finish Loading.
    > Loading Binary file: C:/ti/TMS570/braending/ecc_sp1_es.out
    CortexR4: Writing Flash @ Address 0xF0400000 of Length 0x00006E57
    Where as the data range corresponding to the ECC addresses is 0x0 - 0x372B7.
     
    Based on this you either are not programming ECC for the entire data range or the addresses in the data file are off.  Unless the object files are binary only, there will be no correlation of the data file size to the ECC file size due to the file format metadata, debug symbols, etc.
     
    One way you could test that your ECC being supplied is incorrect is to enable Auto ECC Generation in UniFlash while using the data file only.
     
    Could you share the map file for your object files?
  • Map file? Is it the .gel file? Im not supplying a gel fil, just open uniflash and say "new target" and save configuration file, which im then using from commandline /Palle
  • No, a map file is not a gel file.  A map file is generated by the linker showing where in memory all the functions and symbols are placed.

  • I don't have such a file, though the guy supplying the software wrote earlier that he has another file. Lauterbach instruction is:

    FLASH.TARGET 0x08000000 0x08001000 0x1000 ~~/demo/arm/flash/byte_be/f021r4noecc.bin

    I'll have a chat with him tomorrow and see if I can figure out whats going on. 

    Thanks for helping

    /Palle

  • Hi John

    I received the following from the company delivering the software:


    The .out file will tell you. It has an elf format, so it can be read by e.g. elfdump

    monitor@tte-monitor-virtual:~/ecker/wtg_files$ readelf sp1_es.out -S

    There are 31 section headers, starting at offset 0x24fcca:

     Section Headers:

      [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
      [ 0]                   NULL            00000000 000000 000000 00      0   0  0
      [ 1] .intvecs          PROGBITS        00000000 000034 000020 00  AX  0   0  4
      [ 2] .stack            NOBITS          08000000 030d78 000000 00   A  0   0  1
      [ 3] .bss              NOBITS          08003700 030d78 030b60 00  WA  0   0  8
      [ 4] .sysmem           NOBITS          00000000 000000 000000 00      0   0  1
      [ 5] .data             NOBITS          08034260 030d78 004d34 00  WA  0   0  8
      [ 6] .osresetvect      NOBITS          00000000 000000 000000 00      0   0  1
      [ 7] .osarmvect        NOBITS          00000000 000000 000000 00      0   0  1
      [ 8] .osvtable         NOBITS          00000000 000000 000000 00      0   0  1
      [ 9] .startup          NOBITS          00000000 000000 000000 00      0   0  1
      [10] .text             PROGBITS        00003c58 003c90 021528 00  AX  0   0  4
      [11] .const            PROGBITS        0002bbb8 02bbf0 00224e 00   A  0   0  8
      [12] .cinit            PROGBITS        0002e568 02e5a0 0027d8 00   A  0   0  8
      [13] .pinit            NOBITS          00000000 000000 000000 00      0   0  1
      [14] ramfuncs          PROGBITS        0803c904 0039c4 0002c8 00  AX  0   0  4
      [15] .update           PROGBITS        08038f94 000054 003970 00  AX  0   0  4
      [16] .CSM_VAR          NOBITS          0803cbcc 030d78 000230 00  WA  0   0  4
      [17] .csm_const        PROGBITS        0002de08 02de40 000760 00   A  0   0  4
      [18] .csm_code         PROGBITS        00025180 0251b8 006a34 00  AX  0   0  4
      [19] .debug_info       PROGBITS        00000000 030d78 12808f 00      0   0  1
      [20] .debug_line       PROGBITS        00000000 158e07 02b90b 00      0   0  1
      [21] .debug_frame      PROGBITS        00000000 184712 00e659 00      0   0  1
      [22] .debug_abbrev     PROGBITS        00000000 192d6b 01e194 00      0   0  1
      [23] .debug_aranges    PROGBITS        00000000 1b0eff 0003a0 00      0   0  1
      [24] .debug_str        PROGBITS        00000000 1b129f 042bea 00      0   0  1
      [25] .debug_pubtypes   PROGBITS        00000000 1f3e89 002819 00      0   0  1
      [26] .ARM.attributes   ARM_ATTRIBUTES  00000000 1f66a2 000061 00      0   0  0
      [27] .symtab           SYMTAB          00000000 1f6704 035c30 10     29 12525  0
      [28] .TI.section.flags PROGBITS        00000000 22c334 00002d 00      0   0  0
      [29] .strtab           STRTAB          00000000 22c361 023777 01   S  0   0  0
      [30] .shstrtab         STRTAB          00000000 24fad8 000132 01   S  0   0  0
    Key to Flags:
      W (write), A (alloc), X (execute), M (merge), S (strings)
      I (info), L (link order), G (group), T (TLS), E (exclude), x (unknown)
      O (extra OS processing required) o (OS specific), p (processor specific)


    So that's the map file, right? Do I need a different layout to be able to use uniflash? (The .ecc file have the same setup) 
    /Palle
  • Palle,

    That list does not show any ECC address ranges.  I need a map of the complete data and ECC being programmed into the device.

  • Benny,

    You could use UniFlash and a JTAG emulator for a simple setup.  You could also look at tools from Segger.

  • Hi John

    for the .ecc file


    And for the .ecc file:

     monitor@tte-monitor-virtual:~/ecker/wtg_files$ readelf ecc_sp1_es.out -S

    There are 3 section headers, starting at offset 0x620d:
     
    Section Headers:
      [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
      [ 0]                   NULL            00000000 000000 000000 00      0   0  0
      [ 1] .ecc0             PROGBITS        f0400000 000054 0061a8 00   A  0   0  0
      [ 2] .shstrtab         STRTAB          00000000 0061fc 000011 00      0   0  0
    Key to Flags:
      W (write), A (alloc), X (execute), M (merge), S (strings)
      I (info), L (link order), G (group), T (TLS), E (exclude), x (unknown)
      O (extra OS processing required) o (OS specific), p (processor specific)

      So, the program starts at address 0x0 and the ecc section at 0xf0400000.

     Anyway, I don’t know which tool you are using or plan to use, but it should be able to get that information from the ELF file itself. And it actually should get this information from the ELF file itself.


    Can uniflash read that elf-header in the .out files?

    /Palle

  • UniFlash understands ELF files.  Data and ECC sizes correlate.

    The only thing I can think of that you are having an issue re flashing the device is due to the code previously flashed preventing JTAG from taking control of the device.

  • Hi John

    Ok, so I do not have to specify the addresses? Then I think that is the problem. I used the following command on the target that I cannot contact now:

    uniflash -ccxml C:/ti/TMS570/TMS570uniflash.ccxml -programBin C:/ti/TMS570/braending/sp1_es.out 0x00000000 C:/ti/TMS570/braending/ecc_sp1_es.out 0xf0400000

    where the correct command would be:

    uniflash -ccxml C:/ti/TMS570/TMS570uniflash.ccxml -program C:/ti/TMS570/braending/sp1_es.out C:/ti/TMS570/braending/ecc_sp1_es.out

    Is that correct?

    /Palle

  • Hi John

    Success!  Thanks alot for helping me figure out what was wrong. 

    /Palle

  • Hi Palle,

    That great.  Sorry it took so long to figure it out.