Hi there!
Logging specific log-messages to flash is key to our applications. On previous platforms, this was possible without any hassle. The nRF Connect however, has been a whole other experience. Logging to the SD-card is no option, as playing audio files is also a key-function for our applications, and Zephyr doesn't support simultaneously opened files being read/written (see previous Q&A). As a result, we have no other choice than to log to flash.
For this, we're using Zephyr's Filesystem Logging Backend. In itself, it does what it says. We do however question the measured performance with SEGGER SystemViewer. The screenshots underneath were taken with the logging sample application.
The screenshot above showcases the real-time behaviour of the sample with the RTT-Shell enabled (and set as logging backend) while also having the Filesystem Logging Backend enabled and directed to the on-board (non-external) flash. As one can see, there is little to no time left for other threads to run. This was ran on an nRF52840. With our own applications (including Bluetooth, playing audio (SD-Card to I2S)), this is unusable; we don't have thousands of milliseconds available to let the logging thread run. Making our audio player non-pre-emptible is also no option, as we would have no logging for ten's of seconds.
Using an the nRF52832 on the nRF52DK with external flash chip, we see an improvement in performance, with still periods in which no idle time is present. This could be usable, but we see this as still not in the safe-zone.
Then there is the application with only the RTT-Shell enabled and selected as logging backend. While we understand that logging to flash takes time, we wonder if the difference (which is night and day) is right, as we have a gut-feeling the difference is too large.
If it is too large, do you have any tips on how to improve the performance? In the mean-time we're going to try and play with log buffer sizes, processing trigger thresholds and runtime filtering options to see wether this approach is feasible.
Kind regards,
Jochem