Task-class cast in callback method not working

The logger object is allocated on main stack, which is reset by FreeRTOS when starting the scheduler for some MCUs like Cortex-M3/4/7 for exclusive use by ISRs. The object might or will get corrupted. There are already a number of related posts in the forum.
Try allocating it on heap (new) or make it (module) static or global and add e.g. a set-ter method for the queue handle.

1 Like