SysTick wrong freq

But you have to tell PlatformIO about the 24MHz HSE frequency too, otherwise other parts of the STM32 HAL won’t know what clock you’re running at and will do wrong time unit conversions…

A project is only correctly converted from STMCubeIDE to PlatformIO when also all defines and compiler options are the same, not only the same code files.

Does your platformio.ini contain

build_flags =
   -DHSE_VALUE=24000000UL

?

Otherwise you might get some wrong default, mostly 8MHz.