Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF5 SDK16: Ble DFU service not conditionally compiled

While most of nRF5 DSK modules have conditional compiling, such as 

#if NRF_MODULE_ENABLED(BLE_DIS)

the components/ble/ble_services/ble_dfu/*.c lack these macros. In my project which has unbonded dfu service on nRF52832 but no bootloader at all on nRF52811 this wastes about 80 bytes of RAM to static variables and probably some flash to code. It's a relatively minor thing but I came across it when squeezing my app into the available RAM. 

I'll add #if NRF_MODULE_ENABLED(BLE_DFU) on my files, just noting this here for the benefit of others.  

Related