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.

How to specify an exact address for c_int00?

Other Parts Discussed in Thread: TMS320F28235, TMS320C6727B

Hi

Our DM648 is configured to EMIF ROM fastboot a "universal boot loader (UBL)" that loads our application. The application communicates to the PC through the serial port. For field downloads, the PC application sends a start download request. When our application sees the start download request, it will call the c_int00 of a flash burning application. The reason for the flash burning application is because it is small and frees up DDR2 memory for the new flash image.

I should also mention that the flash burning application is started by the UBL at boot if no application code is present (i.e. the "magic word" is missing because of a botched flash download).

I'd like to lock the flash burning application's c_int00 address so that its a constant in the application code. Is there a way to specify the c_int00 address?

Otherwise, my only recourse is to use the c_int00 address at the top of the .map file and ensuring that I update the c_int00 address each time the application load is built.

Thanks

 

  • I have the same question.  I fear that if I am unable to force the location of c_int00 I will be forced to write my own c_int00 and do a no-init model.  I would rather define the location for it.  I am attempting to put two images in one device and have one call the other.  I am considering the use of unused interrupt vectors to put the c_int00 address using something similar to this (mentioned before).

    extern int c_int00();

    void main( void )
    {

    int *x;
    x = (int *)&c_int00;

    }

    Except I would place the resulting address in a known location.  That may be the best way.  Not the prettiest but doable.

    Any better ideas available?

    Mark

  • You should be able to do this in your linker command file.  The general idea is to put the boot module (where _c_int00 is defined) into an output section of its own, then allocate that output section to a specific memory address.

    boot > 0x1234
    {
        -l rts64plus.lib<boot.obj>(.text)
    }

    You can change 0x1234 to be whatever address you want to put the code.  Probably the start of your RAM would be a good place so that the linker doesn’t have problems allocating other objects around it.

  • That works! Thanks a bunch Brad! You da man!

  • PS.  Make sure you assign it to reside on a 32-byte boundary, i.e. last 5 bits of address should be 0.

  • Hi Brad,

    I get the following error when I try to specify c_int_00 address:

    linker.cmd, line 37:   error: 

                   missing filename on -l

    My linker file is as below:

    -l rts64plus.lib

    -stack          0x00001000      /* Stack Size */

    -heap           0x00001000      /* Heap Size */

    MEMORY

    {

        L2RAM:      o = 0x10800000  l = 0x00020000

        DDR2:       o = 0x80000000  l = 0x10000000

    }

    SECTIONS

    {   

    .boot > DDR2

    {

    -l rts64plus.lib<boot.obj>(.text)

    }

        .text >   DDR2

        .bss        >   DDR2

        .cinit      >   DDR2

        .cio        >   DDR2

        .const      >   DDR2

        .data       >   DDR2

        .far        >   DDR2

        .stack      >   DDR2

        .switch     >   DDR2

        .sysmem     >   DDR2

        .ddr2       >   DDR2

    }

    Am I missing some thing?

     

    Thanks,

    Amit

  • Maybe it doesn't like the space.  Let me know if that fixes it and I'll edit my previous post.

  • Hi Brad,

    Brad Griffis said:

    Maybe it doesn't like the space.  Let me know if that fixes it and I'll edit my previous post.

    I fixed this. I have included the rts64plus.lib initially so by directly referring the library in SECTIONS directive as shown below fixed the error.

     

    SECTIONS

    {   

    .boot > DDR2

    {

    rts64plus.lib<boot.obj>(.text)

    }

     

    }

     

    Thanks for your support.

    -Amit

  • I am having the same problem with an MSP430 part.  Do you know the equivalent linker statements for MSP430 in Code Composer 4?

  • It's basically the same.  Instead of "DDR2" you would choose one of your MEMORY definitions for the MSP430 (or even a hard-coded address I think).  Instead of the rts64plus.lib you would have rts430.lib (or rts430x.lib, etc.).

  • I'll go ahead and toss one other variant into the mix as well.  If you're using BIOS then it supplies its own version of c_int00.  The source actually ships with BIOS in the following file:

    bios_5_41_06_21\packages\ti\bios\src\aux62\boot.c

    Note that file uses a pragma to put the c_int00 function into a section called .sysinit rather than .text by default.  So if you open the map file you'd see something like this:

    .sysinit   0    00805f80    000004a0    
                      00805f80    00000360     c6455cfg.obj (.sysinit)
                      008062e0    000000c0     bios.a64P : boot.o64P (.sysinit)
                      008063a0    00000060               : tsk_init.o64P (.sysinit)
                      00806400    00000020               : obj_init.o64P (.sysinit)

    The file was called boot.c which is why we are looking at the corresponding object code boot.o64P in the library bios.a64P.  Finally, if you wanted to take that c_int00 function and force to an address such as 0x00800000 (for example for doing HPI boot on 6455) then you would add something like this in your own linker command file:

    SECTIONS
    {

        boot > 0x00800000
        {
        -l bios.a64P<boot.o64P>(.sysinit)
        }
     
    }

     

  • [ed - this post is being addressed in the thread How to specify an exact address for c_int00 for C6748.]

    Hello,

    I've tried the same for C6748 using the below linker file (not using SYS or DSP BIOS, also tried using rts6740.lib), but I receive a warning on line 23:

    "../linker_dsp.cmd", line 23: warning #10068-D: no matching section

    Any idea why?

    Thank you in advance,

    David.

    linker_dsp.cmd:

    -stack 0x00008000
    -heap 0x00008000

    MEMORY
    {
    dsp_l2_ram: ORIGIN = 0x11800000 LENGTH = 0x00040000
    shared_ram: ORIGIN = 0x80000000 LENGTH = 0x00020000
    external_ram: ORIGIN = 0xC0000000 LENGTH = 0x08000000
    arm_local_ram: ORIGIN = 0xFFFF0000 LENGTH = 0x00002000
    }

    SECTIONS
    {
    .text > dsp_l2_ram
    boot > 0x11800000
    {
    -l rts6740_elf_eh.lib<boot.obj>(.text)
    }
    .const > dsp_l2_ram
    .bss > dsp_l2_ram
    .far > dsp_l2_ram
    .switch > dsp_l2_ram
    .stack > dsp_l2_ram
    .data > dsp_l2_ram
    .cinit > dsp_l2_ram
    .sysmem > dsp_l2_ram
    .cio > dsp_l2_ram
    .pinit > dsp_l2_ram
    .init_array > dsp_l2_ram
    .fardata > shared_ram
    .c6xabi.exidx: load > shared_ram
    .c6xabi.extab: load > shared_ram
    .neardata > dsp_l2_ram
    .rodata > dsp_l2_ram
    }

  • hello, I have the Same problem  with  the DSP28335;I  changed somrthing in 28335.tcf file, and set my linker.cmd file as follows:

    MEMORY
    {
      MEMSysInit ORIGIN = 0x3fb80 LENGTH = 0x400
    }


    SECTIONS
    {
    /*** User Defined Sections ***/
       codestart         : > BEGIN_FLASH,           PAGE = 0           /* Used by file CodeStartBranch.asm */
       internalMemFuncs  : > FLASH,        PAGE = 0           /* Used by file Xintf.c.  Link to internal memory */
       secureRamFuncs    :   LOAD = FLASH, PAGE = 0           /* Can be Flash */
                             RUN = L47SARAM,      PAGE = 1           /* Must be CSM secured RAM */
                             LOAD_START(_secureRamFuncs_loadstart),
                             LOAD_END(_secureRamFuncs_loadend),
                             RUN_START(_secureRamFuncs_runstart)
      .mbuf{}>L03SARAM,PAGE=0

    }

    SECTIONS
    {

     

        boot :> 0x03fb82
        {
          -l bios.a28L<boot.o28L>(.sysinit)
        }


     
    }

    but when I compile the project,,found the error as " F:\\TMS320F28235_DemoPrj\\NT-C2200_newlib_arrange_0815\\LinkCmd\\TMS320F28235_Bios_Flash.cmd, line 40:   error:
                   missing filename on -l"

    can you tell me why?

     

  • Hi Eddie3909
    I am trying something similar with TMS320C6727B with parallel Flash loading the golden image . And golden_image will subsequently load the application_image.
    My doubt is, how do you load the application_image from the Golden_image and execute the same? I have defined non-overlapping memory sections for the 2 images in linker.cmd files. I understand the .CODE, .DATA and other sections need to be put in the memory before starting execution.

    Please advise how you achieved the same.

    Regards