I am using NRF5 on an NRF52840 board, building under GCC. My application needs FreeRTOS and I also need to be able to use stdlib functions such as printf() from any RTOS task. With GCC you are using newlib and, for things such as printf(), newlib must call malloc. It is will known (see see Dave Nadler's work) that newlib is not, of itself, multi-threaded, the platform is required to implement malloc()s that are thread-aware in order to avoid memory corruption. I also notice that NONE of the NRF5 examples that use FreeRTOS set configUSE_NEWLIB_REENTRANT to 1 in their FreeRTOSConfig.h files, which is kind of strange when you are using newlib.
So my question is: does NRF5 under GCC support use of printf() and the like in any FreeRTOS task? In other words, have you implemented the necessary threading protection calls for newlib? If the answer is "no", can you point me at any code that resolves the newlib rentrancy problem on NRF5?