Skip to content
/ ruuvi.firmware.c Public template
forked from ruuvi/ruuvi.firmware.c

Ruuvi Firmware version 3. Built on top of Nordic SDK 15, uses both Ruuvi and external repositories as submodules. In Beta, no breaking changes are intended but may be done if absolutely necessary

License

Notifications You must be signed in to change notification settings

fahol28/ruuvi.firmware.c

 
 

Repository files navigation

ruuvi.firmware.c

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

Ruuvi Firmware version 3. Built on top of Nordic SDK 15, uses both Ruuvi and external repositories as submodules. Under development, please follow Ruuvi Blog for details. The project is in beta stage, no breaking changes are intented but will be done if absolutely necessary for some reason.

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. You can make the project and all variants by runnning "make" at top level of this repository.

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

Start SES and open ruuvi_ruuvi.firmware.c.emProject at root level, each of the target boards is in their own project.

Code style

Code is formatted with Artistic Style. Run astyle --project=.astylerc ./target_file. To format the entire project,

astyle --project=.astylerc "src/main.c"
astyle --project=.astylerc --recursive "src/application_config/*.h"
astyle --project=.astylerc --recursive "src/tasks/*.c"
astyle --project=.astylerc --recursive "src/tasks/*.h"
astyle --project=.astylerc --recursive "src/tests/*.c"
astyle --project=.astylerc --recursive "src/tests/*.h"

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

Gcov

Ceedling can also generate Gcov reports with ceedling gcov:all utils:gcov. The report can be found under build/artifacts/gcov.

Unit test continuous integration

Travis will fail the build if unit test fails and Gcov results will get pushed to SonarCloud.

Usage

Compile and flash the project to your board using SES. Instructions on how to use a bootloader will be added later on. The project is not yet in a useful state for any practical purpose other than learning.

Note: You should erase your board entirely in case there is a bootloader from a previous firmware.

How to contribute

Please let us know your thoughts on the direction and structure of the project. Does the project help you to understand how to build code on RuuviTag? Is the structure of the project sensible to you?

If you want to assist in the project maintenance by fixing some issues doxygen.error is a good place to look for code which needs better commenting. Project badges at the top of the readme point to issues which range from trivial clarifications to complex refactoring.

If you want to add new features, please discuss the feature first, and then create ceedling unit tests for the functionality. Once the functionality is agreed and testable in can be integrated into project.

Licensing

Ruuvi code is BSD-3 licensed. Submodules and external dependencies have their own licenses, which are BSD-compatible.

Documentation

Document is generated with Doxygen. Run make doxygen to generate the docs locally, or browse to Travis built docs

About

Ruuvi Firmware version 3. Built on top of Nordic SDK 15, uses both Ruuvi and external repositories as submodules. In Beta, no breaking changes are intended but may be done if absolutely necessary

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • C 76.2%
  • Makefile 17.9%
  • Shell 4.6%
  • C++ 1.3%