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.

TMDS570LS31HDK: Getting start and end address of .cinit section.

Part Number: TMDS570LS31HDK
Other Parts Discussed in Thread: HALCOGEN

Hello,

I am trying to generate a CRC on Flash memory using the SL_CRC_Calculate() function. However, I cannot find a way to access the origin or start address of the .cinit section in memory. I know the linker provides the symbols __TI_CINIT_Base and __TI_CINIT_Limit, but this does not cover the whole .cinit section as can be seen from the map file:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
SECTION ALLOCATION MAP
output attributes/
section page origin length input sections
-------- ---- ---------- ---------- ----------------
.kernelTEXT
* 0 00000020 00005604
00000020 00002f04 os_tasks.obj (.kernelTEXT)
00002f24 000012dc os_queue.obj (.kernelTEXT)
00004200 00000818 os_event_groups.obj (.kernelTEXT)
00004a18 000004b0 os_portasm.obj (.kernelTEXT)
00004ec8 000003e0 os_port.obj (.kernelTEXT)
000052a8 0000037c os_heap.obj (.kernelTEXT)
.cinit 0 00005628 000000e8
00005628 0000009d (.cinit..data.load) [load image, compression = lzss]
000056c5 00000003 --HOLE-- [fill = 0]
000056c8 0000000c (__TI_handler_table)
000056d4 00000009 (.cinit..kernelBSS.load) [load image, compression = lzss]
000056dd 00000003 --HOLE-- [fill = 0]
000056e0 00000008 (.cinit..bss.load) [load image, compression = zero_init]
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Notably, there's __TI_static_base__ and __TI_Handler_Table_Base in between the end of the previous section (ends @ 0x5628) and the __TI_CINIT_Base (0x56f0).

I wasn't able to find any documentation on __TI_static_base__, and couldn't find any confirmation that the Handler table will always appear before the Cinit table. Is there a way to capture the whole of the .cinit section? 
Thank you!

  • Hi Robin,

    We started working on your issue and will provide an update soon.

    --

    Thanks & regards,
    Jagadish.

  • The .cinit section contains the autoinit table for C/C++ programs. The  __TI_CINIT_Base and __TI_CINIT_Limit point to the start and end of this table.

    But the Linker CRC_table has the CRC value of .the whole .cinit section (start addr = 0x5628, and size=0xe8) 

  • Hi QJ.

    I should've clarified, I need symbols that point to the start and end of this .cinit section that I can reference in C code. The __TI_CINIT_Base and __TI_CINIT_Limit symbols only provide coverage of the autoinit table, but I need to be sure I can cover the .cinit..data.load range as well. Ideally I'd have a symbol pointing to the start address 0x5628 and the end address 0x5710.

    Because I am using halcogen, I cannot insert symbols on my own into the section, as the code will be overwritten every time we regenerate halcogen code during development.

  • Because I am using halcogen, I cannot insert symbols on my own into the section, as the code will be overwritten every time we regenerate halcogen code during development.

    You can insert your own code inside the predefined /* USER CODE BEGIN */, otherwise your code will disappear after you regenerate HalCoGen code.

    I'd have a symbol pointing to the start address 0x5628 and the end address 0x5710.

    I don't know if there is any symbol pointing to the starting address. 

     __TI_CINIT_Limit  ponts to the end address.

  • Hi QJ,

    Thanks for confirming the starting address behaviour. Do you know what __TI_static_base__ was used for? It seems to be generated at the start address of the .cinit section (0x5628) but I can't find any documentation confirming that this will always be true.

  • .cinit is for the initialized global and static variables. __TI_static_base__ may not point to the starting address of .cinit table. 

    I could not find the definition of __TI_static_base__.

  • Alright, thanks for confirming that QJ.

    I'll find a workaround then.