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/TM4C1294NCPDT: Combine boot loader and app into one .out file

Part Number: TM4C1294NCPDT

Tool/software: TI C/C++ Compiler

Hi

I like to combine my bootloader and my application to one file that I could write to the flash of my TM4C1294NCPDT

I tried the

Example 2: User control of load image section formation

from here

https://processors.wiki.ti.com/index.php/Combining_executable_files

I wrote to the rom.cmd file:

--------------------------------------

Bootloader.out
APP.out

--load_image
–o ROM.obj

ROMS
{
    Bootloader:    origin=0x00000040 len=0x00013cda
    APP:           origin=0x00019040 len=0x0002adc2
}

-------------------------------------------------------------------

C:\ti\ccs930\ccs\tools\compiler\ti-cgt-arm_18.12.4.LTS\bin\armhex rom.cmd

but with this I get this error:

error: illegal input character: 0xFFFFFFE2
error: illegal input character: 0xFFFFFF80
error: illegal input character: 0xFFFFFF93
fatal error: cannot open input file "o.out": No such file or directory

Did I understand this axample in a wrong way or where is my failure?

Thanks for help

Rene

  • Please be sure the file rom.cmd contains nothing but 7-bit ASCII characters, i.e. the most significant bit is always zero.  The encoding of this text file must be plain ASCII or UTF-8.

    Thanks and regards,

    -George

  • Thanks the - before o ROM.obj was something else.

    But now I get some other errors.

    I´m new to this topic.

    How could I combine two CCS projects in one flashable file.

    I attach the txt files made by

    armofd APP.out >> APP.txt

    armofd BOOT.out >> BOOT.txt

    (I delete the parts after "Section Information" or do you need that?)

    Thanks for your help.

    René

    7652.BOOT.txt
    OBJECT FILE:  BOOT.out
    
     Object File Information
    
        File Name:           BOOT.out                  
        Format:              ELF Version 1             
        File Type:           executable file           
        Machine:             Advanced RISC Machines ARM
        Machine Endian:      little endian             
        Entry Point:         0x0000f625                
        Vendor:              Texas Instruments, Inc.   
        Producer:            Linker                    
        Linker Version:      18.12.4                   
        Number of Sections:  31                        
        File Length:         2536632                   
        ELF Class:           32-bit objects            
        ELF e_flags:         0x05000000                
    
     Program Segment Table
    
        id type    load addr  run addr   file size mem size flags align
        -- ----    ---------  --------   --------- -------- ----- -----
        0  PT_LOAD 0x00000000 0x00000000 0x17e78   0x17e78  r-x   8    
        1  PT_LOAD 0x20000000 0x20000000 0x0       0x360    rw-   4    
        2  PT_LOAD 0x20000380 0x20000380 0x0       0x12fa8  rw-   128  
        3  PT_LOAD 0x20013400 0x20013400 0x0       0x1988   rw-   1024 
    
     Section Information
    
        id name                      load addr  run addr      size align alloc
        -- ----                      ---------  --------      ---- ----- -----
         0 (no name)                 0x00000000 0x00000000     0x0     0   N  
         1 .intvecs                  0x00000000 0x00000000     0x0     1   N  
         2 .text                     0x00000040 0x00000040 0x13cda     8   Y  
         3 .const                    0x00013d1c 0x00013d1c  0x3d13     4   Y  
         4 .cinit                    0x00017a30 0x00017a30   0x448     8   Y  
         5 .pinit                    0x00000000 0x00000000     0x0     1   N  
         6 .init_array               0x00000000 0x00000000     0x0     1   Y  
         7 .vtable                   0x00000000 0x00000000     0x0     1   N  
         8 .data                     0x20013400 0x20013400  0x1588  1024   Y  
         9 .bss                      0x20000380 0x20000380 0x12fa8   128   Y  
        10 .sysmem                   0x00000000 0x00000000     0x0     1   N  
        11 .stack                    0x20014988 0x20014988   0x400     8   Y  
        12 .bootVecs                 0x00000000 0x00000000     0x8     4   N  
        13 .vecs                     0x20000000 0x20000000   0x360     4   Y  
        14 .resetVecs                0x00000000 0x00000000    0x3c     4   Y  
        15 xdc.meta                  0x00000000 0x00000000    0xd1     1   N  
        16 .TI.noinit                0x00000000 0x00000000     0x0     1   N  
        17 .TI.persistent            0x00000000 0x00000000     0x0     1   N  
        18 .debug_info               0x00000000 0x00000000 0xd5867     1   N  
        19 .debug_line               0x00000000 0x00000000 0x299f0     1   N  
        20 .debug_frame              0x00000000 0x00000000 0x1490c     4   N  
        21 .debug_abbrev             0x00000000 0x00000000 0x20486     1   N  
        22 .debug_str                0x00000000 0x00000000 0x5c56f     1   N  
        23 .debug_aranges            0x00000000 0x00000000  0x5150     1   N  
        24 .debug_pubnames           0x00000000 0x00000000  0x78e8     1   N  
        25 .debug_pubtypes           0x00000000 0x00000000 0x6f078     1   N  
        26 .ARM.attributes           0x00000000 0x00000000    0x59     0   N  
        27 .symtab                   0x00000000 0x00000000 0x36cd0     0   N  
        28 .TI.section.flags         0x00000000 0x00000000    0x1a     0   N  
        29 .strtab                   0x00000000 0x00000000 0x10006     0   N  
        30 .shstrtab                 0x00000000 0x00000000   0x13a     0   N  
    APP.txt
    OBJECT FILE:  APP.out
    
     Object File Information
    
        File Name:           APP.out                   
        Format:              ELF Version 1             
        File Type:           executable file           
        Machine:             Advanced RISC Machines ARM
        Machine Endian:      little endian             
        Entry Point:         0x0003caf1                
        Vendor:              Texas Instruments, Inc.   
        Producer:            Linker                    
        Linker Version:      18.12.4                   
        Number of Sections:  31                        
        File Length:         3095548                   
        ELF Class:           32-bit objects            
        ELF e_flags:         0x05000000                
    
     Program Segment Table
    
        id type    load addr  run addr   file size mem size flags align
        -- ----    ---------  --------   --------- -------- ----- -----
        0  PT_LOAD 0x00019000 0x00019000 0x320e0   0x320e0  r-x   8    
        1  PT_LOAD 0x20000000 0x20000000 0x0       0x360    rw-   4    
        2  PT_LOAD 0x20000400 0x20000400 0x0       0x2f315  rw-   1024 
        3  PT_LOAD 0x2002f800 0x2002f800 0x0       0x9e38   rw-   1024 
    
     Section Information
    
        id name                      load addr  run addr      size align alloc
        -- ----                      ---------  --------      ---- ----- -----
         0 (no name)                 0x00000000 0x00000000     0x0     0   N  
         1 .intvecs                  0x00000000 0x00000000     0x0     1   N  
         2 .text                     0x00019040 0x00019040 0x2adc2     8   Y  
         3 .const                    0x00043e08 0x00043e08  0x6dae     8   Y  
         4 .cinit                    0x0004abb8 0x0004abb8   0x528     8   Y  
         5 .pinit                    0x00000000 0x00000000     0x0     1   N  
         6 .init_array               0x0001903c 0x0001903c     0x4     4   Y  
         7 .vtable                   0x00000000 0x00000000     0x0     1   N  
         8 .data                     0x2002f800 0x2002f800  0x7e34  1024   Y  
         9 .bss                      0x20000400 0x20000400 0x2f315  1024   Y  
        10 .sysmem                   0x00000000 0x00000000     0x0     1   N  
        11 .stack                    0x20037638 0x20037638  0x2000     8   Y  
        12 .bootVecs                 0x00000000 0x00000000     0x8     4   N  
        13 .vecs                     0x20000000 0x20000000   0x360     4   Y  
        14 .resetVecs                0x00019000 0x00019000    0x3c     4   Y  
        15 xdc.meta                  0x00000000 0x00000000    0xe4     1   N  
        16 .TI.noinit                0x00000000 0x00000000     0x0     1   N  
        17 .TI.persistent            0x00000000 0x00000000     0x0     1   N  
        18 .debug_info               0x00000000 0x00000000 0xefdc4     1   N  
        19 .debug_line               0x00000000 0x00000000 0x2b8a9     1   N  
        20 .debug_frame              0x00000000 0x00000000 0x157c3     4   N  
        21 .debug_abbrev             0x00000000 0x00000000 0x223d1     1   N  
        22 .debug_str                0x00000000 0x00000000 0x706f2     1   N  
        23 .debug_aranges            0x00000000 0x00000000  0x5bd0     1   N  
        24 .debug_pubnames           0x00000000 0x00000000  0x8c20     1   N  
        25 .debug_pubtypes           0x00000000 0x00000000 0x7c551     1   N  
        26 .ARM.attributes           0x00000000 0x00000000    0x59     0   N  
        27 .symtab                   0x00000000 0x00000000 0x4b4b0     0   N  
        28 .TI.section.flags         0x00000000 0x00000000    0x1a     0   N  
        29 .strtab                   0x00000000 0x00000000 0x2752a     0   N  
        30 .shstrtab                 0x00000000 0x00000000   0x13a     0   N  

  • Rene H. said:
    How could I combine two CCS projects in one flashable file.

    The best documentation is this article on combining executables, which you mention in your first post.

    Thanks and regards,

    -George

  • I tried example 2 and get thsi error message

    armhex rom.cmd
    Setting --load_image:combine_sections=true
    warning: --load_image implies -image when using ROMS directive
    Translating to Load Image format...
       "BOOT.out" .resetVecs ==> .resetVecs
    warning: section BOOT.out(.resetVecs) at 00h falls in unconfigured memory (skipped)
       "BOOT.out" .text ==> .text
       "BOOT.out" .const ==> .const
    warning: section BOOT.out(.const) at 013d1ch falls in unconfigured memory (skipped)
       "BOOT.out" .cinit ==> .cinit
    warning: section BOOT.out(.cinit) at 017a30h falls in unconfigured memory (skipped)
       "APP.out" .resetVecs ==> .resetVecs
    warning: section APP.out(.resetVecs) at 019000h falls in unconfigured memory (skipped)
       "APP.out" .init_array ==> .init_array
    warning: section APP.out(.init_array) overlaps unconfigured memory at 01903ch
       (APP.out(.init_array) incomplete)
       "APP.out" .text ==> .text
       "APP.out" .const ==> .const
    warning: section APP.out(.const) at 043e08h falls in unconfigured memory(skipped)
       "APP.out" .cinit ==> .cinit
    warning: section APP.out(.cinit) at 04abb8h falls in unconfigured memory (skipped)

    What should I do with this information?

    The output is an .obj file - could I direclty flash this file or is there something more to do?

    Thanks for your help.

    René

  • I'll explain one of the error diagnostics.  It is likely the other errors are similar.

    Rene H. said:
    warning: section BOOT.out(.const) at 013d1ch falls in unconfigured memory (skipped)

    The section .const from boot.out begins at address 0x13d1c and has a length of 0x3d13 bytes.  The ROMS directive in rom.cmd does not account for this range of memory.  Therefore, the hex utility issues this diagnostic and ignores this section.

    The ROMS directive needs to account for all of the memory used by the initialized sections in both executable files.

    Thanks and regards,

    -George