Compilation in debug mode fails while for programming doesn't

I have a project written using Mbed-OS 5.15.3-rc1 using the UBLOX EVK ODIN W2 target and i’m attempting to debug this project.

If I compile the program only for directly flashing the device, compilation works succesfully, however when I click the debug button it fails to include a specific file from the mbed-os folder.

.\src\sdcard\sdcard.cpp:11:10: fatal error: SDBlockDevice.h: No such file or directory
11 | #include “SDBlockDevice.h”

If I try to include it using the absolute path, more errors follow up, all related to macros defined in mbed_app.json.

I noticed that for some reason, some of these macros are simply not generated in mbed_config.h, as opposed to a regular build. Any idea on what could be happening?

Hello,

I am not sure but debug in Mbed Studio was not supported for every target especialy if the target was removed in Mbed OS 6

According to SDBlockDevice - APIs | Mbed OS 5 Documentation you have to add the SD component to mbed_app.json:

"target.components_add" : ["SD"],

BR, Jan

That did the trick, thanks!
I don’t understand why I was able to compile my project so far without adding the SD component, but oh well.