on a diet

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

on a diet

Jump to solution
655 Views
erikmalund
Contributor I

anyone have (preferably using CodeWarrior) a method for finding uncalled functions? (no Keil or IAR available)

Labels (1)
0 Kudos
1 Solution
560 Views
adriansc
Contributor IV

Hi,

If you want to erase this uncalled functions because they are waste of space in memory all that you need to do is to Remove them in linker options. Go to Project Properties (right click on project) > C/C++ Build > ARM Ltd Windows GCC C Linker > General  and check the box "Remove unused sections" (this one is by default). With this all the uncalled functions will not be linked.

in a diet uncalled functions.png

You can check all the functions, variables and more in .map file (located in FLASH folder) there you can see the size of every function; all the uncalled functions will not have size because are not linked.

In the other hand if you only want to know which functions are uncalled check .map file: functions with size 0x00 are unused functions.

Hope this helps.

View solution in original post

0 Kudos
2 Replies
560 Views
erikmalund
Contributor I

figured that one out a week ago, your answer, while appreciated, is a bit late

what blew me is that you can "set a breakpoint" in an uncalled function.

with other systems setting a breakpoint is a good way to see if a given function is included.

0 Kudos
561 Views
adriansc
Contributor IV

Hi,

If you want to erase this uncalled functions because they are waste of space in memory all that you need to do is to Remove them in linker options. Go to Project Properties (right click on project) > C/C++ Build > ARM Ltd Windows GCC C Linker > General  and check the box "Remove unused sections" (this one is by default). With this all the uncalled functions will not be linked.

in a diet uncalled functions.png

You can check all the functions, variables and more in .map file (located in FLASH folder) there you can see the size of every function; all the uncalled functions will not have size because are not linked.

In the other hand if you only want to know which functions are uncalled check .map file: functions with size 0x00 are unused functions.

Hope this helps.

0 Kudos