Skip to content
/ ruuvi.firmware.c Public template

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

ruuvi/ruuvi.firmware.c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ruuvi.firmware.c

Current git repository status:

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 with Nordic SDK 15. Uses ruuvi.boards.c, ruuvi.drivers.c, ruuvi.endpoints.c, ruuvi.libraries.c and external repositories as submodules.
Release 3.31.1 is in production stage, no breaking changes are expected.
Subsequent pre-release versions may be available.

Setting up

Prerequisites

Suggested

  • Ruuvi Dev kit board and a USB power & data cable.
  • Or another SWD programmer and a cable matching your target board.
  • Segger j-link

SDK 15.3.

Download Nordic SDK15.3 (.8GB) and install it at the project root. If you're working on multiple nRF projects, use symbolic linking to have only one copy.

Creating your fork

Use git to include all Submodules ( ruuvi.drivers.c, ruuvi.endpoint.c, etc )

Run git submodule sync --recursive and git submodule update --init --recursive to update the modules from the master repository .

Customize things like Advertising Interval or Interval between history log samples or Motion Sensetivity.

  • Review application_config/app_config.h to locate configurable items.
  • Edit application_config/application_mode_debug.h (This filename is used in application_modes.h)
  • Be sure to change APP_FW_VARIANT.

Coding style

Use coding style consistant with BARR-C:2018.
Coding style is enforced with Artistic Style. See .astylerc for non-default options (for example max-code-length=90).
Run make astyle.

To validate your changes, for example before testing or making Pull Requests

Compiling and Testing

Segger Embedded Studio IDE should be used for developing.

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

Start SES

File -> Open Solution -> ruuvi.firmware.c.emProject.
Each of the target boards is in their own project.
In the Project Explorer select the correct project according to the appropriate tag name.

Build

Navigate to Build -> Build <project name>. Select the Build Configuration: Debug, Long Life or Release.

Connect your board with either:

Debug

Navigate to Debug -> Go. This will flash the firmware and start the debugger.

Alternate (non-IDE) building and debugging.

ARMGCC is used for Jenkins builds

You can make the project and a single variant by runnning "make variantName" (for example "make ruuvitag_b" at top level of the repository This way you can be certain to have a repeatable build process.

When building binaries for distribution, use the provided 'Makefile' script. The Makefile uses the tag name of current git commit for filenames and version number. Tags should be valid semantic versions, starting with v and possibly having pre-release information such as -rc2. Do not add build information such as +TestFW. If you have tagged the version as v3.99.1 the files will be named $BOARD_armgcc_ruuvifw_$VARIANT_v3.99.1_$TYPE.extension. For example ruuvitag_b_armgcc_ruuvifw_default_v3.29.3-rc1_full.hex.

Flashing

Connect your board with either:

nRF Command Line Tools

Navigate to ruuvi.firmware.c/src/targets/<board name>/armgcc.
Run make to compile the application.
Run ./package.sh to generate the complete firmware HEX and ZIP files.
To flash the tag, run

nrfjprog  --eraseall   # including previous bootloader
nrfjprog  --program ruuvitag_b_armgcc_ruuvifw_v3.30.0-RC5_app.hex --verify --fast --reset 

Finishing up

Static analysis

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

Sonar scan

Travis pushes the results to SonarCloud.IO. SonarCloud uses access token which is private to Ruuvi. You need to fork the project and setup the SonarCloud under your own account 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.

How to contribute

Using http://github create a branch where the name is a very short description of the changes.

Create a Pull Request with a detailed description of your changes.

  • Do not use something like "Fixed movement threshold", rather use:
  • "Changed movement threshold from 0.064F to 0.128 to make it less sensative"

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 for the 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 at the Forum. 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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published