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.

CCS/TMS570LC4357: The bin file of CAN bootloader is too larger.

Part Number: TMS570LC4357
Other Parts Discussed in Thread: UNIFLASH

Tool/software: Code Composer Studio

Hello,

I need to update the old bootloader with a new one. So, I am trying to make a .bin file for my bootloader code.

I have been able to successfully create a .bin file for my bootlaoder code ;  however, it's a  huge .bin file (~3.8 GB). 

I have noticed that the ECC address is at 0xF040_0000, the binary file contains the zeros filled to all the unused address among flash (0x00xxxxxx), SRAM (0x08xxxxxx) and 0xF040_0000.

But, how can I get a bin file with correct size?  My bootloader derived from the bootloader example from here: https://git.ti.com/cgit/hercules_examples/hercules_examples/tree/Bootloaders?h=qjwang_hercules_examples

Thanks.

  • Hello Chenglong,

    The binary file contains the data for the whole memory range (0x00000 to 0xF040...), so it's size is around 4GB. For bootloader, you can use CCS to generate out file and load this file using CCS or uniflash. 

    For application, our bootloader example supports binary file only. We don't generate ECC for application using linker command. The bootloader downloads the application through CAN bus, and calculate the ECC, the program the application code and its ECC to the flash. 

  • Hi,  QJ.  

    In some circumstances, the  board has been well sealed,  it is hard to update the bootloader with CCS or uniflash, since the JTAG is unreachable. So I make my plan to modify the bootloader example to support self-updating. The main problem is the huge bin file.

    Any suggestions?

  • Hi Chenglong,

    To update the bootloader itself, you don't need to program the ECC for the whole flash. You need to program the bootloader and its ECC (calculated through F021 Flash API).

    If the bootloader doesn't fit the whole flash sectors, please append 0xFFFFFFFF to the file:

    This is an example to append 0xff to one application file located in sector 4 and sector 5:

    /*----------------------------------------------------------------------------*/
    /* USER CODE BEGIN (0) */
    /* USER CODE END */


    /*----------------------------------------------------------------------------*/
    /* Linker Settings */
    --retain="*(.intvecs)"

    /*----------------------------------------------------------------------------*/
    /* Memory Map */
    MEMORY
    {
    VECTORS (X) : origin=0x00010020 length=0x00000020
    FLASH_CODE (RX) : origin=0x00010040 length=0x8000 - 0x40 fill=0xFFFFFFFF /*sector 4/5 are used for application */
    FLASH0 (RX) : origin=0x00018000 length=0x00200000 - 0x18000
    FLASH1 (RX) : origin=0x00200000 length=0x00200000
    STACKS (RW) : origin=0x08000000 length=0x00001500
    RAM (RW) : origin=0x08001500 length=0x0007EB00
    }