How to configure codewarrior v10.6 complier to allocate memory for all files in a project for s12z controller??

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to configure codewarrior v10.6 complier to allocate memory for all files in a project for s12z controller??

1,151 Views
aswinkumarr
Contributor III

HI,

 

 

I am working in codewarrior v10.6 and need to build my existing code to my s12z controller. My project got build fully but when i saw the map file, it doesn't show memory allocation for all files. It shows only function which are called in main() gets memory allocated in map file. I need memory allocation for all the functions and variables in my project. Please drop your solutions/suggestions..

 

 

Thank you..

Labels (1)
7 Replies

923 Views
trytohelp
NXP Employee
NXP Employee

Hi,

This seems to be the smart linking behavior.

Only the code used in the application are really included at link phase.

All un-used codes are removed.

You can switch off this option via the linker settings but this could generate lot of new errors for all objects referenced and not declared/defined.

This is not the right way.

Now you can use the ENTRIES ... END

For instance you can have:

ENTRIES

     myVar1 myVar2 myProc1 myProc2

END

This example specifies the variables myVar1 and myVar2 as well as the function

myProc1 and myProc2 as additional entry points in the application.

ENTRIES

     myFile1.o:* myFile2.o:*

END

This example specifies all the objects (functions, variables, constant variables or string

constants) defined in file myFile1.o and myFile2.o as additional entry points in the application.

ENTRIES

*

END

This example switches OFF smart linking for the whole application. That means that all

objects defined in one of the binary files building the application are linked with the application.

For details please have a look to the \CW_MCU_v10.6\MCU\Help\PDF\MCU_Build_Tools_Utilities.pdf manual.

Page 81 on my version.

Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

923 Views
aswinkumarr
Contributor III

Hi,

Thank you for your solution.

I tried by disabling the Smartlink, in that case some file getting linked while building it but got some undefined error. So I am looking to build it with one by one by adding each file separately. I have tried this way but I am getting error like "cannot open file" while building it. Please help to resolve this.

0 Kudos
Reply

923 Views
trytohelp
NXP Employee
NXP Employee

Hi,

This is the problem when the smart linking is disabled.

For me this is too difficult to solve all undefined objects.

The better option is to define the objects you really want to have included in your application using the ENTRIES  ...  END protocol.

Here you can list the variables, functions  and objects you want to add in your application.

All objects listed here will be switched-off at smart linking phase.

For me this is the best approach to do what you're looking for.

Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

923 Views
aswinkumarr
Contributor III

Hi,

I understood your point. I am trying ENTRIES   END protocol to implement that. As i have lot of variables and functions in my project, its too difficult to add everything in that. Is there any possible way to add files in that ENTRIES   END protocol.?

Thank you.

0 Kudos
Reply

923 Views
trytohelp
NXP Employee
NXP Employee

Hi,

I've created an example showing how the ENTRIES ... END must be used.

Please have a look in zip file attached.

For details please have a look in .c source files (main.c includes some information), in prm and map file.

Hope this will help


Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

923 Views
aswinkumarr
Contributor III

Hi,

Thank you very much. It works for my code.

Thank you.

0 Kudos
Reply

923 Views
trytohelp
NXP Employee
NXP Employee

Hi,

Yes by ...

ENTRIES

    myFile1.o:* myFile2.o:*

END

This example specifies all the objects (functions, variables, constant variables or string

constants) defined in file myFile1.o and myFile2.o as additional entry points in the application.

I will perform some tests on my side with S12Z from MCU V10.6.

Keep you informed.

Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply