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.

Compiler/TMS320C6713B: Copy Table Bootloader

Part Number: TMS320C6713B


Tool/software: TI C/C++ Compiler

Hi, 

I have few questions regarding c6713 bootloader. 

1. From file spra999a.pdf, Table 3. Copy Table format:

=> So from above table the first .word of copy table should be the size of first section. But in the same file, the given boot loader code says:
;****************************************************************************
mvkl COPY_TABLE, a3      ; load table pointer
mvkh COPY_TABLE, a3
ldw *a3++, b1                     ; Load entry point

Question: how the last instruction loads the entry point??? Shouldñ't it be the size of first instruction as per copy table format??

2. Let say i have a linker file:
Memory {
BootRam: org=0, len=400
IRam: org=400, len=xyz
}
Section{
.bootloader > BootRam
.text > IRam
}

From generated map file, the .text will be placed at 0x400.... if we want to generate copy table via hex conversion utility spru186p.pdf Example 11.3, then shouldn't the Copy table and .text section overlap in address?? My hex6x generated MAP file looks like:

copy table settings: −bootorg 0x90000400


90000400..90000b0b BOOT TABLE
    .text : btad=90000400 dest=400 size=6a0

I mean what will exist at 0x400, copy table or .text?? Or .text will be pushed down by hex6x??

3. Well actually i HAD these issues... so i dig into HEX 0s and 1s and found that this bootloader works fine when the copy table is created by Hex conversion utility... BUT if these the copy table is created manually or through linker script (Figure A−2 , spra999) in accordance to the given copy table format (table-3), then the bootloader shouldn't work or atleast this bootloader is not meant to be for the given copy table format.. am i right? 

Kind Regards,

  • You posted these questions at the end of an earlier thread.  I'm sorry for the delay in getting back to you.

    kowalski said:
    Question: how the last instruction loads the entry point??? Shouldñ't it be the size of first instruction as per copy table format??

    Please see the section of SPRU186P titled The Boot Table Format.  Note the sentence: 

    There is a header record containing a 4 byte field that indicates where the boot loader should branch after it has completed copying data.

    kowalski said:
    2. Let say i have a linker file:

    Memory {
    BootRam: org=0, len=400
    IRam: org=400, len=xyz
    }
    Section{
    .bootloader > BootRam
    .text > IRam
    }

    Every section has two allocations, load and run.  This syntax gives the .text section a load address and run address that is the same: 0x400.. You need to create another memory range (call it EXTERNAL for now) and give .text both load and run allocation ...

    .text > run = IRAM, load = EXTERNAL

    kowalski said:
    this bootloader works fine when the copy table is created by Hex conversion utility... BUT if these the copy table is created manually or through linker script

    I'm not surprised the other methods failed.  There is probably some error buried down deep in the details.  That is why is it better to let a tool like the hex utility handle all the details.

    Thanks and regards,

    -George

  • George, I agree with you... if you look at the section 2.3.1.1 creating the section copy table by inspecting the map file (spra999a),

    You will observe that there seems to be contradiction. Here table format is differnet while in spru186 its different.

    2. If i follow spru186p... which is the correct format and works fine, how can i MANUALLY  place two words at the start of each section? i.g.

    .text {

    .word size of section

    .word destination addr

    *(.text)

    }

    Is there a method to tell linker to place these two symbol words at start of each section? Even LOAD_START etc just define symbols equal to startinh address etc. Which can be placed anywhere in memory..

  • kowalski said:
    Is there a method to tell linker to place these two symbol words at start of each section?

    I don't think so.  But you don't need to do it that way.  Instead, please consider using copy tables.

    Copy tables collect, into a different place altogether, all the information you need to copy a section from its load address to its run address.  There is a C routine, provided in the compiler RTS library, named copy_in, which uses a copy table to carry out such a copy.  Please read more about copy tables in the application note Advanced Linker Techniques for Convenient and Efficient Memory Usage.

    Thanks and regards,

    -George