Bare metal programming on the nRF9160

I have purchased the nRF9160 Development Kit and are just getting started with the device and the nRF Connect SDK.

I intend to use the supplied LTE-M modem firmware for my project along with my own application firmware. However, it seems like all the samples included in the SDK needs the Zephyr real-time OS in order to work.

Is it possible to do bare metal programming on the nRF9160 like I did with the nRF52840 and basically all microcontrollers I have programmed before?

I searched quite a bit in the files included with the SDK, and I found no samples with a linker script and traditional makefile for GCC, and I have no idea which headers to include in order to access registers in a convenient way.

Thanks in advance Slight smile

Parents Reply Children
  • Thanks, Sigurd :-)

    I have now created a makefile that can build a "blinky" example without Zephyr. I have only tested this with the nrfx.h header, but I guess that it is possible to add C files from the nrfx library to the object list in the makefile, if one wishes to use the nrfx library for more than just easy register access.

    Example output when building and flashing:

    It actually works and makes the LEDs light up on the board :-)

    main.c

    Makefile

    The makefile is a bit messy and may contain errors or suboptimal settings or flags, so any suggestions are welcome, but so far, so good :-)

  • This post just saved me a few hours, thanks a lot ;)