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.

CCS/AM5728: how to get the begin address and end address of user define data section?

Part Number: AM5728

Tool/software: Code Composer Studio

AM572x Industrial Development Kit ,

in CCS, I put the callback function pointer into  a specail data section ,

i need to get the begin address and end address of this data section, and do the init_call_process.

how can i get the begin address and end address of this data section?

I define a data like this in the source code file:

PRAGMA(DATA_SECTION(__init_call_do1_, ".ncx_modfsymtab"))

const char* __init_call_do1_ = &ncx_init_call_do1;

in the CMD file,  i insert this:

SECTIONS
{
    .ncx_modfsymtab : {
           ncx_modfsymtab_start =.;
           *(.ncx_modfsymtab)
          ncx_modfsymtab_end =.;
     } > APP_CACHED_DATA_MEM
}

did the ncx_modfsymtab_start  is the begin address  of data secetion ".ncx_modfsymtab"?

did the ncx_modfsymtab_end is end address of data secetion ".ncx_modfsymtab"?

but when i build project, it was failed. and the message was below:

<Linking>
"F:/ti/pdk_am57xx_1_0_10/packages/MyExampleProjects/ncx_ethercat/ncx_ethercat.cmd", line 9: warning #10190-D: absolute symbol "ncx_modfsymtab_start" being redefined
"F:/ti/pdk_am57xx_1_0_10/packages/MyExampleProjects/ncx_ethercat/ncx_ethercat.cmd", line 11: warning #10190-D: absolute symbol "ncx_modfsymtab_end" being redefined
"F:/ti/pdk_am57xx_1_0_10/packages/MyExampleProjects/ncx_ethercat/ncx_ethercat.cmd", line 9: warning #10190-D: absolute symbol "ncx_modfsymtab_start" being redefined
"F:/ti/pdk_am57xx_1_0_10/packages/MyExampleProjects/ncx_ethercat/ncx_ethercat.cmd", line 11: warning #10190-D: absolute symbol "ncx_modfsymtab_end" being redefined
"../ncx_ethercat.cmd", line 10: warning #10068-D: no matching section
"F:/ti/pdk_am57xx_1_0_10/packages/MyExampleProjects/ncx_ethercat/ncx_ethercat.cmd", line 10: warning #10068-D: no matching section
"F:/ti/pdk_am57xx_1_0_10/packages/MyExampleProjects/ncx_ethercat/ncx_ethercat.cmd", line 9: warning #10190-D: absolute symbol "ncx_modfsymtab_start" being redefined
"F:/ti/pdk_am57xx_1_0_10/packages/MyExampleProjects/ncx_ethercat/ncx_ethercat.cmd", line 11: warning #10190-D: absolute symbol "ncx_modfsymtab_end" being redefined

  • I presume you use the C6000 compiler tools.  If you use ARM instead, the answer is the same, but the link ought to be to the ARM manual instead of the C6000 manual.

    I'm pretty you give the linker the command file ncx_ethercat.cmd two different times.  Change the linker invocation so it only appears once.

    roger wang said:
    how can i get the begin address and end address of this data section?

    For the best way to do it, please search the C6000 assembly tools manual for the sub-chapter titled Address and Dimension Operators.  For the best way to refer to those symbols from C or C++ code, please search the same manual the for the sub-chapter titled Using Linker Symbols in C/C++ Applications.

    Thanks and regards,

    -George