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.

TMS320F28069F: how to resolve linker error for adding ALIGN(4) at codestart in cmd file

Part Number: TMS320F28069F

Dear TI members

I have modified F28069F.cmd file as follows

SECTIONS
{

   /* Allocate program areas: */
   .cinit              : > FLASHA_B,   PAGE = 0, ALIGN(4)
   .pinit              : > FLASHA_B,   PAGE = 0, ALIGN(4)
   .text               : > FLASHA_B,   PAGE = 0, ALIGN(4)
   codestart           : > BEGIN,      PAGE = 0, ALIGN(4)
   ramfuncs            : LOAD = FLASHF, /* FLASHD -> FLASHF */
                         RUN = RAML0_1,
                         LOAD_START(_RamfuncsLoadStart),
                         LOAD_END(_RamfuncsLoadEnd),
                         RUN_START(_RamfuncsRunStart),
                         PAGE = 0, ALIGN(4)

then  I have encountered linker error as follows

"../F28069F.cmd", line 126: error #10099-D: program will not fit into available
memory. placement with alignment/blocking fails for section "codestart"
size 0x2 page 0. Available memory ranges:
BEGIN size: 0x2 unused: 0x2 max hole: 0x2

This error could be disappeared by removing ALIGN(4) from the codestart line,

but I have to add ALIGN(4) at end of line in codestart for requirement of debugging tool 

would you please let me know how to avoid linker error ?

Thanks in advance.

Best Regards,

Hae Ryong

  • Hi,

    What is the start address of BEGIN section you are using? Is it aligned to 4 bytes?
    In your case, both the codestart size and BEGIN memory section size is 0x2. So, if our BEGIN memory section does not start with a 4 byte aligned address, linker will be unable to allocate the sections.

    Regards,
    Veena
  • Hi Veena,

    Thanks for your prompt response.

    please take a look at followings in map file
    ======================
    MEMORY CONFIGURATION

    name origin length used unused attr fill
    ---------------------- -------- --------- -------- -------- ---- --------
    PAGE 0:
    RAML0_1 00008000 00002000 00000f58 000010a8 RWIX
    OTP 003d7800 00000400 00000000 00000400 RWIX
    FLASHH 003d8000 00004000 00000000 00004000 RWIX
    FLASHG 003dc000 00004000 00000000 00004000 RWIX
    FLASHF 003e0000 00004000 00000f58 000030a8 RWIX
    FLASHA_B 003e4000 00013f80 0000a15f 00009e21 RWIX
    CSM_RSVD 003f7f80 00000076 00000000 00000076 RWIX
    BEGIN 003f7ff6 00000002 00000002 00000000 RWIX
    CSM_PWL_P0 003f7ff8 00000008 00000000 00000008 RWIX
    FPUTABLES 003fd590 000006a0 00000000 000006a0 RWIX
    IQTABLES 003fdc30 00000b50 00000b50 00000000 RWIX
    IQTABLES2 003fe780 0000008c 00000000 0000008c RWIX
    IQTABLES3 003fe80c 000000aa 00000000 000000aa RWIX
    ROM 003ff3b0 00000c10 00000000 00000c10 RWIX
    RESET 003fffc0 00000002 00000000 00000002 RWIX
    VECTORS 003fffc2 0000003e 00000000 0000003e RWIX
    ======================

    BEGIN seems not to be 4 byte aligned, how to change it ?

    Best Regards,
    Hae Ryong
  • Hi,

    I don't think changing the BEGIN start address is a good idea. I believe that address is being used by the bootloader for boot to Flash mode.
    Why do you want to have align(4) for code_start region?

    Regards,
    Veena
  • Hi,

    I am trying to use easyDSP, which is powerful debugging tool for F280x processor.

    however it requires to do it as follows

    Is there any way to fix it ?

    Best Regards,

    Hae Ryong

  • you can borrow 2 bytes from previous section. CSM_RSVD  is anyway a reserved block here. you can modify like,

    CSM_RSVD : origin = 0x3F7F80, length = 0x000074 /* Part of FLASHA.
    BEGIN          : origin = 0x3F7FF4, length = 0x000004 /* Part of FLASHA.

  • Hi,
    There is no direct method to full-fill your requirement. But you can take this approach,

    In addition to the changes i mentioned in my previous post you need to make below change as well.

    In F2838x_CodeStartBranch.asm file please make this change,

    .sect "codestart"
    .long 0xFFFFFFFF
    code_start:
    LB _c_int00 ;Branch to start of boot._asm in RTS library
  • Hi,

    Thanks for your feedback.

    I have tried modify BEGIN address directly, it did not work, device did not boot up.

    Regarding your second suggestion, since my chipset is F28069F, and my CodeStartBranch.asm file is as follows

        .sect "codestart"
    
    code_start:
        .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
    
    ;end codestart section

    Would you please apply your suggestion on this codebase again ?

    Thanks for your kind help.

  • Hi,

    YES! my device can boot up with your 1st and 2nd modification.

    Can I ask the MEANING of '.long 0xFFFFFFFF', you have added ?


    Best Regards,
    Hae Ryong
  • As Veena mentioned above 0x003f7ff6 is the starting address for flash boot mode and we cant change this, as this is hard coded in boot ROM.
    To meet your requirement of alignment i suggested to use 4 words with dummy data in first 2 words and actual code start at 0x003f7ff6.

    So '.long 0xFFFFFFFF' is just a dummy data to fill first 2 words.
  • OK, I understand.

    Thanks for your help.