This one is tricky. VisualGDB projects are designed to be debuggable outside Visual Studio as well (e.g. to run tests or record traces), so the debug engine does not receive the regular Visual Studio variables.
VisualGDB-level variables (e.g. $(ProjectDir)) will work and you can also pass arbitrary variables via environment. The $$SYS:MCU_ID$$ syntax is used for BSP-level variables (that are not specific to a particular project) and are used for tasks like translating the same BSP definition into both CMake rules and MSBuild rules.