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.

Run Bootloader from RAM

Other Parts Discussed in Thread: HALCOGEN, TMS570LS0432

Hello,

I'm working on a CAN bootloader for TMS570LS0432. The example code was not easily ported into a CCS6 project, so I am rebuilding the bootloader application with CCS6 and HALCoGen. My question is:

How do I get the bootloader to appropriately run from RAM such that I can erase and reprogram the flash bank. All that I see is a call to _copyAPI2RAM_() before entering main. Is this the only modification needed in my application?

Thanks

  • I think I've gained some more insight as to what needs to be done to run from RAM.

    Changes need to be made in the linker file as well. The MEMORY directive section I took from the example

    MEMORY
    {
    VECTORS (X) : origin=0x00000000 length=0x00000020
    FLASH_API (RX) : origin=0x00000020 length=0x000014E0
    FLASH0 (RX) : origin=0x00001500 length=0x0005EB00 //LS04x and RM42 Flash size is 0x60000
    SRAM (RW) : origin=0x08002000 length=0x00006000 //LS04x and RM42 SRAM size is 0x8000
    STACK (RW) : origin=0x08000000 length=0x00002000

    }

    The SECTIONS directive section I also took from the example (with slight modification)

    SECTIONS
    {
    .intvecs : {} > VECTORS
    flashAPI :
    {
    ..\Debug\source\Fapi_UserDefinedFunctions.obj (.text)
    ..\Debug\source\bl_flash.obj (.text)
    --library= F021_API_CortexR4_BE.lib < FlashStateMachine.IssueFsmCommand.obj
    FlashStateMachine.SetActiveBank.obj
    FlashStateMachine.InitializeFlashBanks.obj
    FlashStateMachine.EnableMainSectors.obj
    FlashStateMachine.IssueFsmCommand.obj
    FlashStateMachine.ScaleFclk.obj
    Init.obj
    Utilities.CalculateEcc.obj
    Utilities.WaitDelay.obj
    Utilities.CalculateFletcher.obj
    Read.MarginByByte.obj
    Read.Common.obj
    Read.FlushPipeline.obj
    Read.WdService.obj
    Async.WithAddress.obj
    Program.obj > (.text)
    } load = FLASH_API, run = SRAM, LOAD_START(api_load), RUN_START(api_run), SIZE(api_size)
    .text : {} > FLASH0
    .const : {} > FLASH0
    .cinit : {} > FLASH0
    .pinit : {} > FLASH0
    .bss : {} > SRAM
    .data : {} > SRAM
    .sysmem : {} > SRAM
    }

    This leads me to 2 questions:

    1) I can't follow the syntax of the "flashAPI: ..." excerpt above. Is this taking the F021_API_CortexR4_BE.lib library, and the text sections of those various object files, and calling this now the flashAPI section? Then in the bootloader application, we must copy over the flashAPI section with _copyAPI2RAM_() or a similar function?

    2) I'm getting build warnings "#10068-D no matching section" for the following three lines, and I can't seem to figure out what that means.
    ..\Debug\source\Fapi_UserDefinedFunctions.obj (.text)
    ..\Debug\source\bl_flash.obj (.text)
    --library= F021_API_CortexR4_BE.lib < FlashStateMachine.IssueFsmCommand.obj...

    Thanks
  • Hello matt,

    I will have one of our Flash API experts to help you on this.
  • Hello Matt,

    Following are the response to your queries:

    1. Yes, you are right. It creates a new "flashAPI" section. This section must be copied with _copyAPI2RAM_() or any similar function.

    2. You can check the map file to see if these sections are generated and included in the "flashAPI" section. 

    For additional info, you can refer the following posts

    http://e2e.ti.com/support/microcontrollers/hercules/f/312/p/195611/700678

    http://e2e.ti.com/support/microcontrollers/hercules/f/312/t/62954

    Best Regards,

    Siddharth