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.

copying functions in external memory using emif

Other Parts Discussed in Thread: TMS570LC4357

hi ti,

i'm using tms570lc4357

i have copied 2 different functions in sdram using emif.

both the functions are copied  when i call both of them in main or somewhere else.

but when i cal only one function the other one is not copied in that location. why??

  • Hi,

    What happens is, that the linker detects that the first function is never called and thus it doesn't link i to your binary. This is a normal optimization technique to save memory, I think it's called conditional linking.
    However, if you want to prevent the linker from doing o you got several options I would suggest one of the following two:
    1. use the #pragma RETAIN(symbol/function name); in your C file, this will cause the linker to link the function to the binary regardless if it is used or not. This is described in detail in the User Guide SPNU151J in Section 5.10.22.
    2. use the --retain=sym_or_scn_spec command in the linker command file. This is described in detail in the User Guide SPNU118M in Section 8.4.28.

    Best Regards,
    Christian