Just in case someone else faced this same issue recently, this still being a problem on Mbed OS 6.17.0, with this topic board. The call HAL_DBGMCU_EnableDBGSleepMode() also solved this issue for me, but I’ve come across with another workaround, just in case.