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.

Fixing location of codestart in FLASH

Other Parts Discussed in Thread: TMS320F28054, CONTROLSUITE

Hi,

I'm using TMS320F28054 and CCS6.

The built-in bootloader jumps to location 0x3F,7FFE.  This location is normally programmed with a jump to “codestart” which is located in the .text section, but in my case 0x3F,7FFE will be replaced with a jump to a custom bootloader.    I would like the bootloader when done to be able to jump to codestart.    But the application linker doesn't put codestart at a fixed location in FLASH.  In my case sectors C thru H are used for the application, and the linker puts codestart in the .text section in sector F.

Can codestart be placed at a fixed location at the beginning of the sector C_H application block, or fixed anywhere in the application sectors?

If the location of codestart can’t be fixed, can the linker put a jump to codestart at a fixed location in the application?  Similar to the jump to codestart that is normally put at 0x3F,7FFE, but in my case is overwritten with the jump to bootloader.

I’ve tried different linker methods discussed in the forum and documentation, but nothing seems to work and I am struggling with the syntax in F28054M.cmd.

Thanks

SECTIONS
{/* Allocate program areas: */

.cinit : > FLASHC_H PAGE = 0
.pinit : > FLASHC_H, PAGE = 0
.text : > FLASHC_H PAGE = 0
codestart : > BEGIN PAGE = 0

  • RLetizia,

    Yes, you can put code start section any where in flash.

    In ControlSuite example, you have two locations reserved for BEGIN in last 2 locations of Sector A

    BEGIN : origin = 0x3F7FFE, length = 0x000002 /* Part of FLASHA.

    Now, you can easily change to say start address of Sector C by

    BEGIN : origin = 0x3F4000, length = 0x000002 /* Part of FLASHC
    &
    FLASHC : origin = 0x3F4002, length = 0x001FFE /* Remaining part of FLASHC

    Regards,
    Manoj
  • Hi Manoj,

    Thanks for the reply.    It wasn't too clear in my post, but I wanted to have the jump to initialization code stay at 0x3F7FFE (BEGIN : orgin = 0x3F7FFE) but also have the initialization code at a fixed location in the application FLASH block, or a second jump to the initialization code at a fixed location in the application FLASH block.

    I was able to place a second jump to the initialization code at a fixed location by defining a new sector "codestart2" and placing it at BEGIN2, with assembly code to jump to the initialization code added in the new section "codestart2".

    Thanks.

    BEGIN2 : orgin = 0x3EA000, length = 0x000002     / 1st two bytes of application FLASH

    FLASHC_H : origin = 0x3EA002, length = 0x00BFFD /* Application start */

    codestart : > BEGIN PAGE = 0 /* "codestart" is placed @ fixed location (F28054 bootloader jumps here) */
    codestart2 : > BEGIN2 PAGE = 0 /* "codestart2" is placed @ fixed location (our bootloader jumps here) */

    //Added in CodeStartBranch.asm

    .sect "codestart2"

    code_start2:
    .if WD_DISABLE == 1
    LB wd_disable ;Branch to watchdog disable code
    .else
    LB _c_int00 ;Branch to start of boot.asm in RTS library
    .endif

  • Great to know your issue is resolved. Thanks for posting the solution. This should other community members in future.