Major multicore fixes Newlib and FreeRTOS (#640)
Instead of wrapping the memory functions in the link stage, rebuild Newlib and enable retargetable locks. Override the weak definitions in the libc.a with our own, SDK based ones. The wrapping utilized before catches app-level memory allocations but misses allocations inside Newlib libc (like printf/etc.). Each core needs its own _impure_ptr or else crashes like the one seen in parallel printf_floats can happen. Enable it in the toolchain build and implement a simple swapper here. FreeRTOS SMP doesn't support Newlib's dynamic reent which is needed to allow save MT support. Minor patch to FreeRTOS and update the FreeRTOS variant.cpp and setup to support it.
Showing
cores/rp2040/lock.cpp
0 → 100644
libraries/FreeRTOS/src/FreeRTOSConfig.h
100755 → 100644
This diff is collapsed.
Please register or sign in to comment