This sounds like the problem I encountered (and finally fixed) in Debugging FreeRTOS on STM32 Bluepill - #11 by deltaphi.