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.

Programming application file via Flash_Program () function(Flash2806x_API_Library)

Dear support,

we have Piccolo 28069 biootLoader that placed into the sections(A-C) and application that placed into the sections(D-H). all work filne if we burn application from the debugger.
I build application in out format and get file size 1.5 mb that can not be programmed via Flash_Program () function from Flash2806x_API_Library.h ( the application size is very large).

if I convert *.out file to image by using hex2000.exe --load_image --section_name_prefix  parameters,  the file that i get looks much better (its size is 117k) but i have to build an image that take only H-D sectors.  Is it possible to do it?

What application file format should be used for programming application via Flash_Program () function?

Thanks,Sabina

 

  • Sabina Greenberg101872 said:
    we have Piccolo 28069 biootLoader that placed into the sections(A-C) and application that placed into the sections(D-H). all work filne if we burn application from the debugger.
    I build application in out format and get file size 1.5 mb that can not be programmed via Flash_Program () function from Flash2806x_API_Library.h ( the application size is very large).

    Sabina,

    If I understand,  the size parameter of the Flash_Program() function seems to be what is limiting you?

    The debugger also uses the flash programming API.  It splits the data to be programmed into buffered chunks and sends each chunk to the flash program function.  For example it could use a buffer of 0x1000 words.  The 0x1000 words would be programmed, the buffer refilled and the next 0x1000 words programmed. 

    I think there is some confusion on the size of the .out file.  The size of the .out is indeed related to the application size, but it also includes a lot of other information (example source-code debug information) used by Code Composer Studio so it is much larger than just the application.  Your programmer would need to extract the application data from the .out file.

    The hex utility is one option for extracting the application information from the .out file.

    Sabina Greenberg101872 said:
    but i have to build an image that take only H-D sectors.  Is it possible to do it?

    This may be what you are looking for? http://processors.wiki.ti.com/index.php/Combining_executable_files

    Regards,

    Lori

  • Hi Lori,

    My command is the following:
    hex2000.exe  --load_image  --section_name_prefix=FLASH_SECTION PiccoloAppSectorsC_H.out -o PiccoloAppSectorsC_H.im

    Now the size of the PiccoloAppSectorsC_H.im is 115K that is OK.
    Could I programm this file by using Flash_Program () function start from address 0x3df000?

    It seems that i missed something, because after programming i don't see any address in the entry point in the 0x3E8076

    in CMD file:

    MEMORY
    {
    PAGE 0 :   /* Program Memory */

        L03SARAM    : origin = 0x008000, length = 0x002000     /* on-chip RAM block L0-L3 */
        OTP         : origin = 0x3D7800, length = 0x000400     /* on-chip OTP */
    //sectorD
        FLASH         : origin = 0x3D8000, length = 0xFF80     //sectors -H-D    /* on-chip FLASH */
        CSM_RSVD    : origin = 0x3E8000, length = 0x000076     /* Part of FLASHD.  Program with all 0x0000 when CSM is in use. */
        BEGIN       : origin = 0x3E8076, length = 0x000002     /* Part of FLASHD.  Used for "boot to Flash" bootloader mode. */
        CSM_PWL     : origin = 0x3E8078, length = 0x000008     /* Part of FLASHD.  CSM password locations in FLASHA */

     

        FPUTABLES   : origin = 0x3FD860, length = 0x0006A0     /* FPU Tables in Boot ROM */
        IQTABLES    : origin = 0x3FDF00, length = 0x000B50     /* IQ Math Tables in Boot ROM */
        IQTABLES2   : origin = 0x3FEA50, length = 0x00008C     /* IQ Math Tables in Boot ROM */
        IQTABLES3   : origin = 0x3FEADC, length = 0x0000AA    /* IQ Math Tables in Boot ROM */

        ROM         : origin = 0x3FF3B0, length = 0x000C10     /* Boot ROM */
        RESET       : origin = 0x3FFFC0, length = 0x000002     /* part of boot ROM  */
        VECTORS     : origin = 0x3FFFC2, length = 0x00003E     /* part of boot ROM  */


    PAGE 1 :   /* Data Memory */

        M01SARAM    : origin = 0x000000, length = 0x000800     /* on-chip RAM block M0, M1 */
        PIEVECT     : origin = 0xD00,    length = 0x100
        L46SARAM    : origin = 0x00A000, length = 0x006000     /* on-chip RAM block L4-L6 */
        L78SARAM    : origin = 0x010000, length = 0x004000     /* on-chip RAM block L7, L8 */  
     }

    /*
     *  Allocate sections to memory blocks.
     *  Note:
     *      codestart   user defined section in DSP28_CodeStartBranch.asm
     *                  used to redirect code execution when booting to flash
     *
     *      ramfuncs    user defined section to store functions that will be
     *                  copied from Flash into RAM
     */
     
    SECTIONS
    {


        /* Allocate program areas: */
        .cinit              : > FLASH       PAGE = 0
        .pinit              : > FLASH       PAGE = 0
        .text               : > FLASH       PAGE = 0

        codestart           : > BEGIN       PAGE = 0

        ramfuncs            : LOAD = FLASH      PAGE = 0,
                              RUN  = L03SARAM   PAGE = 0,
                              LOAD_START(_RamfuncsLoadStart),
                              LOAD_SIZE(_RamfuncsLoadSize),
                              LOAD_END(_RamfuncsLoadEnd),
                              RUN_START(_RamfuncsRunStart)

        csmpasswds          : > CSM_PWL     PAGE = 0
        csm_rsvd            : > CSM_RSVD    PAGE = 0

     

        FLASH_SECTION          :> FLASH,         PAGE = 0
        /* Allocate uninitalized data sections: */
        .stack              : > M01SARAM | L46SARAM                 PAGE = 1
        .ebss               : > M01SARAM | L46SARAM                 PAGE = 1
        .esysmem            : > L78SARAM | L46SARAM | M01SARAM      PAGE = 1
        .cio                : > L78SARAM | L46SARAM | M01SARAM      PAGE = 1

        /* Initalized sections go in Flash */
        /* For SDFlash to program these, they must be allocated to page 0 */
        .econst             : > FLASH       PAGE = 0
        .switch             : > FLASH       PAGE = 0
        .args               : > FLASH       PAGE = 0

        /* Allocate IQ math areas: */
        IQmath              : > FLASH       PAGE = 0            /* Math Code */
        IQmathTables        : > IQTABLES    PAGE = 0, TYPE = NOLOAD

        /* Allocate FPU math areas: */
        FPUmathTables       : > FPUTABLES   PAGE = 0, TYPE = NOLOAD

          /* .reset is a standard section used by the compiler.  It contains the */
       /* the address of the start of _c_int00 for C Code.   /*
       /* When using the boot ROM this section and the CPU vector */
       /* table is not needed.  Thus the default type is set here to  */
       /* DSECT  */
       .reset              : > RESET,      PAGE = 0, TYPE = DSECT
        vectors            : > VECTORS,    PAGE = 0, TYPE = DSECT


    }

     

     

    Thanks,Sabina
     



  • Hi Lori,

    Could you please answer on the following question:
    Is it possible to programm to the FLASH memory image file (without parsing) or we HAVE TO create hex file and parse it before programming?

    We created an image file PiccoloAppSectorsC_H.im  by using the following command

    hex2000.exe  --load_image  --section_name_prefix=FLASH_SECTION PiccoloAppSectorsC_H.out -o PiccoloAppSectorsC_H.im

    and programm it by using Flash_Program () function starting from the specific address 0x3d8000.

    I compared the flash memory after loading PiccoloAppSectorsC_H.out from CCS(loadProgramm option)  and after programming PiccoloAppSectorsC_H.im by using Flash_Program () function.

    The flash looks absolutly differently in both cases.

    Thanks,Sabina

  • Sabina,

    I need a bit more background information on how your programming solution works.

    How are you reading the PiccoloAppSectorC_H.im file and sending it to the Flash_Program() function?  Have you created a flash programmer that runs on a PC?

    Reading the documentation description of --load_image it produces an object file.  This isn't a plain text file from my understanding.  So the format of this file would have to be understood by any programmer on the PC. 

    Thank you

    Lori

  • Hi Lori,

    We send prom PC PiccoloAppSectorC_H.im file as is and Piccolo device get it via CAN communication protocol. We use Flash_Program () function from Flash2806x_API_Library in Piccolo device and save this file on the flash without any changes.

    Could we produce an image file  that could be programming without any parsing?

    Thanks,Sabina 

  • Sabina Greenberg101872 said:
    We send prom PC PiccoloAppSectorC_H.im file as is and Piccolo device get it via CAN communication protocol.

    Sabina,

    The --load_image file is an object file that contains addresses and initialized sections.  I am going to guess that the host programmer (CAN on a PC or?) probably can't read and interpret this file.

    Perhaps it could read an ascii hex file?  If so you can try generating that format.  Using --image --fill could provide the continuous range of memory along with the ROMs directive.  I think this still has some address information in the file that your programmer will have to take care of. 

    -Lori