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

Pared Down BLE Peripheral Example Code

Hello everyone,

I'm doing some work in SDK 12.1 and noticed that even the example peripheral project "ble_app_template" compiles to 26K under Keil. Given there is a 32K linkage limit in the evaluation version of that IDE, you're not left with a lot of code space to implement your project.

Attached a version of main.c that conditionally compiles out the Peer Manager, freeing up nearly 13K of code space. All you need to do is open sdk_config.h, uncheck PEER_MANAGER_ENABLED under the nRF_BLE branch, use this main.c as your jumping off point and you're ready to go.

Note that if you need whitelisting, pairing, etc. for quick and automatic re-connection to a Central or link security, you will need Peer Manager and this is not for you. But for many projects in the R&D/eval stage, this should buy you some time from needing to purchase a Keil license or move to GCC.

Dan

main.c

Related