Getting up and running with MyNewt and Adafruit Feather nRF52 Pro

So I’ve been out of directly designing hardware for the last year and also the projects I’ve done took a lot of time so the project mynewt ( )took me for a bit of a suprisse. First time I’ve read up on it, it seemed really great. At first it seems it is just a new RTOS, but it is much more than that. It is a whole ecosystem of tools allowing for easily adding features to your projects, porting them to new hardware, new boards and new microcontrollers too. It has tools for getting information from a running system (task cpu and memory usage etc) and it has a great flexible bootloader. And the tools do not force you to use a specific programmer, debugger, compiler etc. Another great thing is that the documentation is preety vast and easy to understand, but also it is kept in sync with the progress of the project.
Also I think a great decision that was made on the start of the project is them doing a whole system which included ble support. In that way from the start it had a complete usecase but to me it seems it is much more than just an IoT platform it’s an enviroment. So when I saw it I got a LadyAda Feather PRO board ( ) with a MyNewt bootloader. It took me some time to figure out that the bootloder is probably too old to be able to communicate with newer versions of newtmgr tool. I am saying probably because I was able to update the image with Adafruit MyNewt tool but not through newtmgr tool, after I compiled the bootloder from the newest code and flashed it I was able to communicate with the board.

Let’s see what my first steps were.

So first I needed to install the tools which was pretty easy. I am running Debian Testing and newt is in the repositories so I just installed ’newt’ and ’newtmgr’ packages. I also neede the arm cortex compiler, that consisted of adding a new repository ( ppa:team-gcc-arm-embedded/ppa ) and installing the ‘gcc-arm-embedded’ package. An in depth explanation of steps needed to do this are in these three documentation pages ( )

Ok all of the tools are here, starting a new project with Newt is pretty simple. Just run ’newt new first’ and when the command finishes we will have a folder named first with the project sceleton inside. The project is linked to the main MyNewt repository so now when we run ’newt install’ it will download all of the code from the repo. You can use the -v flag to get a verbose output and see what the tool is doing. For example for the ’newt install’ command there is no output while it is downloading so it can seem that the program is hanging. This will get us a blinky project that can be simulated localy. Running ’newt build my_blinky_sim’ will compile the sim project which we can start with ‘./bin/targets/my_blinky_sim/app/apps/blinky/blinky.elf’. You will see the output toggling.

Ok, but I want to run it on the board I bought!

The first thing we need to do is to add two more “targets”. MyNewt