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.

TMS320F280049C: .CINIT of application did not initialized when merged hex file of application and bootloader was flashed.

Part Number: TMS320F280049C

I have 2 ccs projects, Application and Bootloader.

Booatloader Flash memory is from 0x080000 to 0x081FFF

Application Flash memory is from 0x082000 to 0x08FFFF

I successfully merged them using -load_image and created a single hex file for them.

but after i load it in the control card, it can jump from bootloader main to application main loop but the .cinit of application did not initialized.

Application side cannot read datas in the .cinit of application. 

the one i monitor is the .cinit.Cla1ToCpuMsgRam.load of application.map

Please see attached link.cmd and map files of bootloader and application.

Can you help me with this?

  • Application Flash Lnk cmd

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    MEMORY
    {
    PAGE 0 :
    /* BEGIN is used for the "boot to SARAM" bootloader mode */
    BEGIN : origin = 0x082000, length = 0x00004
    RAMM0 : origin = 0x0000F3, length = 0x00030D
    RAMLS0 : origin = 0x008000, length = 0x000800
    RAMLS12 : origin = 0x008800, length = 0x001000
    RAMLS3 : origin = 0x009800, length = 0x000800
    RAMLS4 : origin = 0x00A000, length = 0x000800
    //RAMLS7 : origin = 0x00B800, length = 0x000800
    RESET : origin = 0x3FFFC0, length = 0x000002
    /* Flash sectors */
    /* BANK 0 */
    // FLASH_BANK0_BOOT : origin = 0x080000, length = 0x002000 /* on-chip Flash */
    // FLASH_BANK0_APP : origin = 0x082004, length = 0x00DFFB, fill = 0xFFFF /* on-chip Flash */
    FLASH_BANK0_SEC0 : origin = 0x080000, length = 0x001000 /* on-chip Flash */
    FLASH_BANK0_SEC1 : origin = 0x081000, length = 0x001000 /* on-chip Flash */
    FLASH_BANK0_SEC2 : origin = 0x082004, length = 0x000FFC, fill = 0xFFFF /* on-chip Flash */
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Bootloader Flash Lnk cmd

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    //
    // Keep the _bankSelect symbol
    //
    MEMORY
    {
    PAGE 0 :
    /* BEGIN is used for the "boot to SARAM" bootloader mode */
    BEGIN : origin = 0x080000, length = 0x000002
    RAMM0 : origin = 0x000008, length = 0x0003F8
    RAMLS0 : origin = 0x008000, length = 0x000800 /* 2kWord, for CLA code */
    RAMLS1 : origin = 0x008800, length = 0x000800
    //RAMLS3 : origin = 0x009800, length = 0x000800
    //RAMLS4 : origin = 0x00A000, length = 0x000800
    RAMLS34 : origin = 0x009800, length = 0x001000
    RESET : origin = 0x3FFFC0, length = 0x000002
    /* Flash sectors */
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Application Map

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    ******************************************************************************
    TMS320C2000 Linker PC v21.6.0
    ******************************************************************************
    >> Linked Wed Feb 15 10:04:20 2023
    OUTPUT FILE NAME: <application.out>
    ENTRY POINT SYMBOL: "code_start" address: 00082000
    MEMORY CONFIGURATION
    name origin length used unused attr fill
    ---------------------- -------- --------- -------- -------- ---- --------
    PAGE 0:
    RAMM0 000000f3 0000030d 00000000 0000030d RWIX
    RAMLS0 00008000 00000800 000007a0 00000060 RWIX
    RAMLS12 00008800 00001000 00000134 00000ecc RWIX
    RAMLS3 00009800 00000800 00000000 00000800 RWIX
    RAMLS4 0000a000 00000800 00000000 00000800 RWIX
    DCSM_OTP_Z1_LINKPOINT 00078000 0000000c 00000000 0000000c RWIX
    DCSM_OTP_Z1_GPREG 0007800c 00000004 00000002 00000002 RWIX
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Bootloader Map

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    ******************************************************************************
    TMS320C2000 Linker PC v21.6.0
    ******************************************************************************
    >> Linked Wed Feb 15 10:04:48 2023
    OUTPUT FILE NAME: <bootloader.out>
    ENTRY POINT SYMBOL: "code_start" address: 00080000
    MEMORY CONFIGURATION
    name origin length used unused attr fill
    ---------------------- -------- --------- -------- -------- ---- --------
    PAGE 0:
    RAMM0 00000008 000003f8 000003f8 00000000 RWIX
    RAMLS0 00008000 00000800 00000000 00000800 RWIX
    RAMLS1 00008800 00000800 00000000 00000800 RWIX
    RAMLS34 00009800 00001000 00000a59 000005a7 RWIX
    BEGIN 00080000 00000002 00000002 00000000 RWIX
    FLASH_BOOT 00080002 00001ffe 00001553 00000aab RWIX
    FLASH_BANK0_SEC2 00082000 00001000 00000000 00001000 RWIX
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hello Jan,

    One of our compiler tools experts will respond to this question shortly.

    Thanks,
    Ibukun

  • Hello Jan,

    For a little more background, could you share exactly how you are branching from your bootloader program to your application?

    Best regards,
    Ibukun

  • Hi Ibukun,

    I already resolve the problem sorry for late notice. 
    the problem is in the f28004x_codestartbranch.asm, i am directly calling the main function instead of _c_int00 which will execute the .cinit. please see code below.

    ***********************************************************************
    * Function: wd_disable
    *
    * Description: Disables the watchdog timer
    ***********************************************************************
    .if WD_DISABLE == 1

    .text
    wd_disable:
    SETC OBJMODE ;Set OBJMODE for 28x object code
    EALLOW ;Enable EALLOW protected register access
    MOVZ DP, #7029h>>6 ;Set data page for WDCR register
    MOV @7029h, #0068h ;Set WDDIS bit in WDCR to disable WD
    EDIS ;Disable EALLOW protected register access
    ;LB _c_int00 ;Branch to start of boot._asm in RTS library
    LCR main

    ; Cleanup and exit. At this point the EntryAddr
    ; is located in the ACC register
    LB ExitBoot
    .endif

    ;end wd_disable

    I reverted it back to "LB _c_int00"

    then I change the implementation of jump from bootloader to application through the code below.


    For jump in application: 
    asm(" LB 0x082000 ")

    For jump in bootloader:
    asm(" LB 0x080000 ")

    This code works and able to execute .cinit as well. 
    Thank you for your response in my question.
    I will mark this as resolved.


    Best Regards,
    Jan