on a diet

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

on a diet

跳至解决方案
735 次查看
erikmalund
Contributor I

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

标签 (1)
0 项奖励
1 解答
640 次查看
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 项奖励
2 回复数
640 次查看
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 项奖励
641 次查看
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 项奖励