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

Difficult to use nRF5x SDK from scratch!

Whose idea was it to make creating a new project from scratch so difficult (if not impossible)????

I have created numerous projects using the nRF5x, but have always used an example project as the starting point.  However, when I want to do something that is in 2 different example projects, I have had a lot of trouble combining them.  And starting from scratch is impossible.  I am using it with IAR.

Why:

1. Mainly because of the sdk_config.h.  Trying to figure out what to enable or disable is very difficult.  Just for the UART/UARTE there are numerous enables.  All the color stuff makes no sense.  I never was able to make use of colors.

2. In order to move a project to a different directory either requires the entire sdk be brought with it, or redefining 1000's of includes paths in IAR's preprocessor options.  This is ridiculous.

3. There are a bunch of Define Symbols in IAR that don't make sense.  Having to recreate this for a scratch project is ridiculous.

4. TI does the above also, and I stopped using their sdk.

5. I have worked with numerous large software development companies that have written nRF5x projects.  They have all used example projects to get started because they say they can't figure it out either.

The API docs are OK, allowing me to do an include and start using the sdk calls, they are OK.  But having to read 25 documents and take 3 classes to create a scratch built project enviroment is not acceptable.

Parents Reply
  • I know the SDK can not be changed quickly, but please bring the concern to the right people in hopes an easier method is found in the future.

    Do you have any specific suggestions on how to improve the nRF5 SDK? If so, I would appreciate if you could share it with us.

    Another how-to I'd like to see is how to eliminate sdk_config.h completely please and all other config.h as well nrfx, mesh

    I think configurations can be quite useful when developing an application. It enables the developer to pick and choose specific features and libraries, and to configure the pins and parameters of a particluar peripheral (e.g. baudrate and CTS pin of the UART peripheral). I might be wrong, and it may exist other ways of doing it. Do you have any suggestions?


    One of our newest products, the nRF9160, supports the nRF Connect SDK. This is a framework based on the Zephyr Project, and is quite different from the nRF5 SDK. Check out the nRF Connect SDK documentation for more information.

    Best regards,

    Simon

Children
  • i Would say that thorough tutorials, about which elements need to be in a standard project, and when to change the cinfig.h (i know that the team is capable of this, since the BLE tutorials were pretty good.). IF i remember correctly it's rarely mentioned when you need to set a flag when reading in the infocenter. apart from that it's also often hard to figure out which headerfile to use when looking at functions. I always end up using Atom to search the directory.

    After exploring the SDK for a while i notice alot of the things i spend time trying to figure out in the beginning, are written in the infocenter. Problem is that it's a labyrinth to navigate.

  • It is not at all useful, instead it is a useless jungle.  The older SDK didn't have and it was super great and simple.  To configure a UART we just need to fill a config data structure with pins, baud rate and call init by passing it as parameter. The same for initializing the Softdevice, we can configure crystal/rc at will.  It was simple no mess and nothing was hardcoded. Since the introduction somewhere along the line of SDK10 I think, things got a lot messier with sdk_config.h, everything is hardcoded in it.  Due to that, it is not possible to compile the SDK into a lib and reuse in multiple projects. Now we have to add SDK source files to each project and every time we need to add one there is a min of 3  to 20 defines to add to the sdk_config.h.  The sdk_config.h ended up with over 300KB near 10000 lines of defines.  Isn't it ridiculous ? Thanks to the new scheme of the SDK I was able to teach the interns a great examples of what a bad programming practice is about.  

  • I second Mojo on that and also add this.  The much older SDK has all the includes files in 1 place with few folders underneath for grouping.  It was supper easy to add includes path.  Now it is all over the places and have to search for them and add a bunch of paths.  This is also bad programming practice as well.

  • Simon,

    I am relatively new to developing with Nordic Semiconductor.  Therefore, I cannot reference early SDK versions.  As such I have the perspective of someone who is constantly trying to learn from scratch how the SDK works and how to get the stack and hardware to do what I need it to do. In this process I have found a number of things difficult when using the NRF5 and the NRF Mesh SDK's.  

    First, the documentation of lower layers and configuration files lack all the needed information to quickly use them.  Often comments for variables, type def's, and functions say "X is X."  The infocenter usually says the same thing as in the code. Therefore, connections between different configure variables are not apparent.  For instance, my colleague set the max value for an element but did not realize that there was a max value for the whole node as well.  When provisioning the node failed he spent nearly a week troubleshooting the provisioner and element instances.  It's instances like this that reveal the weak points in the documentation.

    The config.h file is exceptionally long as previously mentioned. The steps provided by Simon see quote can be quite labor intensive, and speaks to the reality that there is not an easy way to start a project from scratch without having to use an example as a base.  Finally, I am not sure if I saw any explanation of the <e> to </e> before reading this post.

    • Look into drivers/sub drivers, ...
    • Search for the config in the sdk_config.h of ...
    • Copy this config, and the associated configs into the sdk_config.h file of the ble_app_uart project
      • E.g. if SPI_ENABLED is the config you are looking for, then include all the configs that are "caught" between <e> and  </e> 
        • // <e> SPI_ENABLED ...

    To address my statement of bloat within the code, I use abstraction to make development easier and so does the SDK code.  However, there are points that have unnecessary levels of abstraction.  There are declarations like this "typedef struct __generic_onoff_server_t generic_onoff_server_t;" where the __generic_onoff_server_t is only used to define generic_onoff_server_t.  It is a typedef that just references a different typedef.  These are all over the place function definitions that only reference other function definitions.  This makes it difficult to track what is happening or what is defined as what when diving into the code.  I do not understand why this is being done.  It adds extra lines of code and hurts the readability of the code.

    Respectfully,
    Billy Ivy

  • Thanks for the feedback from everybody, it is appreciated. I will get in touch with the developers responsible for creating the nRF5 SDK, who also has more insight about this.

    Best regards,

    Simon

Related