BoSL nano - Setting up nRF9160 firmware
Here we will describe in detail how to make a build of the nRF9160 firmware for the BoSL nano.
Installing nRF connect
The first step is to install the nRF connect SDK. This will install all the necessary tools. A tutorial is provided at Nordic semiconductors documentation
once this is done, you should have the required tools installed in a ncs directory at the chosen installation directory.
Adding BoSLnano configuration files
We now need to add the BoSL nano board configuration. This provides definitions of where the various peripherals are located, such as LEDs, GPIO, and UART. Download the board definition and unzip to the directory
\ncs\v1.6.0\zephyr\boards\arm\bosl_nano.
Building
Navigate to
\ncs\v1.6.0\nrf\applications\serial_lte_modem
Open prj.conf and un-comment the options CONFIG_SLM_CONNECT_UART_2 and CONFIG_UART_2_NRF_HW_ASYNC_TIMER. Also comment the options CONFIG_UART_0_NRF_HW_ASYNC_TIMER and CONFIG_SLM_DATAMODE_HWFC. This will configure the build to us UART2 as needed for the BoSLnano hardware configuration.
We also need to create a file in this directory bosl_nanons.overlay, with the following contents:
&uart2 { compatible = "nordic,nrf-uarte"; current-speed = <115200>; status = "okay"; tx-pin = <10>; rx-pin = <11>; rts-pin = <0xffffffff>; cts-pin = <0xffffffff>; }; &i2c2 { status = "disabled"; };
This will configure UART2 to the correct pins and disable hardware flow control.
Now open a shell terminal and run
west build -b bosl_nanons --pristine
This will build the firmware for the BoSLnano board.
Flashing
The build process creates a firmware hex file in
\ncs\v1.6.0\nrf\applications\serial_lte_modem\build\zephyr\merged.hex
Open the nRF connect application and programmer tool, add the firmware hex file and connect the BoSL nano nrf9160 via an SWD debugger. Click erase and write. Once this process is finished the firmware should be flashed to the nRF9160 and is ready for use.