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/TMS320F28379D: Creating *.out file without main

Part Number: TMS320F28379D

Tool/software: TI C/C++ Compiler

Hello, 

I want to create a project in CCS with a c source file which contains only constants and no main function. How do i create a *.out file with such a file in Ti compiler.

source.c

const int TEST_DATA = 0xAA; //only this statement

I get below error:

error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "TEST_EXEC2.out" not built

I want to create this as a *.out and load in FLASH K sector, is this possieble

Thanks,

Nagesh

  • NAGESH RK said:
    I want to create this as a *.out

    I can show you how to do that.

    Presume file.c contains this one line ...

    NAGESH RK said:
    const int TEST_DATA = 0xAA; //only this statement

    Presume the linker command file link_to_flashk.cmd contains a combination of MEMORY and SECTIONS directives that cause the section .econst to be allocated to a range of FLASH K memory that is not used in any other linker command file.  Please see the article Linker Command File Primer to learn about the MEMORY and SECTIONS directives.

    Commands similar to these build the .out file you describe ...

    % cl2000 file.c
    % cl2000 -z file.obj -o file.out -e _TEST_DATA link_to_flashk.cmd

    The first command compiles the C code.  The second command links it.  The -z option says the rest of the command is for linking.  The -o option names the output file.  The -e option says the entry point of the code is the symbol _TEST_DATA.  Please search the C28x compiler manual for the sub-chapter titled Linker Options for the details on those options.

    Note there is no straightforward method by which code in another program can refer to the symbol TEST_DATA.  I presume you are OK with this limitation.  

    NAGESH RK said:
    load in FLASH K sector

    That's probably possible.  But I don't know how to do it.

    Thanks and regards,

    -George