cancel
Showing results for 
Search instead for 
Did you mean: 

Importing ST projects into Visual Studio 2022

Louie88
Associate III

Hello,

I tried to import my time interrupt based, blinking LED project into Visual Studio 2022 V17.6 (Not into VSCode) using Marc Goodner’s blog (from Microsoft). Finally, I could import the STM32CubeIDE project into VS2022 but I could not run it. The Target dropdown list always contains Local Machine and Manage connections link. There is no ST-Link debugger in the target list. I tried to disconnect and reconnect the USB cable of STM32H723ZG NUCLEO development. It did not help. I restarted VS2022, then my PC, but it did not help.

Then I start debugging the project with Local Machine. The project was compiled into [project_name].elf file without any error but running the "ELF" file in Windows is a bad idea.

  • CMAKE is installed.
  • "Linux and embedded development with C++" is installed.
  • "vcpkg" is installed and activated.
  • I googled it everywhere...

My question is does STMicro have a step-by-step guide how to import STM32CubeIDE project into VS2022? Or maybe somebody from the community already did it and could help what I did wrong.

Best regards,

Louis

1 REPLY 1
Louie88
Associate III

I think I found the solution.

  1. Import the STM32CubeIDE project to Visual Studio.
  2. After importing the project the Debug button (Green "run button") shows "Select Startup Item..."
  3. Click on the down icon on the right side of the Debug button.
  4. Select "Launch" (not the [ProjectName].elf file.
  5. Now the Debug button will show "Launch" instead of "Select Startup Item..." but it does not launch the debugger nor compile and build the project.
  6. Press the Debug button again. (Not the dropdown icon)
  7. This will compile, build (if needed) the project, initialize the debugger, flash the [ProjectName].elf file into the flash memory of the MCU.
  8. The debugger will stop at the Reset_Handler of the startup assembly file.

This is PROBABLY what happens. During building the project the compiler(?) creates a "[ProjectName] Debug.launch" file in the root folder of the application. The "[ProjectName] Debug.launch" file is an XML file which probably contains every information how to flash the MCU in the development kit. This Launch file must be selected when the Debug button is clicked.

Louis