GithubHelp home page GithubHelp logo

ojousima / ruuvi.firmware.c Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ruuvi/ruuvi.firmware.c

0.0 2.0 0.0 1.29 MB

Ruuvi Firmware version 3. Built on top of Nordic SDK 15, uses both Ruuvi and external repositories as submodules. Under development, not recommended for any use yet.

License: BSD 3-Clause "New" or "Revised" License

C 20.74% Makefile 4.20% Shell 75.06%

ruuvi.firmware.c's Introduction

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 alpha stage, build maybe broken in obvious ways and not build at all or in non-obvious ways and fail on some Ruuvi boards.

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.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.

Changelog

3.28.6

  • Add Travis CI and SonarCloud support

3.28.5

  • Convert project to use Ceedling for unit tests.

3.28.1 ... 3.28.4

  • Bugfixes
  • Add longlife-logging

3.28.0

  • Fix storing and loading sensor configurations
  • Store fatal error sources to flash before reboot.

3.27.2

  • Use busyloop in log flush to avoid getting stuck if logs are flushed in interrupt context
  • Initialize variables in environmental logging to zero. Explicit U64->U32 timestamp typecast.

3.27.1

  • Fix errors in data format 5 encoding
  • Known issue: timestamps are occasionally wrong in log data

3.27.0

  • Rework task structure
  • Add "hearbeat" transmissions to GATT

3.26.5

  • Add SD+BL+APP DFU builds

3.26.4

  • Do not block if RTT logs are not read in debug mode

3.26.3

  • Fix build script in case of out-of-master submodule commits

3.26.2

  • Fix Keijo build

3.26.1

  • Improve logging sent elements.
  • Send 0xFFFFFFFF payload at the end of log data
  • Block until RTT logs are sent in debug mode

3.26.0

  • Add Humidity, pressure logging PoC

3.25.1

  • Add Temperature logging PoC

3.24.2

  • Switch Keijo to S140 for Coded PHY
  • Discard Keijo GATT, bootlaoder

3.24.1

  • Fit Keijo application in nRF52811

3.24.0

  • Initial support for "Keijo"-project
  • Port to SDK15.3

3.23.0

  • Initial support for "Kaarle"-project

3.22.1

  • Use acceleration interrupts for movement counter

3.22.0

  • Add low-power delay to drivers
  • Try to initialize a separate pressure sensor if using SHTC as environmental sensor
  • Add pressure sensor tasks

3.19.0 ... # 3.21.0

  • Various reworks and refactoring.

3.18.0

  • Use refactored drivers.

3.17.0

  • Add NFC writes to tag
  • Disable GATT
  • Use activity interrupts, advertise data format 5
  • Trigger watchdog if data is not sent via NFC, GATT or advertisement for 120 seconds.
  • 27 uA current consumption at 3V

3.16.0

  • Add GATT profile
  • Stream accelerometer data over GATT / NUS
  • Tigger watchdog if data is not sent over NUS for 120 seconds
  • Disable data advertising
  • Disable activity interrupts from LIS2DH12

3.15.0

  • Add watchdog, reset if button is not pressed.

3.14.0

  • Add interrupts to accelerometer
  • Add data format 5 support

3.13.0

  • Synchronize battery measurements to radio

3.12.0

3.11.0

  • Add scheduler and timer, update transmitted data once per second.
  • Environmental sensor is now in continuous mode and has IIR filtering at 16x (was oversampling)
  • ADC is now read once per minute

3.10.0

Adds NFC tag functionality - read only

3.9.0

Adds BLE broadcasts

3.8.0

Adds RTC

3.7.0

Adds battery measurement

3.6.0

Adds Accelerometer polling

3.5.0

Adds environmental sensing

3.4.0

Adds button control to blink leds

3.3.0

Adds Led blinking example

3.2.0

Adds logging and error code handling

3.1.1

Put external sensors to sleep and then put MCU to sleep.

ruuvi.firmware.c's People

Contributors

ojousima avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.