Saying I have some application for nRF52832 that does it's job, and now I want to add Bluetooth LE functionality to it.
I enabled S132 soft device in runtime settings, but how do I include S132 into my project so it's available there?
I tried to compare my project with examples in nRF5 SDK, and I see that examples have two targets in .uvprojx file, one for main app and another for the softdevice; though Keil UI only displays main app target in a project tree. So a softdevice is a kind of hidden target in the example app. But I do not see which settings in Keil UI respond for that.
So, how do I add it as a similar target to my existing app?
What else is necessary to enable it in my code?
I would strongly recommend that you start with a suitable Nordic BLE example, and merge your other code into that.
https://devzone.nordicsemi.com/f/nordic-q-a/70335/integrating-s113-to-ses-project/288414#288414
https://devzone.nordicsemi.com/f/nordic-q-a/69775/ble_uart-example-and-uart-driver/286176#286176
This is good approach when you have 'hello world' to merge. But what if existing project is what you said already - some other code merged to another (non-BLE but also not trivial) example from Nordic?
Merging any two non-trivial sets of code is always going to be non-trivial.
But I still think that adding the non-BLE code into a BLE example is the easiest & best way to go in the specific case of the Nordic nRF5 SDK.
This is because getting Nordic's "SoftDevice" BLE stack working is not just a matter of source code - there a whole load of other project options and settings that need to be right. IMO, it is far easier to start with a known-good BLE project - where all that stuff is already done and correct for you.
Your non-BLE code should have none of those issues?
Is the non-BLE code your own, or from a 3rd-party?
This has nothing specifically to do with Keil.