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.

TMS570LC4357: Load symbols for bootloader when debugging an External Makefile/Running applications over EMIF.

Part Number: TMS570LC4357
Other Parts Discussed in Thread: UNIFLASH

I have a bootloader which is compiled using IAR EWARM on Windows generating an ELF file.

I want to debug an application compiled using CCS/gcc on Linux and debug on Linux.

Is there any way I can load the symbols of the bootloader when I download the application.

On EWARM, it is possible to load a few extra ELF files, without actually flashing the result.

Is it a problem, that the ELF file is compiled under Window?

=====================

My application should be stored in a parallel flash @0x60000000, but
executed from external SRAM @0x64000000.

Can you download an application to external flash using CCS?

IAR only supports downloading to internal flash, but they have a flashloader which is provided in source code
so you can add functionality to allow programming whatever.

Currently, I download the application to External RAM, then I start the bootloader which can program the application
into the flash. This is because the application has a header, and I want to do a CRC check before I program into flash.

So how can I program in the application into external SRAM/Flash with CCS?

  • Hello Ulf,

    I has no experience of using CCS on Linux. 

    In windows CCS, we can download the symbol of he application. The Uniflash is able to download multiple application images to the flash. I am not sure if the elf generated by windows ccs can be used by the Linux ccs.

    The CCS or IAR Workbench use TI F021 flash APIs for loading the application to internal flash. It doesn't load the image to external memory. 

  • CCS under Linux is similar to the Windows version.
    I have a Makefile project which generates an ELF file.
    This should be downloaded to the target.

    On top of that, I want the symbols from another ELF file to be loaded when I start debugging the first file.
    You do not want to flash that ELF file but symbols and source level debugging should be available.

    If you can tell me how this is done when both ELF files are generated with CCS on Windows that will be a good start.

    ==========

    The way the IAR EWARM works is that when you start debugging, the C-Spy Debugging options use a Flashloader.

    The flashloader is a TMS570 application linked with F021 which executes out of SRAM

    It Supports FlashInit, FlashErase, FlashWrite calls where the two latter handle a sector at a time.
    C-Spy will setup a stack and call these routines as needed passing data in other parts of the SRAM.
    If your program fits into 256 kB C-Spy will call FlashErase 4 times and then FlashWrite 4 times and
    after that your flash is programmed.

    IAR delivers the Flashloader in source code. This means that you can do whatever.
    I  have extended the IAR flashloader so I can load a program into our external SRAM,
    into our external CFI flash and into an SPI flash. It supports sending out status information
    on a serial port during the programming.

    If the CCS uses the F021 library to program the device, then CCS must use a similar way
    and first download an application. CCS supports debugging other devices as well,
    including high end processors which stores the program in flash, but executes
    out of DRAM.

    If CCS uses an application similar to the IAR flashloader, is that available in source code
    so I can do similar modifications allowing me to debug applications loaded into external SRAM?

    ======================================================

    I enclose the setup for the IAR EWARM to do this.

    Here I just add some Macro files that allows me to fix quirks when loading to SRAM

    I override the IAR standard flashloader with my own which can download to external memory

    I tell C-Spy that I want the symbols for the bootloader.

    The application has an ENTRY point in external SRAM. C-Spy will after loading the program and applying reset
    force the program counter to the ENTRY point without running the bootloader. I do not want that,
    so this option does not change the PC, which is forced to 0x00000000 at reset.

    So how can I do similar things with CCS?

  • Hello Ulf,

    I will forward your questions to CCS forum. You may get help from the experts there. 

  • Ulf Samuelsson said:

    CCS under Linux is similar to the Windows version.
    I have a Makefile project which generates an ELF file.
    This should be downloaded to the target.

    On top of that, I want the symbols from another ELF file to be loaded when I start debugging the first file.
    You do not want to flash that ELF file but symbols and source level debugging should be available.

    If you can tell me how this is done when both ELF files are generated with CCS on Windows that will be a good start.

    You can load the ELF symbols from your Windows build environment to the CCS Debugger on your Linux machine. That is not an issue. There are two options. One is to use the option to "Load Symbols" (under the "Run -> Load" menu). This will remove any existing symbols already loaded and then load the new symbols. However if you wish to keep any loaded symbols intact, you can use the "Add Symbols" option (under the same menu). This will load the symbols while keeping any existing symbols still loaded.

    If you want to automate the action of loading/adding other symbols when starting a debug session for the first file, you can add this to your GEL startup file, either in StartUp or OnTargetConnect callback functions using GEL_SymbolAdd.

    Ulf Samuelsson said:
    Can you download an application to external flash using CCS?

    CCS (or UniFlash) does not natively support programming of external flash. 

    Ulf Samuelsson said:
    If CCS uses an application similar to the IAR flashloader, is that available in source code
    so I can do similar modifications allowing me to debug applications loaded into external SRAM?

    I will defer to the device experts on this question.

    Thanks

    ki

  • Ki said:
    Ulf Samuelsson
    If CCS uses an application similar to the IAR flashloader, is that available in source code
    so I can do similar modifications allowing me to debug applications loaded into external SRAM?

    Hi Ulf,

    No, there is no source code available for users.

  • I think you should raise this as an issue.

    What is the use of external memory, if you cannot program it?

  • Thanks,

    This should make it possible to debug once I solved some other problems.

    My XDS200 is not connecting for some reason, and minicom needs to run at 921,600 BAUD,

    in order to get decent programming speed.