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

How to start working with nRF SDK and Segger Embedded Studio

Hello.

In last couple of days I've been trying to figure out how the whole SDK is structured and how to start developing essential applications using the Segger Embedded Studio.

I only have in my possesion an nRF51822 but 3 modules nRF52832 are on their way. 

So, to begin with I started with the last SDK which supports the nRF51 series which is the v12.3.0

1) I downloaded the "nRF CPU Support Package" from the Package Manager and made a new project. Selected my mcu and I got a main.c

2) I didn't want to open an example and start removing things out, so I opted to try adding the things I thought I need. I started addind the simplest functionality of GPIO. I haven't found any more relevant file apart from the "nrf_gpio.h". I included the file in my main.c then after trying to build the project I got an error. I traced down the file name to find where it is located inside the SDK and I placed the path into Project Options -> Preprocessor -> User Include Directories.

My folder structure looks like this

(my workspace)
|-- nRF5_SDK_12.3.0_d7731ad (SDK)
|-- Executable_1 (my project)
    |--- Application
          |--- main.c

And I added the line into the User Include Directories.

../nRF5_SDK_12.3.0_d7731ad/components/drivers_nrf/hal

3) Everything worked fine and I managed to run a simple blinky program when I added the nrf_delay header.

4) Things were more complicated when I tried to add a UART peripheral driver. I started by including the app_uart.h into my main.c
Needless to say how many files I had to look for in the SDK folder to manually include them into the User Include Directories. Moreover I ended up importing some other .c files which I don't know what they do, so I can sort them out properly.

Is there any more elegant way to do that?

Parents Reply Children
Related