This project enables writing code in CLion (in my opinion one of the best C/C++ IDEs available - user friendly yet powerful and packed with useful features) while compiling and debugging it with Keil µVision® (in my opinion Keil® MDK is one of the most comprehensive software development solution for Arm®-based microcontrollers, integrating powerful, feature rich compiler and debugger).
After many embedded projects, one can figure out that properly configuring CLion as a compiler (using GCC ARM Embedded) and sophisticated debugger is almost as hard as writing a lot of code in the µVision.
As a quick solution CMake ⇄ µVision Synchronizer was created, however until that project is ready for the actual use, this template is used for new projects.
Nordic's nRF5 SDK 15.0.2 shall be located in the nRF5_SDK_15
subdirectory.
If the SDK is located somewhere else, symlink can be used.
As example, if using Windows 10 and the SDK is located in G:\SDK\nRF5_SDK_15.2.0_9412b96
then the symlink is created with the command:
mklink /D nRF5_SDK_15 G:\SDK\nRF5_SDK_15.2.0_9412b96
Machine-specific CMake file environment.cmake.template shall be copied to environment.cmake and edited according to the host machine and AMR Compiler installation.
Building is done using Keil uVision using the project file ble_app_template.uvprojx.
As the ble_app_template.uvoptx file is excluded from this repository, the debugger settings are also lost (they are per-user-hardware specific anyway). Take note that when the debugger is selected in µVision (under Options for Target... → Debug) one should also tick Download and Run checkbox in Download Function section on Flash Download tab in the debugger settings. This checkbox is not enabled by default, but can cause a lot of frustration when just pressing Download button and wondering why the program does not work, despite being identical to example project.