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/TMS570LS3137: No user defined object code is included in the linker map

Expert 1995 points
Part Number: TMS570LS3137
Other Parts Discussed in Thread: HALCOGEN

Tool/software: Code Composer Studio

Hello,

I build my own source file without errors and object code files are there after compiling, but when I open either the Memory Allocation view of CCS or the linker map (projectname.map), those files are not considered.

Can you explain me why?

Thanks!

Regards.

  • Hi,

    I can't quite understand the issue you are having but, as a general case, if your custom code is not being called from anywhere (either from main() or from a function called from main()), the compiler will create a .obj file but the linker will simply ignore it. 

    There are other specific cases where code may be suppressed (optimization, Interrupt vector code, etc.) that will require a volatile keyword in front of the function or variable. 

    if you are using the Hercules family of devices and HalCoGen, you will have to be sure your functions and custom code are being called from the main(), which is typically located in the file named <sys_main.c> inside the directory named "source". Otherwise, the same issue above will happen. 

    Keep in mind the file <sys_main.c> is overwritten every time the code is auto-generated by HalCoGen. 

    Hope this helps,

    Rafael

  • Hello,

    Thanks for the reply.

    desouza said:
    if you are using the Hercules family of devices and HalCoGen, you will have to be sure your functions and custom code are being called from the main(), which is typically located in the file named <sys_main.c> inside the directory named "source". Otherwise, the same issue above will happen. 

    I have called some function in the main and now the linker map recognizes the object code they belong to, but I have still some doubt:

    - The memory allocation view of CCS does not include yet my custom object code;

    - I have found a row of the linker map set as "HOLE":

    origin:    length:         attributes:

                      0000632a    00000002     --HOLE-- [fill = 0]

    Could you tell me if what it means?

    Thanks ahead.

    Regards.

  • Hi,

    Does your project have any optimization turned on? This increases the chances of removing code the optimizer thinks it performs redundant functions. 

    Also, if your functions do not perform any meaningful function from the compiler standpoint (such as a delay loop or an interrupt routine), the compiler may remove it even without optimization.

    In these cases, you need to either use the modifier volatile for variables or retain for interrupt service routines. 

    Also, holes are common to pad misaligned data or code that may either be incompatible with the architecture or may impact performance. 

    Hope this helps,

    Rafael

  • desouza said:
    Does your project have any optimization turned on?

    The optimization level is off. Only the Speed vs size (--opt_for_speed) is set to 1. 

  • Hi,

    Would you mind sharing the code or projects then? It seems there is just a minute detail that may be missing. 

    Regards,

    Rafael

  • Unfortunately, I am not allowed to, but I can share my linker map; can it help? In this post with the same issue the cause was found simply looking into such file. I have enabled also the complete view and I am going through it but still unsuccessfully.

    linker_map.map.txt

  • Hi,

    Linker map files do not reveal any missing symbols or unallocated code, unless the linker itself throws an error. 

    As Archaeologist mentions on his last post, without a test case it is difficult to locate the exact reason why the symbol/function your code is not being linked. What is the symbol name? 

    If it is possible to send a project that can be built locally, we can try to connect in direct messaging and bypass this public venue. Let me know if this can be a possibility. 

    Regards,

    Rafael