WARNING
If you start Visual Studio code by clicking on its desktop icon, or directly from the Start Menu then the build
environment will not be correctly configured. Although this can be done manually later in the CMake Tools Settings,
the easiest way to configure the Visual Studio Code environment is just to open it from a Developer Command
Prompt Window where these environmental variables are already set.
We’ll now need to install the CMake Tools extension. Click on the Extensions icon in the left-hand toolbar (or type Ctrl +
Shift + X
), and search for "CMake Tools" and click on the entry in the list, and then click on the install button.
Then click on the Cog Wheel at the bottom of the navigation bar on the left-hand side of the interface and select
"Settings". Then in the Settings pane click on "Extensions" and the "CMake Tools configuration". Then scroll down to
"Cmake: Configure Environment". Click on "Add Item" and add set the
PICO_SDK_PATH to be ..\..\pico-sdk as in Figure 19.
Figure 19. Setting
PICO_SDK_PATH
Environment Variable
in the CMake
Extension
Additionally you will need to scroll down to "Cmake: Generator" and enter "NMake Makefiles" into the box.
IMPORTANT
If you do not change the "Cmake: Generator" Visual Studio will default to ninja and the build might fail as GCC
outputs dependency-information in a slightly-incorrect format that
ninja can’t understand.
Now close the Settings page and go to the File menu and click on "Open Folder" and navigate to pico-examples repo and
hit "Okay". You’ll be prompted to configure the project, see
Figure 20. Select "GCC for arm-none-eabi" for your compiler.
Getting started with Raspberry Pi Pico
9.2. Building on MS Windows 43