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.

Sections missing TMS570LS202x6SFlashLnk.cmd in CCS 5.1

Other Parts Discussed in Thread: TMS570LS20216, HALCOGEN

I attempted to create a "hello world" application for a TMS570LS20216 using CCS Version: 5.1.1.00031 with the following settings:

  

The resulting program didn't run - the main entry point was never reached.

On inspecting the 

******************************************************************************
                  TMS470 Linker PC v4.9.4                      
******************************************************************************
>> Linked Sun May 13 19:57:21 2012

OUTPUT FILE NAME:   <ARM_hello_world.out>
ENTRY POINT SYMBOL: "_c_int00"  address: 00003b10


MEMORY CONFIGURATION

         name            origin    length      used     unused   attr    fill
----------------------  --------  ---------  --------  --------  ----  --------
  VECTORS               00000000   00000020  00000000  00000020     X
  FLASH0                00000020   0007ffe0  00004fc1  0007b01f  R  X
  FLASH1                00080000   00080000  00000000  00080000  R  X
  FLASH2                00100000   00080000  00000000  00080000  R  X
  FLASH3                00180000   00080000  00000000  00080000  R  X
  STACKS                08000000   00001300  00000000  00001300  RW  
  RAM                   08001300   00026d00  000004f0  00026810  RW  


SEGMENT ALLOCATION MAP

run origin  load origin   length   init length attrs members
----------  ----------- ---------- ----------- ----- -------
00000020    00000020    00003ef9   00003ef9    r-x
  00000020    00000020    00003df8   00003df8    r-x .text
  00003e18    00003e18    00000101   00000101    r-- .const
00003f1c    00003f1c    00001004   00000000    rw-
  00003f1c    00003f1c    00000800   00000000    rw- .stack
  00004720    00004720    00000800   00000000    rw- .sysmem
00004f20    00004f20    000000c8   000000c8    r--
  00004f20    00004f20    000000c8   000000c8    r-- .cinit
08001300    08001300    00000290   00000000    rw-
  08001300    08001300    00000290   00000000    rw- .bss
08001590    08001590    00000260   00000260    rw-
  08001590    08001590    00000260   00000260    rw- .data


SECTION ALLOCATION MAP

 output                                  attributes/
section   page    origin      length       input sections
--------  ----  ----------  ----------   ----------------
.text      0    00000020    00003df8     
                  00000020    0000164c     rtsv7R4_A_be_v3D16_eabi.lib : _printfi.obj (.text)
                  0000166c    0000063c                                 : memory.obj (.text)
                  00001ca8    000005c4                                 : lowlev.obj (.text)
                  0000226c    000004e0                                 : trgdrv.obj (.text)
                  0000274c    00000300                                 : fopen.obj (.text)
                  00002a4c    000002b8                                 : ull_div32.obj (.text)
                  00002d04    00000194                                 : fputs.obj (.text)
                  00002e98    00000180                                 : memcpy32.obj (.text)
                  00003018    00000118                                 : _io_perm.obj (.text)
                  00003130    00000114                                 : fflush.obj (.text)
                  00003244    00000114                                 : setvbuf.obj (.text)
                  00003358    000000d8                                 : fputc.obj (.text)
                  00003430    000000d4                                 : auto_init.obj (.text)
                  00003504    000000b0                                 : memset32.obj (.text)
                  000035b4    000000a8                                 : trgmsg.obj (.text)
                  0000365c    00000098                                 : copy_decompress_rle.obj (.text)
                  000036f4    00000098                                 : fclose.obj (.text)
                  0000378c    0000008c                                 : cpy_tbl.obj (.text)
                  00003818    0000008c                                 : xdtest.obj (.text)
                  000038a4    00000084                                 : atoi.obj (.text)
                  00003928    00000080                                 : fseek.obj (.text)
                  000039a8    00000080                                 : ltoa.obj (.text)
                  00003a28    00000078                                 : exit.obj (.text)
                  00003aa0    00000070                                 : printf.obj (.text)
                  00003b10    00000060                                 : boot.obj (.text)
                  00003b70    00000058                                 : i_div32.obj (.text)
                  00003bc8    00000054                                 : u_div32.obj (.text)
                  00003c1c    00000048                                 : strncpy.obj (.text)
                  00003c64    0000002c                                 : memccpy.obj (.text)
                  00003c90    0000002c                                 : memchr.obj (.text)
                  00003cbc    0000002c                                 : strcmp.obj (.text)
                  00003ce8    00000028                                 : strchr.obj (.text)
                  00003d10    00000024                                 : _lock.obj (.text)
                  00003d34    00000020                                 : copy_zero_init.obj (.text:decompress:ZI)
                  00003d54    00000020     main.obj (.text)
                  00003d74    00000020     rtsv7R4_A_be_v3D16_eabi.lib : args_main.obj (.text)
                  00003d94    00000020                                 : icall32.obj (.text)
                  00003db4    0000001c                                 : strlen.obj (.text)
                  00003dd0    00000018                                 : strcpy.obj (.text)
                  00003de8    00000014                                 : copy_decompress_none.obj (.text:decompress:none)
                  00003dfc    00000014                                 : xdclass.obj (.text)
                  00003e10    00000008                                 : copy_decompress_rle.obj (.text:decompress:rle24)

.const     0    00003e18    00000101     
                  00003e18    00000101     rtsv7R4_A_be_v3D16_eabi.lib : ctype.obj (.const:_ctypes_)

.stack     0    00003f1c    00000800     UNINITIALIZED
                  00003f1c    00000800     --HOLE--

.sysmem    0    00004720    00000800     UNINITIALIZED
                  00004720    00000008     rtsv7R4_A_be_v3D16_eabi.lib : memory.obj (.sysmem)
                  00004728    000007f8     --HOLE--

.cinit     0    00004f20    000000c8     
                  00004f20    000000a1     (.cinit..data.load) [load image, compression = rle]
                  00004fc1    00000003     --HOLE-- [fill = 0]
                  00004fc4    0000000c     (__TI_handler_table)
                  00004fd0    00000008     (.cinit..bss.load) [load image, compression = zero_init]
                  00004fd8    00000010     (__TI_cinit_table)

.bss       0    08001300    00000290     UNINITIALIZED
                  08001300    00000120     rtsv7R4_A_be_v3D16_eabi.lib : trgmsg.obj (.bss:__CIOBUF_)
                  08001420    000000c8                                 : trgdrv.obj (.bss:result$1)
                  080014e8    000000a0                                 : defs.obj (.bss:_tmpnams)
                  08001588    00000008                                 : trgdrv.obj (.bss)

.data      0    08001590    00000260     
                  08001590    000000f0     rtsv7R4_A_be_v3D16_eabi.lib : defs.obj (.data:_ftable)
                  08001680    00000078                                 : lowlev.obj (.data:_device)
                  080016f8    00000070                                 : xlvalues.obj (.data)
                  08001768    00000050                                 : lowlev.obj (.data:_stream)
                  080017b8    00000010                                 : defs.obj (.data)
                  080017c8    0000000c                                 : memory.obj (.data)
                  080017d4    00000008                                 : _lock.obj (.data)
                  080017dc    00000008                                 : exit.obj (.data)
                  080017e4    00000004                                 : fopen.obj (.data)
                  080017e8    00000004                                 : lowlev.obj (.data)
                  080017ec    00000004                                 : stkdepth_vars.obj (.data)


LINKER GENERATED COPY TABLES

__TI_cinit_table @ 00004fd8 records: 2, size/record: 8, table size: 16
	.data: load addr=00004f20, load size=000000a1 bytes, run addr=08001590, run size=00000260 bytes, compression=rle
	.bss: load addr=00004fd0, load size=00000008 bytes, run addr=08001300, run size=00000290 bytes, compression=zero_init


LINKER GENERATED HANDLER TABLE

__TI_handler_table @ 00004fc4 records: 3, size/record: 4, table size: 12
	index: 0, handler: __TI_zero_init
	index: 1, handler: __TI_decompress_rle24
	index: 2, handler: __TI_decompress_none


GLOBAL SYMBOLS: SORTED ALPHABETICALLY BY Name 

address    name
--------   ----
00003a28   C$$EXIT
000035fc   C$$IO$$
000026d8   HOSTclock
00002670   HOSTclose
000025cc   HOSTlseek
00002540   HOSTopen
000024bc   HOSTread
00002420   HOSTrename
000023bc   HOSTtime
00002358   HOSTunlink
000022d4   HOSTwrite
00003d94   IND_CALL
00003dfc   _Dclass
00003818   _Dtest
080016f8   _LDenorm
08001708   _LEps
08001718   _LInf
08001728   _LNan
08001748   _LRteps
08001738   _LSnan
08001758   _LXbig
08001760   _LZero
08001300   __CIOBUF_
0000471c   __STACK_END
00000800   __STACK_SIZE
00000800   __SYSMEM_SIZE
00004fd8   __TI_CINIT_Base
00004fe8   __TI_CINIT_Limit
00004fc4   __TI_Handler_Table_Base
00004fd0   __TI_Handler_Table_Limit
00000001   __TI_args_main
00003430   __TI_auto_init
00003de8   __TI_decompress_none
00003e10   __TI_decompress_rle24
00004f20   __TI_static_base__
00003d34   __TI_zero_init
00003b70   __aeabi_idivmod
00003504   __aeabi_memclr
00003504   __aeabi_memclr4
00003504   __aeabi_memclr8
00002e98   __aeabi_memcpy
00002e98   __aeabi_memcpy4
00002e98   __aeabi_memcpy8
00003508   __aeabi_memset
00003508   __aeabi_memset4
00003508   __aeabi_memset8
080017c4   __aeabi_stderr
080017bc   __aeabi_stdin
080017c0   __aeabi_stdout
00003bc8   __aeabi_uidivmod
00002a4c   __aeabi_uldivmod
ffffffff   __binit__
ffffffff   __c_args__
00003f1c   __stack
00003d74   _args_main
00003b10   _c_int00
0000288c   _cleanup
080017dc   _cleanup_ptr
00003e18   _ctypes_
00003130   _doflush
080017e0   _dtors_ptr
080017b8   _ft_end
08001590   _ftable
080017d4   _lock
00003d28   _nop
000013d8   _printfi
000030b8   _rd_ok
00003d1c   _register_lock
00003d10   _register_unlock
00004720   _sys_memory
080014e8   _tmpnams
080017d8   _unlock
00003018   _wrt_ok
00003a30   abort
00002190   add_device
000038a4   atoi
ffffffff   binit
00001c50   calloc
00002104   close
0000378c   copy_in
00003a3c   exit
000036f4   fclose
000031b4   fflush
00002100   find_registered_device
000029e0   fopen
00003358   fputc
00002d04   fputs
0000182c   free
000028f0   freopen
00003928   fseek
0000226c   getenv
00002088   lseek
000039a8   ltoa
00003d54   main
080017ec   main_func_sp
00001774   malloc
00001b14   memalign
00003c64   memccpy
00003c90   memchr
00002e98   memcpy
00003514   memset
0000166c   minit
00001fb8   open
00003aa0   printf
00003420   putc
00003424   putchar
00002e64   puts
00001ed4   read
00003604   readmsg
00001988   realloc
00001dd8   remove
00001e88   remove_device
00001e1c   rename
00003244   setvbuf
00003ce8   strchr
00003cbc   strcmp
00003dd0   strcpy
00003db4   strlen
00003c1c   strncpy
00001dd8   unlink
00001ca8   write
000035b4   writemsg


GLOBAL SYMBOLS: SORTED BY Symbol Address 

address    name
--------   ----
00000001   __TI_args_main
00000800   __STACK_SIZE
00000800   __SYSMEM_SIZE
000013d8   _printfi
0000166c   minit
00001774   malloc
0000182c   free
00001988   realloc
00001b14   memalign
00001c50   calloc
00001ca8   write
00001dd8   remove
00001dd8   unlink
00001e1c   rename
00001e88   remove_device
00001ed4   read
00001fb8   open
00002088   lseek
00002100   find_registered_device
00002104   close
00002190   add_device
0000226c   getenv
000022d4   HOSTwrite
00002358   HOSTunlink
000023bc   HOSTtime
00002420   HOSTrename
000024bc   HOSTread
00002540   HOSTopen
000025cc   HOSTlseek
00002670   HOSTclose
000026d8   HOSTclock
0000288c   _cleanup
000028f0   freopen
000029e0   fopen
00002a4c   __aeabi_uldivmod
00002d04   fputs
00002e64   puts
00002e98   __aeabi_memcpy
00002e98   __aeabi_memcpy4
00002e98   __aeabi_memcpy8
00002e98   memcpy
00003018   _wrt_ok
000030b8   _rd_ok
00003130   _doflush
000031b4   fflush
00003244   setvbuf
00003358   fputc
00003420   putc
00003424   putchar
00003430   __TI_auto_init
00003504   __aeabi_memclr
00003504   __aeabi_memclr4
00003504   __aeabi_memclr8
00003508   __aeabi_memset
00003508   __aeabi_memset4
00003508   __aeabi_memset8
00003514   memset
000035b4   writemsg
000035fc   C$$IO$$
00003604   readmsg
000036f4   fclose
0000378c   copy_in
00003818   _Dtest
000038a4   atoi
00003928   fseek
000039a8   ltoa
00003a28   C$$EXIT
00003a30   abort
00003a3c   exit
00003aa0   printf
00003b10   _c_int00
00003b70   __aeabi_idivmod
00003bc8   __aeabi_uidivmod
00003c1c   strncpy
00003c64   memccpy
00003c90   memchr
00003cbc   strcmp
00003ce8   strchr
00003d10   _register_unlock
00003d1c   _register_lock
00003d28   _nop
00003d34   __TI_zero_init
00003d54   main
00003d74   _args_main
00003d94   IND_CALL
00003db4   strlen
00003dd0   strcpy
00003de8   __TI_decompress_none
00003dfc   _Dclass
00003e10   __TI_decompress_rle24
00003e18   _ctypes_
00003f1c   __stack
0000471c   __STACK_END
00004720   _sys_memory
00004f20   __TI_static_base__
00004fc4   __TI_Handler_Table_Base
00004fd0   __TI_Handler_Table_Limit
00004fd8   __TI_CINIT_Base
00004fe8   __TI_CINIT_Limit
08001300   __CIOBUF_
080014e8   _tmpnams
08001590   _ftable
080016f8   _LDenorm
08001708   _LEps
08001718   _LInf
08001728   _LNan
08001738   _LSnan
08001748   _LRteps
08001758   _LXbig
08001760   _LZero
080017b8   _ft_end
080017bc   __aeabi_stdin
080017c0   __aeabi_stdout
080017c4   __aeabi_stderr
080017d4   _lock
080017d8   _unlock
080017dc   _cleanup_ptr
080017e0   _dtors_ptr
080017ec   main_func_sp
ffffffff   __binit__
ffffffff   __c_args__
ffffffff   binit

[122 symbols]
map file the linker has placed the .stack and .sysmem sections in flash rather than RAM.

To get the program to run I had to add the following to the SECTIONS of the project  TMS570LS202x6SFlashLnk.cmd:

    .stack   : {} > STACKS
    .sysmem  : {} > RAM

 Should the C:\ti\ccsv5\ccs_base\arm\include\TMS570LS202x6SFlashLnk.cmd supplied with CCS 5.1 be updated to add the .stack and .sysmem sections generated by the compiler?

It also looks like the TMS570LS212xFlashLnk.cmd, TMS570LS213xFlashLnk.cmd and TMS570LS313xFlashLnk.cmd files have the same problem of missing sections. 

 

  • Hi,

    Thanks for reporting this; I will contact the owners of this file and request a fix.

    Regards,

    Rafael

  • desouza said:
    Thanks for reporting this; I will contact the owners of this file and request a fix.

    Was a fix requested for this?

    I checked in CCS 6.1 (under Linux) and the .stack and .sysmem sections are still missing from the TMS570LS202x6SFlashLnk.cmd file.

    Also, in CCS 6.1 the "New CCS Project" dialog for a TMS570LS20216SPGE leaves the Linker command file blank by default

    Should the TMS570LS202x6SFlashLnk.cmd file be selected by default when a new project is created in CCS 6.1 for a TMS570LS20216SPGE?

  • Chester,

    I talked to the applications team that works with the Hercules device support for CCS, and they are looking into it.

    However, they also mentioned that HalCoGen linker CMD files are better suited for Hercules development, thus recommended by them.

    I will let you know if/when these changes are implemented. For now, check the page below that helps with the integration between HalCoGen and CCS:

    processors.wiki.ti.com/.../Creating_new_CCS_v5_Project_with_HALCoGen

    Regards,
    Rafael
  • desouza said:
    I talked to the applications team that works with the Hercules device support for CCS, and they are looking into it.

    However, they also mentioned that HalCoGen linker CMD files are better suited for Hercules development, thus recommended by them.

    Thanks for the information.

    Looking at the http://processors.wiki.ti.com/index.php/LAUNCHXL2_RM46:_Project_0 shows that HalCoGen uses a different approach to allocating the stack than than the TI ARM compiler run-time library:

    a) HalCoGen projects use their own start-up code, with the _coreInitStackPointer_ assembler function setting the stack pointers to hard-coded values. The Linker Command file generated by a HalCoGen project uses a memory region named STACKS, which overlays the stack addresses set by the _coreInitStackPointer_ assembler function.

    b) Whereas if a new CCS only project is created for a Hercules device, the start-up code in the TI ARM run time library is used, which requires a .stack section in the linker command file to define which memory region the stack is placed in.

    The "default" Hercules linker command files in CCS are in the format used by HalCoGen, in that they define a STACKS memory region rather that a .stack section.

    For now I will use HalCoGen and CCS integration as suggested.