World wide free shipping on orders over 100€ - PayPal and Stripe payments - Made in Finland

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

Featured Products

Find the right products for your measuring needs
  • RuuviTag sensor measures temperature, air humidity, air pressure and motionIn stock
    RuuviTag is a Bluetooth sensor that sends temperature, relative...
    Read more

    RuuviTag Sensor (4in1)

  • Ruuvi KitIn stock
    Every Ruuvi Gateway product is shipped with...
    Read more

    Ruuvi Sensor Measurement Kit

  • Ruuvi GatewayIn stock
    Note! Every Ruuvi Gateway product is shipped with a...
    Read more

    Ruuvi Gateway Router

  • RuuviTag Pro 3in1 measures temperature, air humidity and motionIn stock
    Choose your model (2in1, 3in1 or 4in1) depending on...
    Read more

    RuuviTag Pro Sensor