Ilmainen toimitus yli 100 euron tilauksille - Kotimainen tuote - Toimitukset Suomesta

Debugging RuuviTag

It is said that every non-trivial piece of software can be shortened by at least one line of code and the software has at least one bug in it. While the base version of Ruuvi firmware known as “Weather Station” is widely tested with over 2500 users and over 10 000 devices in the field (at the time of writing), introducing new features introduces new bugs.
In general most of these bugs can be analyzed by printing out the relevant variables using NRF_LOG macros sprinkled over the code. To enable these logs, you must set in NRF_LOG_ENABLE 1 in SDK Config file of your project.


To actually read the logs you’ll need the Ruuvi Developer Shield. Once you have RuuviTag connected to the dev shield and the dev shield you can run RTT Viewer available in Segger J-Link software pack to view the log prints.


However, Segger RTT Viewer is not available for Linux. If you’re developing on Linux, you’ll need to take some additional steps to view the log output. Run JLinkExe and connect to your RuuviTag (device NRF52832_XXAA, interface SWD) and then open JLinkRTTClient.

RuuviTag debugging
JLink Connection to RuuviTag

There are cases where printing debug messages just does not cut it. When you need to step through the code and analyze each step to find what is causing the bug, GNU project debugger GDB is an invaluable tool.

To connect GDB you need to connect JLinkDGBServer to the board first with JLinkGDBServer -If SWD -Speed 4000 -Device Cortex-M4. Then you’ll want to start GDB and load debug symbols from your file with arm-none-eabi-gdb _build/test_drivers.out . Replace the .out file to match your application. Finally, Connect GDB Client to GDB Server with target extended localhost:2331 in GDB client.

RuuviTag Debugging
GDB Connected

Suosituimmat tuotteet

Valitse parhaat tuotteet juuri sinun mittaustarpeisiisi
  • RuuviTag mittaa lämpöä, ilmankosteutta, ilmanpainetta ja liikettä.Varastossa
    RuuviTag on Bluetooth-anturi, joka lähettää tiedon lämpötilasta, ilmankosteudesta, ilmanpaineesta...
    Lue lisää

    RuuviTag-anturi (4in1)

    39,90
  • Ruuvi KitVarastossa
    Ruuvi Kit on täydellinen ja nopeasti käyttöönotettava mittauspaketti jokaiseen...
    Lue lisää

    Ruuvi Kit -mittauspaketti

    339,00
  • Ale! Ruuvi GatewayVarastossa
    Ruuvi Gatewayn avulla saat yhteyden antureihisi mistä tahansa. Yhdistä...
    Lue lisää

    Ruuvi Gateway -reititin

    159,00
  • Varastossa
    Valitse sopiva malli (2in1 tai 3in1) tarpeidesi mukaan. RuuviTag...
    Lue lisää

    RuuviTag Pro -anturi

    49,90