I am developing my project with RT1064 + MCUXpresso. I found some unused functions are compiled, I would not like to compile them. How do I need to set in the MCUXPresso, anyone can help me? thanks.
Unused functions should get automatically removed by the link step using its "unused section elimination" optimisation (unless you have changed the project default settings). More information in this old LPCXpresso FAQ, which still applies to MCUXpresso IDE.
https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/Unused-Section-Elimination/m-p/475002
Hope this helps!
Hello colinluan,
gcc (which is used inside of MCUXPresso) can do this for you. Compare this guide
https://stackoverflow.com/questions/6687630/how-to-remove-unused-c-c-symbols-with-gcc-and-ld
Best Regards
HI @colinluan
You can exclude resource from build
Please refer to below link for more details
https://mcuoneclipse.com/2014/07/22/exclude-source-files-from-build-in-eclipse/
Regards
Daniel
hi,@danielchen
I only want to exclude unused functions instead of excluding whole file. Is there any way to implement it?
for unused function, I would suggest you use
#if 0
#endif.
Regards
Daniel