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

Old Examples vs. New Examples -- SDK7 vs. Recent SDKs

Hi,

I own company that builds a PIC 8-bit devices, and can code at a low bit level in the PIC environment.

I picked up the NRF52 Dev board, and am trying to learn the ARM environment and the Nordic SDK. I overall get the SDK functions, but I don't understand the SDK file structure and how this is all built together in KEIL when you open a project.

When I look at old examples from NORDIC:

github.com/.../main.c

That example I get, there is a header (nordic.h) that defines the registers, and then you can inclue other libraries in your project for the functions you need. It basically is like coding a PIC in C.

What changed from SDK 7 to SDK 8, in all of the example files the nrf.h headers and linkage all got removed. I don't understand how the headers come together now in the more recent SDKs and how a defeault KEIL project is put together.

When I open the sample blinky project in KEIL, with the most recent turn of the SDK. It opens a bunch of packs and if you go to the main.c there are like a million dependent files and libraries in the whole project. What happened: SDK 7, has a few includes, and a main.c...? Why did the SDK get more complicated? I'm missing something.

Like the new blinky example, yes it blinks a light, but it is configured in such modularized way you have to look at board.h and all kinds of other library files just to figure out the most basic of commands (ie. setting a pin as an ouput)

If you create a project for the NRF52 dev board, does KEIL just pulling in all the libraries and headers, and then you can call whatever you want, and then when it compiles it only pulls in what you need?

I am just missing something how the NORDIC SDK is structured to build out the software. What has changed from the old examples to the new examples?

Thanks, -Tim

  • Hi Tim,

    With the introduction of Pack system by Keil, we started integrated that in our SDK from SDK v7.0.

    "KEIL just pulling in all the libraries and headers, and then you can call whatever you want, and then when it compiles it only pulls in what you need?" => This is actually how Packs work :)

    However, that caused quite some issues and troubles and some of them are out of our control. You can read more ab it here.

    From SDKv11 we deprecated the use of pack and avoid the dependency on it as much as possible.

    My suggestion is to use the latest SDK, which is v12. In that SDK the only Pack packages needed are CMSIS and nRF_DeviceFamilyPack (Nordic headers).

    You will find the header files, such as nrf.h, nrf51.h, nrf52.h, etc under the device family pack folder C:\Keil_v5\ARM\Pack\NordicSemiconductor\nRF_DeviceFamilyPack\8.9.0\Device\Include.

    The blinky project should be simplified as only main.c file and the header files are needed.

  • Hi Hung,

    Thanks that is really helpful.

    I think what is confusing is that even in the "no_pack" build of the Blinky example, when you open the project in KEIL it still is pulling in those CMSIS and the nRF_DeviceFamilyPack. So it is confusing -- am I using the packs or not? I saw that deprecation note in the forum, but then the packs are still half-used...?

    I'm coming at this completely new, and I get there is this push from ARM for CMSIS compatibility. The ARM development framework is really scattered compared to PIC which controls the language and toolchain.

    If you were building a new application, can you use the SDK without any of the CMSIS hooks for the build, and just use the device includes, as per the old samples OR do you need to those two CMSIS packs?

    Also -- why do you need the device headers, if you still have those CMSIS packs? I don't understand the demarcation.

    Thanks, -Tim

  • Hi Tim,

    I agree that it's a little bit strange that with _no_pack we still need pack.

    But to be able to have the device definition (in project setting -> Device tab) we would need the Device family pack, and to be able to use Pack system, we need ARM-CMSIS pack.

    Note that the ARM-CMSIS pack contains the generic CMSIS components supplied by ARM, it's hardware vendor independent, common for all implementation of ARM Cortex family. The device family pack is more specific for a particular chip with vendor implemented design.

    For full control, I would suggest you to use gcc instead.

Related