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/TMS320C6657: initialisation data not in cinit

Part Number: TMS320C6657

Tool/software: TI C/C++ Compiler

Hello,

When I build my flashable binary with hex6x (compiler 8.3.2), I have the following warning

warning: section dsp_program_core1.out(.DPD_data) at 086c780h falls in unconfigured memory (skipped)

When I look at the map file, I have about .DPD_data this :

.DPD_data
*          0    0086c780    00000010     
                  0086c780    00000010     DPD_release.lib : EstimateAndApplyGain.obj (.const:$P$T0$1)

But no reference to .DPD_data appears in the .cinit section

.cinit     0    7046b570    00004a28     
                  7046b570    00001fd0     (.cinit..modem_data.load) [load image, compression = rle]
                  7046d540    0000109d     (.cinit..oe_data.load) [load image, compression = rle]
                  7046e5dd    00000cda     (.cinit..c6657_tcp3_tables.load) [load image, compression = rle]
                  7046f2b7    00000621     (.cinit..bsp_data.load) [load image, compression = rle]
                  7046f8d8    00000298     (.cinit..algo_data_L2.load) [load image, compression = rle]
                  7046fb70    00000145     (.cinit..ti_data.load) [load image, compression = rle]
                  7046fcb5    0000012d     (.cinit..os_data.load) [load image, compression = rle]
                  7046fde2    00000075     (.cinit..rodata.load) [load image, compression = rle]
                  7046fe57    0000004c     (.cinit..memory_allocator_cache.load) [load image, compression = rle]
                  7046fea3    0000004c     (.cinit..neardata.load) [load image, compression = rle]
                  7046feef    0000000d     (.cinit..c6657_vcp2_buffer.load) [load image, compression = rle]
                  7046fefc    0000000d     (.cinit..mc_cmd_buffers.load) [load image, compression = rle]
                  7046ff09    0000000d     (.cinit..memory_allocator.load) [load image, compression = rle]
                  7046ff16    00000009     (.cinit..bss.load) [load image, compression = rle]
                  7046ff1f    00000001     --HOLE-- [fill = 0]
                  7046ff20    00000008     (__TI_handler_table)
                  7046ff28    00000070     (__TI_cinit_table)

Regards,

David

  • The .const output section is yet another initialized output section, similar to .text.  It can reside in either read-only memory like flash, or read-write memory like RAM.  As such, the .const section does not get initialized by entries in the .cinit section.  

    I don't understand why the .const input section from the file EstimateAndApplyGain.obj, a member of the library DPD_release.lib, is not part of the larger output section also named .const.  There must be code in the linker command file which instead makes it part of the output section .DPD_data.  Perhaps this should be changed.

    If it is not changed, then view .DPD_data just like .const.  

    If the linker command file is not changed, then to avoid this ...

    David Pardessus said:
    warning: section dsp_program_core1.out(.DPD_data) at 086c780h falls in unconfigured memory (skipped)

    The typical method is to modify the ROMS directive in the hex command file.

    Please let me know if these suggestions resolve the problem.

    Thanks and regards,

    -George

  • Hello George,

    I have sent to you the linker command file. We are in rom_model and we copy the content from flash (starting at 0x70400000) to RAM.

    If you look at  GROUP (NEAR_DP) > L2SRAM, we have many .const which do not generate error (only .DPD_data fails).

    When I look at the code of EstimateAndApplyGain, I find no const declared variable but I have severals local initialized variables. I suspect that (.const:$P$T0$1) contains theses initialization values which must be copied from flash to ram.

    Regards,

    David

  • David Pardessus said:
    If you look at  GROUP (NEAR_DP) > L2SRAM, we have many .const which do not generate error (only .DPD_data fails).

    Are you aware this means these .const sections are initialized and allocated directly to L2SRAM?  There is no copy from flash to L2SRAM.  It is your responsibility to get these values copied from the executable .out file to L2SRAM.  I suspect this is not OK.

    David Pardessus said:
    When I look at the code of EstimateAndApplyGain, I find no const declared variable but I have severals local initialized variables. I suspect that (.const:$P$T0$1) contains theses initialization values

    Correct.

    David Pardessus said:
    which must be copied from flash to ram.

    No, just leave them in flash.  There is code at the beginning of the function which copies the values in .const into local variables that are allocated on the stack.

    Thanks and regards,

    -George

  • Hello Georges,

    1-I don't master all the subtleties of the linker command file ;-)

    Can you confirm/deny that cinit only manages initialized but not const data ?

    2-"Are you aware this means these .const sections are initialized and allocated directly to L2SRAM?  There is no copy from flash to L2SRAM.  It is your responsibility to get these values copied from the executable .out file to L2SRAM."

    I want my const in L2SRAM for performance reason. So, can I write something like that ?

            .DPD_const
            {
                -l=DPD_*.lib(.const)
            } load = FLASH, run = L2SRAM, table(BINIT)

    Regards,

    David

  • David Pardessus said:
    I don't master all the subtleties of the linker command file ;-)

    You are doing just fine.  For more background on this topic, please see the article Linker Command File Primer.

    David Pardessus said:
    Can you confirm/deny that cinit only manages initialized but not const data ?

    Confirmed.

    David Pardessus said:

    I want my const in L2SRAM for performance reason. So, can I write something like that ?

            .DPD_const
            {
                -l=DPD_*.lib(.const)
            } load = FLASH, run = L2SRAM, table(BINIT)

    Yes.  This code creates an output section named .DPD_const.  It is composed of all the .const input sections from all the libraries with a name that begins DPD_ and ends with .lib.  It allocated to FLASH for load, and L2SRAM for run.  There is a copy table entry in the .binit section which is processed by the startup code in the compiler RTS library, which causes .DPD_const to be copied from the load address to the run address.

    Thanks and regards,

    -George

  • George,

    It becomes clearer, day after day, but the C6x is a big one ;-)

    Another question about the boot process on EVM with a XDS probe : I do not use flash like I do on my real target. How works the process of loading the .out generated by the compiler ?

    Regards,

    David

  • If you are doing this ...

    David Pardessus said:
    Another question about the boot process on EVM with a XDS probe

    I presume you are controlling execution with Code Composer Studio (CCS).  CCS has access to all the memory in the system.  The loader reads the .out file produced by the compiler.  In the case of initialized sections like .const, it copies them from the .out file to the appropriate memory address.

    Thanks and regards,

    -George