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.

TM4C129XNCZAD: Cannot build correctly the bootloader

Part Number: TM4C129XNCZAD


Hello,

I'm tring to build the TIVA Bootloader for the above processor. The loader is built but the code is not copied from the FLASH to the SRAM. I've a project very similar to the bootloader of the TivaWare 2.1.4.178 .

I'm using CCS Version: 10.3.1.00003 and the compiler version is TI v20.2.4.LTS.

After I've programmed the processor, I can find in the FLASH the vector table, but the following data does not look like the assembly code. The reset vector point to uninitialized FLASH. I suspect that part of the code to copy is not present in the FLASH.

If I take this part of the bl_startup_ccs.s :


;;*****************************************************************************
;;
;; This portion of the file goes into the text section.
;;
;;*****************************************************************************
    .word 0x12345678
    .text

;;*****************************************************************************
;;
;; Initialize the processor by copying the boot loader from flash to SRAM, zero
;; filling the .bss section, and moving the vector table to the beginning of
;; SRAM.  The return address is modified to point to the SRAM copy of the boot
;; loader instead of the flash copy, resulting in a branch to the copy now in
;; SRAM.
;;
;;*****************************************************************************
    .ref    bss_run
bss_start   .word bss_run
    .ref    __STACK_TOP
bss_end     .word __STACK_TOP

    .thumbfunc ProcessorInit
ProcessorInit: .asmfunc
    ;;
    ;; Copy the code image from flash to SRAM.
    ;;
    movs    r0, #0x0000
    movs    r1, #0x0000
    movt    r1, #0x2000
    ldr     r2, bss_start

And I compare with a dump of the FLASH :

0000003a:   2000                movs       r0, #0
0000003c:   06A3                lsls       r3, r4, #0x1a
0000003e:   2000                movs       r0, #0
00000040:   06A3                lsls       r3, r4, #0x1a
00000042:   2000                movs       r0, #0
00000044:   5678                ldrsb      r0, [r7, r1]
00000046:   1234                asrs       r4, r6, #8
00000048:   F1AD0D08            sub.w      r13, r13, #8
0000004c:   9000                str        r0, [r13]
0000004e:   BA00                rev        r0, r0
00000050:   4770                bx         r14
00000052:   9800                ldr        r0, [r13]
00000054:   1C40                adds       r0, r0, #1
00000056:   B002                add        r13, #8
00000058:   4770                bx         r14
0000005a:   B508                push       {r3, r14}

One can see my ".word" with the value 12345678 (in bold), but the following code should be "movs..."

The compiler issue warnings regarding this initialization :

warning #10278-D: LOAD placement specified for section
   ".text:rtsv7M4_T_le_v4SPD16_eabi.lib<memset_t2.asm.obj>". This section
   contains decompression routines required for linker generated copy tables
   and C/C++ auto-initialization.  Must ensure that this section is copied to
   run address before the C/C++ boot code is executed or is placed with single
   allocation specifier (ex. "> MEMORY").

But I don't how to fix this. Is there something to change to the cmd file ? (I use the original file)
MEMORY
{
    FLASH (RX) : origin = 0x00000000, length = 0x00010000
    SRAM (RWX) : origin = 0x20000000, length = 0x00010000
}

/* Section allocation in memory */

SECTIONS
{
    GROUP
    {
        .intvecs
        .text
        .const
        .data
    } load = FLASH, run = 0x20000000, LOAD_START(init_load), RUN_START(init_run), SIZE(init_size)

    GROUP
    {
        .bss
        .stack
    } run = SRAM, RUN_START(bss_run), RUN_END(bss_end), SIZE(bss_size), RUN_END(__STACK_TOP)

}