Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/elmot/clion_cmake_nrf5_stub

CMake project stub for NordicSemi nRF5 chips, supports CLion
https://github.com/elmot/clion_cmake_nrf5_stub

arm clion clion-cmake clion-embedded clion-ide embedded hacktoberfest mcu nordicsemi nrf51 nrf52

Last synced: about 2 months ago
JSON representation

CMake project stub for NordicSemi nRF5 chips, supports CLion

Awesome Lists containing this project

README

        

How to convert a standard nRF5 SDK example into a CLion-compatible CMake project
======

1. Create a project folder and `cd` there
1. Download content of this repository to the project folder
+ `git clone --depth=1 https://github.com/elmot/clion_cmake_nRF5_stub.git .`
+ Delete `.git` folder
1. Copy files from the example to the project folder
+ `main.c` -> `src/main.c`
+ `Makefile`->`Makefile.txt`
+ `config/` ->`config/`
+ `.ld` -> `.ld`
1. Open the project with CLion
1. Go through all `Todo` comments in those two files and fill up the information. Use `TODO` tool window for that
1. CLion settings
+ Open `File` -> `Settings` -> `Build, Execution, Deployment` -> `Toolchains` and setup a toolchain out of `MinGW`
and `arm-none-eabi-gcc`
+ Reset CMake caches, wait until indexing is done
+ Create a run configuration of type "Embedded GDB Server" with parameters:
* Name: `flash_debug`
* Target: `flash`
* Executable `.elf`
* Download Executable: `Never`
* 'target remote' args: `tcp::2331`
* GDB Server: path to `JLinkGDBServerCL` executable
* GDB ServerArgs: `-device -strict -timeout 0 -nogui -if swd -s -silent`

Note: For nRF52840 MCU device name is `nRF52840_xxAA`
1. Flash and debug
+ Select `erase` run configuration and press ***Build***
+ Select `flash_softdevice` run configuration and press ***Build***
+ Select `flash_debug` run configuration and press ***Debug***