Logging to persistent storage or over BLE

Hi,

I was wondering how I could somehow log data of device in the field to an SD card or the flash storage of the device or even over Bluetooth. Which of these options do you consider the most suitable. 

I am using an nRF52832 chip and I am already using the UART for another peripheral so a UART SD logger is no option. Which of the following options do you think is best suited?

thank you for any tips

  • You list a number of very different approaches, and without knowing more about your use case and requirements it is difficult to suggest something specific. Is this just something you do in development or testing, or in the field?

    I also don't know if you just log some data (like sensor data that is always on the same format), or generic application logs? If it is just some simple data, then I would suggest just writing to flash either using a supported file system in the SDK (which SDK are you using?), or writing continuous raw data to flash. If you have enough available space in the internal flash, that would be simplest. For more generic logs, you could for instance use the flash backend of the logger module (if using the nRF5 SDK).

    Then a second problem is how to transfer these logs. That could be either logs stored in flash, or more recent logs stored in a RAM buffer if you don't need persistent storage of logs. If you had more UARTE peripherals (like on the nRF52840), that could be an option. Or if you could avoid using UART for whatever it is normally being used for while transferring the logs. Alternatively, RTT is an option like you say. But then you need a debugger attached to it. That might be OK during development or testing, but is probably not something you would want to do in the field. BLE as you write is certainly an option, perhaps you could use something like the the Nordic UART service to transfer the data. Using an SD card like you suggest is also an option. But again, these are very different approaches and you know best what fits your use case.

    As you mention RTT as an option, and if using a debugger implementation of some sort always connected is an option, then that would probably be the simplest solution seen from the nRF. Bot the nRF5 SDK and nRF Connect SDK support logging via RTT out of the box, so the only remaining problem is the computer in the receiving end.

  • thank you for the immediate response.

    I am looking for a method to log generic application data during development so I am able to connect 'logging hardware'.

    the application data varies between different debugging sessions and it should be possible to send it like with the NRF_LOG() statements.

    I am using the nRF5 SDK16 with softdevice 7.0.1

    I can see there is not a single best solution recommended for logging of data of devices in the field.

    Maybe you could add this as a feature request? :)

Related