This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Easy way to remove unused elements of the SDK

After trials and tribulations I have finally gotten a pulse ox device to work as I needed to. I started with the health thermometer example in the 12.3.0 SDK which is the latest I can use with the nRF51822.

I removed as many of the SDK calls as I could in favor of using the SoftDevice calls. This works for BLE. pairing, and flash writes. But I need other support methods for UART and whatever else the board needs.

What I would like to do is remove all the source and include files that are not being used. Is there a tool for doing that besides trial and error (removing a source file and commenting out includes and seeing if the project still builds)? The simpler the final project looks, the better, and I don't want to include any instructions in the hex file that are never used. I don't know if the Keil compiler/linker is able to filter out unused object code or not.

Parents Reply
  • The reason for removing unused source from the project is simply to reduce it's massive size when you want to distribute the project around. It will also reduce rebuild times. Going method by method would be quite tedious as there is no clear way to know if you have caught everything. In the end its beginning to look like the only feasible way to do this is to remove a file, build, and see if it succeeds.

Children
No Data
Related