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.

Automatically upload binary files (CCS 5.5)

I'm debugging a custom board and its firmware and i have to load a variety of binary files using Tools->Load memory

Is there any way to automate the process with some C++ function? It's possible to use the standard C++ function to open/load files?

  • hello,
    The default and recommend way to automate debug actions in CCS is to use javascript and DSS:
    http://processors.wiki.ti.com/index.php/Debug_Server_Scripting

    Thanks
    ki
  • The DSS example of most interest is the "MemoryDump.js" example in: <CCSv6 INSTALL DIR>\ccsv6\ccs_base\scripting\examples\DebugServerExamples

    It shows an example of the memory.loadRaw API which is used to load binary files.

    ki
  • Thanks for you answer
    I'll try it.

    In these days i've also tryied to use C++ Function fopen and fread and this is my code

    FILE * pFile;
    pFile = fopen ( "TxText.bin" , "rb" );
    if (pFile != NULL)
    {
    fseek (pFile , 0 , SEEK_END);
    UINT32 lSize = ftell (pFile);
    rewind (pFile);
    UINT8* pBuffer = (UINT8*)0x0c000000;
    size_t result = fread(pBuffer, 1, lSize, pFile);
    fclose (pFile);
    }

    I'm trying to load TxText.bin into shared memory but executing this code i see that the file is open correctly (pFile != NULL and lSize is correct) but it's content is not copied in the shared memory (result = 0)

  • There are a lot of "gotchas" when trying to use C I/O. Have you seen the below wiki article?
    processors.wiki.ti.com/.../Tips_for_using_printf

    It addresses many of the "gotchas".

    Thanks
    ki
  • Ok i've resolved.
    The problem was that i was using a heap size too small... Now it's working correctly