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

Programming guide for nrf5 SDK

I'm starting to read all the resources and examples included in the SDK. However, there doesn't seem to be a lot of emphasis on explaining how the programming architecture works (ie. event driven, task driven, or what).

A lot of the tutorials and examples simply show you how to compile and run one of the SDK examples. Is there any documentation that explains how one would create their own application entirely from scratch?

This would probably help in understanding the underlaying code in examples rather than just taking an example and adding on custom code.

  • I cannot resist one more note: you cannot expect programming experience like with Windows/Linux/MAC PCs and thing which can run C# or large C++ apps. This cannot stand comparison even with mobile and low power platforms like mobile phones/tablets/raspberry Pi because these consume in average 50-500mA@5V but here you speak about 0.1-10mA@3V in average. Such system is simply much more fragile in terms of HW/SW interaction and how HW directly dictates SW architecture on top of it. And now with BLE you run already one RTOS with sub-microsecond resolution on such single-code system so obviously whatever else on top is limited and must follow certain design. That's why simply looking to examples is the usual way how embedded programmers learn new platform: examples come from vendor and believe they spent years by designing this system so they really know what they are doing.

  • Oh and last one: you might find attempts to bring some higher level language to nRF5x like PuckJS (Java Script) or micropython if you really want to bypass low-level ANSI C libraries and related things. Unfortunately there is no magic out of the air so these systems might work well in basic use cases like advertising beacon or single GAP Peripheral connection link but when adding more and more concurrent things (wither BLE connections or wired interfaces) you will hit the limits. Basically no mass market product uses these, all stick to old fashion C + ASM mix done by senior developers...

  • Yup totally understand about comparing to C#, etc. I was merely comparing the quality of the documentation in that regards.

    Also, I typically avoid higher level languages in embedded applications for reasons you stated. It also adds another layer on top which has its own possible bugs/errata.

    Thanks for the tips!

Related