Wrap libff in a mutex so it can be used from FreeRTOS. Research how good the lib can deal with "multi-threading".
libff