Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

"Getting Started" is not getting me started.

So I just got my nRF52_DK, got everything installed and compiled an uploaded the blinky example. Fine.

I had my custom PCB ready, and got the 52832 soldered in straight away. Ok, I want to start my own code project. I want to start from scratch, not from the examples which contain way to much stuff I am not familiar with yet and hide away all API calls in the board support packages. I have many years of embedded development experience on Microchip, NXP and ST devices, but I still can't figure how to accomplish this simple task.

The Getting started instructions say:

Install the nRF5 MDK:

    If you use Keil 5, open an example project. Keil will then prompt you to install the nRF_DeviceFamilyPack

Doing that I get version 8.15.2 of the nRF_DeviceFamilyPack, which seems OK, but version 2.0.0_alpha from 2015 of the S132 SoftDevice, which certainly does not seem OK.

After some research I find this post which indicates that after v11 a few years ago I should not be using the Keil Pack Installer.

Does this mean that the Getting started instructions even for SDK v15 are several years obsolete?

And how do I "move to zip based SDK releases"? I have downloaded the SDK v15 zip, but there are no instructions on how to install it in uVision.

Maybe there is no uVision integration in SK v15? Maybe I am just supposed to #include the right files myself and code away? No problem for me, but it would be great with a bit of documentation on where to start... You know, like how to set up the clock, GPIO-pins and interrupts and really basic stuff like that.

Maybe I am supposed to always start from the examples? In that case I have to have a BSP for my own board. But there are no instruction at all on how to create a BSP that I can find, only an API reference (Software Development Kit > nRF5 SDK > nRF5 SDK v15.0.0 > API Reference > SDK common libraries) which has no instructions on how to get started writing a BSP.

I have read all the posts on DevZone which appear when you search for "Get Started", as well as devzone.nordicsemi.com/.../. All except 3 posts are several years old and out of date. None provided a useful way forward, other than pointing me to the examples again. I have also watched the Youtube videos for getting started (Which suddenly use the Segger environment rather than Keil, just to add to the confusion). The videos again only tell you how to work on existing examples.

After the videos I tried Segger instead, and install their nRF CPU Support package. This pops up a promising dialog when I start a new project, where I select to create a Generic Nordicsemi nRF project, which happily creates me a project with no sdk-config.h file and a template main.c which uses printf(). Not so great...

The last user comment on the DevZone forum post I linked to above calls this a nightmare. I wouldn't go that far, but the Getting started process is definitely neither smooth nor easy. I am supposed to be developing a BLE Mesh network app, but after a full day of reading docs and posts I have still not been able to even flash a LED on my own board. I just feel confused.

I want to learn to crawl before I run. All I want to know is: How do I properly start a new simple SDK project for my custom hardware from scratch?

[Update]

After some more research I did find the "template_project" example, after seeing it mentioned in a single paragraph far down on some manual page. But it has path names configured so that it only works if the project if located inside the SDK examples folder. If you try to save it outside it breaks.

And I can flash my LEDs now. But it took almost 3 days to get that far. There are some simple things that could be done to make this process smoother:

- Writing your own BSP is not that hard. But things like the BOARD_CUSTOM define and how to use it to create your own board header file is not even mentioned in the documentation. It has to be found from reading source files.

- A Step-by-step on how to create a new project in either Keil or SES (maybe decide about which one to use...?) and get the environment set up with sdk_config.h etc would not be that hard to write. With an example project which can be compiled even if it is outside the SDK folder.

  • My suggestion would be to explore `examples` folder, find something interesting and just open its *.uvprojx file with caveat that until Keil database updates you'll have to install this first.

    Compile and play with it, then explore how Keil project is set up and adapt it for your own needs. You'll need to know a lot of Nordic SDK specific things to set up a project completely from scratch.

    And if you want to have a better experience consider using SDK14.2 and apply patches for issues described here. SDK 15.0 is very new and I'll take some time for the community to discover if it has bugs and develop fixes.

    As for difficult experience this is the same for all embedded/C software you'll have to exceed critical mass of project specific knowledge and this AFAIK can only be done the hard way - by experimenting, doing your own projects and reading source code of the parts you want to know best.

  • Thanks a lot for the tip on SDK versions.

    AFAIK can only be done the hard way

    Not true. Just for fun you can for example look up STM32CubeMX when you take a coffe break some time.

  • This tutorial could be a good starting point. It is based on the ble_app template project. This is a good example to start with if you want to start from scratch.

    Were you referring to the getting started guide in the Nordic Infocenter? I agree that it is slightly outdated & will mention this to the team.

    I agree that it is a good idea to explore the examples folder (in addition follow the infocenter documentation for testing the examples). 

    Support for custom boards is mentioned briefly at this link. We recommend all new people to start with segger embedded studio if they do not have a Keil license because SES is free to use for Nordic SDK users, while Keil costs quite a lot if you go over the code size limit. My recommendation would be to use SES, check out the Youtube video tutorial if you have not already & start with the template example you mentioned.

  • Were you referring to the getting started guide in the Nordic Infocenter? I agree that it is slightly outdated & will mention this to the team.

    Yes. I think you will benefit from updating it. Save your new users a few hours of frustration...

Related