Can you try giving the absolute path of the include folders in the lib_extra_dirs variable in platformio.ini
From what I undertand, the builder script is treating C:\Users\dap124.platformio\platforms\ststm32\builder as the base directory and any subsequent include directories you are adding are appended to this path.
Try with the absolute path
Try adding the absolute path(s) in the lib_extra_dirs. It is where LDF looks for any additional include directories.
@Krishna_Chaitanya, thanks for suggestions. Unfortunately neither of those solutions work.
The absolute paths get completely mutilated, e.g. -IC:\Users\dap124\.platformio\platforms\ststm32\builder\Usersdap124Electronicscodenrf905_cubescriptedsrcDriversSTM32F1xx_HAL_DriverInc
The lib_extra_dirs option has no effect.
Note that I include the STM32 HAL code under src, instead of lib. This is because the generated main code files include configuration headers for the HAL, preventing it from being compiled independently of the main code.