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.