This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NRF_LOG is not thread safe

I'm developing in a freeRTOS environment. One thread is sampling the ADC using PPI at 200Hz, which various other threads sample Sensors via SPI and finally I'm using the NRF_LOG thread example from the freertos example.  I've noticed however when I enable logging (either RTT or UART),  the debugger crashes and it seems the FW restarts.  If I disable Logging I don't see any issues.  These leads me to believe that NRF_LOG is in fact not thread safe, even when deferred logs are enabled.  This is especially noticeable when I run the BLE thread.  

Parents Reply Children
  • This ended up being a hardware issue.  My nRF52832 was corrupted somehow.  When enabling ADC, SPI and UART, the chip drew 87mA on the PCA10040 board.  Even if I had nothing connected on those data ports I still saw 85mA draw.  When I started streaming data over BLE as well, the increase in current pulled down the voltage rail causing the debugger to lose connection to the target.  I soldered on a new IC and it works perfectly.

Related