Skip to content

ruuvi/ruuvi.gateway_nrf.c

Repository files navigation

ruuvi.gateway_nrf.c

Ruuvi Gateway nRF52 code

Build Status Quality Gate Status Bugs Code Smells Coverage Duplicated Lines (%) Lines of Code Maintainability Rating Reliability Rating Technical Debt

Setting up

SDK 15.3

Download Nordic SDK15.3 and install it at the project root. If you're working on multiple nRF projects, you can (and should) use softlinking instead.

Submodules

Run git submodule update --init --recursive. This will search for and install the other git repositories referenced by this project. If any of the submodules has a changed remote, you'll need to run git submodule sync --recursive and again git submodule update --init --recursive to update the modules from new remotes.

Toolchain

ARMGCC is used for Jenkins builds, it's recommended to use SES for developing.

Segger Embedded Studio can be set up by installing nRF Connect for Desktop and following Getting Started plugin instructions.

Start SES and open ruuvi.gateway_nrf.c.emProject in src directory, each of the target boards is in their own project.

Code style

Code is formatted with Artistic Style. Run astyle --project=.astylerc ./target_file.

Static analysis

The code can be checked with PVS Studio and Sonarcloud for some common errors, style issues and potential problems. Here is a link to generated report which gets pushed to GitHub.

PVS

Obtain license and software from Viva64.

Make runs PVS Studio scan and outputs results under doxygen/html/fullhtml.

This results into hundreds of warnings, it is up to you to filter the data you're interested in. For example you probably want to filter out warnings related to 64-bit systems.

Sonar scan

Travis pushes the results to SonarCloud.IO. SonarCloud uses access token which is private to Ruuvi, you'll need to fork the project and setup the SonarCloud under your own account if you wish to run Sonar Scan on your own code.

Running unit tests

Ceedling

Unit tests are implemented with Ceedling. Run the tests with ceedling test:all

Builds

Builds are in the Github project releases.

Developing Ruuvi Firmware

Compiling with SES

Double click to select project: pca10040 or ruuvigw_nrf. Select the confuguaration used to build the project. For ruuvigw_nrf only Release version buildable. Press F7 to build and F5 for debug, or select Build and Debug in menu.

Compiling with ARMGCC

Run make in src directory to build all the sources. Run make clean in src directory to clean current build.

Flashing

With nrfjprog

How to program nRF5x SoCs with nrfjprog you can find Nordic website.To get started:

nrfjprog --eraseall
nrfjprog --program ruuvigw_nrf_armgcc_ruuvigw_release_vX.X.X_full.hex
nrfjprog --reset