element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • Product Groups
  • Store
    Store
    • Visit Your Store
    • Choose Another Store
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Raspberry Pi
  • Products
  • More
Raspberry Pi
Blog Working with the Raspberry Pi Pico with Windows and C/C++
  • Blog
  • Forum
  • Documents
  • Events
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Raspberry Pi requires membership for participation - click to join
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: shabaz
  • Date Created: 24 Jan 2021 5:17 PM Date Created
  • Views 28263 views
  • Likes 20 likes
  • Comments 79 comments
Related
Recommended
  • pi_pico
  • raspberry_pi_pico

Working with the Raspberry Pi Pico with Windows and C/C++

shabaz
shabaz
24 Jan 2021
  • Introduction
  • Install Visual Studio Code
  • Install CMake
  • Install Build Tools for Visual Studio
  • Install Python 3, Git and ARM GCC Compiler
  • Get Code
  • Building at the Command Line
  • Fixing NMake not found issues
  • Building with Visual Code
  • Running the Application
  • Troubleshooting your Running Application
  • Using Intellisense (Code Assistance)
  • Creating your Own Project Folder
  • Summary

 

Note: Also check out the following blog post which is related to the same topic, but using a development environment called CLion:

Using CLion for Easier Coding with Pi Pico and C/C++

Introduction

The Raspberry Pi Pico is a low-cost microcontroller board containing a chip with dual ARM Cortex-M0 cores and 256 kBytes of RAM and a mix of typical peripherals to connect to external hardware. There is also 2 MBytes of Flash memory on the board, and a USB port.

 

The Pi Pico can be programmed using C/C++ or Python, among other languages. Like some other microcontroller boards, when you hold down a boot button and plug the USB port into a PC, a drive letter appears just like a USB memory key. If you're using C/C++ then executables can be drag-and-dropped into the drive letter for programming the board.

 

This document explains what steps are needed to be performed on Windows PCs (other platforms are also supported but not documented here) in order to set it up ready for writing and building C/C++ applications to run on the Pi Pico. The steps here were done using Windows 10 64-bit (x64).

 

For further information, check the main document and comments here: Raspberry Pi Pico

 

image

 

 

Install Visual Studio Code

Follow the Visual Studio Code website information to install it. Then, install the extension CMake Tools as shown here:

image

 

Install CMake

Download and install:

image

 

During install select this option:

image

 

 

Install Build Tools for Visual Studio

Download and install:

image

It will launch the installer:

image

 

Select C++ build tools and install it. It may take several minutes to complete.

image

 

Install Python 3, Git and ARM GCC Compiler

See the Pico getting started PDF guide for this. I already had these installed for other projects so I didn’t install these a second time. Also, see neilk blog post, which walks through these steps: Adventures with the Raspberry Pi pico - part 1

 

Get Code

Create a pico folder (C:\development\pico for example) and navigate to it.

Follow the Pico user guide and type commands in a Windows command prompt to download and install the SDK and examples as shown in the screenshot below (Note: If the git commands do not work, then you'll need to install git on your PC. See here for details on how to install git ).

image

Note: In the past, it was OK to just copy the pico SDK and examples folders from GitHub but that doesn't work anymore, so definitely follow the steps shown above, because the git submodule command in the screenshot above is used to pull in content from other locations too, as part of the SDK install.

By the end of this, you should have a pico-sdk folder, and a pico-sdk-examples folder, both within the pico folder.

 

Building at the Command Line

Start up PowerShell and type the following:

image

 

Close PowerShell and open a new PowerShell. Type the following to create a build folder inside pico-examples, and then navigate to it:

image

 

Now type:

 

cmake -G "NMake Makefiles" ..

 

image

 

Now to build the code, the environment variables for Microsoft build tools (particularly nmake) might not be set up properly to work in PowerShell. If you get an error, switch to using Developer Command Prompt for VS 2019 instead.

Open up the prompt and navigate to the build folder as before, and then just type nmake

It will start building all the examples (it will take a while).

image

 

Fixing NMake not found issues

I had Nmake not found issues when attempting to use Visual Code to do the build. The fix for me was to go to the Environment Variables in Windows, and add this to the Path variable:

image

 

I did it for User and System variables. Note that you’ll need to check this path exists on your machine first. It may be similar but subtly different, so it needs to be checked.

 

Building with Visual Code

Note: Make sure you can successfully build at the command line before trying these steps.

Click on the cog at the bottom-left of the window, and select Settings:

image

 

Expand Extensions, select CMake Tools configuration, scroll to Cmake: Configure Environment and click on Add Item as shown here:

image

 

Set as shown here:

image

 

Next, scroll to locate Cmake: Generator and configure as follows:

image

 

Close the Settings, and then go to File->Open Folder

image

 

After you click Select Folder, at the bottom-right of the window, you’ll see this following pop-up. Click on Yes:

image

Incidentally, note that Visual Studio Code often creates plenty of pop-ups to the lower-right. You can generally ignore them (unless there is an error, or warning of interest), there is usually a flood of pop-ups whenever you open a new file and Visual Studio Code becomes eager to offer extensions and tips to work better with the files.

 

Then select GCC for arm-none-eabi:

image

 

If you miss seeing the popup, you can just select in the blue bar at the bottom of the window, No Kit Selected, and then select GCC for arm-none-eabi

image

 

The blue bar will look like this:

image

 

In this blue bar, click on Build:

image

 

After a long time (perhaps five minutes), all the examples will be built. You can see the output by clicking on View->Output. Don’t forget to click on PROBLEMS to see any warnings or errors if the build fails.

image

Note that if you wish to subsequently only build a single demo, you can save the build tools from traversing all the folders. To do that, click on the text [all] to the right of the Build text on that blue bar. A whole list of targets will appear. If you're only interested in (say) the hello_serial program that is in the hello_world folder, then start typing hello_serial in the box that will appear, and then select that target. From then on, clicking Build will only build that target. You can revert back to building all targets by clicking there again and this time selecting all.

image

 

Running the Application

Go into the appropriate folders as shown in the screenshot below, to see the .uf2 file (if you cannot see any file suffixes you should change the View settings in File Explorer so that you can always see suffixes):

image

 

The .uf2 file can be dragged into the USB storage drive letter that appears when you hold down the BOOTSEL button and plug the Pico's USB connection into your PC (release the button after you've plugged the Pico into the PC). The application should become programmed into the Flash storage and begin execution. It may get tiresome frequently unplugging and plugging in the USB connection just to perform the reset. You can hard-wire a reset switch to the Pico. For information on this, see Debugging the Raspberry Pi Pico on Windows 10

 

Troubleshooting your Running Application

Some typical ways of troubleshooting running code are listed below.

  1. Write code to light one or more LEDs, to indicate success or failure to reach a certain point in the code, or a data value
  2. Use printf statements to send text based debug information via USB to the connected PC. The PC will see a serial connection that can be used with software such as PuTTY to view the debug. You can also capture user keyboard input too, using (say) the scanf function.
  3. Use the low-level debugger 'gdb' to precisely step through code, or to examine variable content or even memory locations. See the guide Fred (Fred27 ) has created: Debugging the Raspberry Pi Pico on Windows 10

 

 

Using Intellisense (Code Assistance)

If you start up Visual Studio Code and select the pico-examples folder and look at any source code, you'll notice perhaps some squiggly lines like this:

image

 

It is a benign issue to the extent that it won't affect your project when you compile it. However, you want to ideally fix the squiggly line issue, because it means that Visual Studio Code can then help you write code more easily, by allowing you to navigate across code files simply by clicking your cursor in the function name, and pressing F12 (or right-clicking and selecting Go to Definition). Intellisense will also help as you're typing code, by providing good auto-completions.

 

For example, if you press F12 on the line that says stdio_init_all(); if Intellisense is not working then you'll find nothing. It will not be possible to easily tell in which file the function stdio_init_all exists, nor what it does. If Intellisense was working, you'd instantly know.

 

To get Intellisense working, I don't know the correct way, but here's what works for me (kind-of).

In Visual Code, select File->Close Folder. Then, instead of opening the C:\development\pico\pico-examples folder, instead select File->Open Folder and select C:\development\pico (i.e. one folder up).

 

Now if you open the code file, the squiggles will be gone:

image

(Note that there are squiggles on true and false, you can eliminate the squiggles for true and false by inserting #include <stdbool.h> into the code).

 

Now if you click on stdio_init_all and press F12, Visual Studio Code will instantly bring up the header file that defines that function. That header file is called stdio.h incidentally.

 

Another cool thing is that if you now look at this header file, you can immediately see that the function actually just calls stdio_uart_init. And if you click on that and then right-click and select Go to References (or hold Shift and press F12), a blue and gray pop-up appears. Select the closest reference on the right side in the gray area, and you'll see the implementation of the function in the blue area! Click on the X to close it at any time.

image

 

In summary, Intellisense used in that manner provides great insight when looking at existing code.

 

Here's another way that Intellisense helps, as you code; if you begin to type something (say gpio) then Visual Studio Code will automatically list some completions. You can use your cursor keys to choose the one you want (and it will display some helpful information too), and then press Enter to auto-complete.

image

Unfortunately, by opening the C:\development\pico folder instead of C:\development\pico\pico-examples folder, it breaks one (minor) thing: it is no longer possible to build the code using the blue bar at the bottom of Visual Studio Code. However, the workaround is simple. Just use a Windows Developer Command Prompt and type nmake as described before (in the section titled Building at the Command Line).

 

For those that want to do everything from within Visual Studio Code and not use the command prompt, then there are other ways to configure Intellisense to work such that the blue bar can still be used to perform the build, and this may be the preferable way overall. To do it, see the information from Jon in the comments section for this blog post: Raspberry Pi Pico

 

Currently I do not mind having to type nmake at the command line, so I will stick to the method here for now, but might change later.

 

Creating your Own Project Folder

At the bottom of this blog post (just before the comments section starts), there is an attachment called project1.zip. If you download that and extract it into the pico folder (for example C:\development\pico) then it will look like this:

image

Next, rename the project1 folder to whatever you want to call your project (for example myproject1). Double-click to open the folder and these files will be present:

image

The important one to edit is CMakeLists.txt. It will contain the following (see the screenshot below). Change the text project1 to be your new project name. Also, you can see that the code is comprised of main.c and extrafunc.c - all the pico examples use a single C file, but I figured I'd create an example project with an additional file so it can be seen how to add more files.

image

 

That's it, you can now use Windows Developer Command Prompt and go into the c:\development\pico\myproject1\build folder, and type (as before):

 

cmake -G "NMake Makefiles" .. 

 

After that, to perform the build, type (as before) in the Developer Command Prompt:

 

nmake 

 

It will result in the myproject1.uf2 file being created in the build folder, and you can transfer it to the Pi Pico as described before.

You can repeat these steps to create as many projects as desired : )

 

The CMakeLists.txt creates a Makefile (Makefiles can do a lot but typically tell the compiler and assembler and linker tools what files need to be compiled and assembled and linked). In a nutshell it's the place where you need to specify the files that are to be built and will join into your executable. By typing the cmake -G "NMake Makefiles" ..  command, the Makefile gets created.

 

By typing nmake, the Makefile is read by the nmake program, and it calls the appropriate tools (GCC compiler, assembler and linker and so on) to create the final executable.

 

Summary

The Pi Pico looks to be a useful microcontroller development board, because it uses the highly popular ARM Cortex-M cores. Using industry-standard tools such as the GCC compiler, CMake and Visual Studio Code, it is possible to set up a computer all ready for trying out the example projects, and for modifying them, or creating projects from scratch.

 

Visual Studio Code can be used to write and build the executable which can then be transferred to the Pi Pico by dragging the executable to the drive letter that appears when you hold down the boot button on the Pi Pico and insert the USB cable into the PC.

 

Some things currently might be better done at the command line, so Visual Studio Code can be used in conjunction with Windows Developer Command Prompt.

 

For those used to Arduino, the process may seem long-winded (which it is in comparison) but it only needs to be done once to get familiarity with it. These tools and all sorts of scripts are used by organizations to develop real products, so the knowledge gained is directly transferrable to engineering work environments.

 

Thanks for reading!

 

 

.

image

Attachments:
project1.zip
  • Sign in to reply

Top Comments

  • dougw
    dougw over 2 years ago +9
    Thanks Shabaz. PicoPi is not going to compete with arduino until the IDE gets a lot more streamlined.
  • Fred27
    Fred27 over 2 years ago +8
    Considering the effort that the Pi team have obviously put into the Pico and its documentation, I'm surprised this is as complicated and messy as it is. These days most microcontrollers have a very nice…
  • 14rhb
    14rhb over 2 years ago +6
    Hi Shabaz, Thank you for this helpful set of steps; for some reason the CMake:Generator was missing from my setup but once I completed the field to match yours all carried on smoothly At first all the…
  • shabaz
    shabaz over 1 year ago

    Just noticed today that every Pi pinout diagram is vertical! For the times a more horizontal approach is preferred:

    image

    Slightly more printer-friendly version:

    image

    • Cancel
    • Vote Up +5 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • petey
    petey over 1 year ago in reply to Fred27

    Agree. Flicking through this i think I am going to stick to Pico with Micropython and only for projects not requireing run speed. Other than that ts going to be PIC microcontrollers.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • bozocake
    bozocake over 1 year ago

    Slightly frustrated with setting the PICO_SDK_PATH as a local reference "../../pico-sdk." In Windows Environment Paths, set the PATH to your full location (for me: "c:/users/sjham/pico/pico-sdk/") and in CMake Tools in VSCode set all paths likewise. No more ../../ nonsense that breaks when you create a separate folder alongside the sdk and examples for your own development.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • jomoenginer
    jomoenginer over 1 year ago in reply to rubeola2006

    Can you build the pico-examples on your Windows 10 system?

     

    On Windows 10, this is what I did.

     

    Download the project1.zip to the same folder where pico-sdk and pico-examples are and unzip it.

    There is where is it for me:

    I:\Embedded\RaspiPico>dir
     Volume in drive I is BackupData
     Volume Serial Number is 56BF-5385
    
    
     Directory of I:\Embedded\RaspiPico
    
    
    04/03/2021  02:11 PM    <DIR>          .
    04/03/2021  02:11 PM    <DIR>          ..
    03/31/2021  10:01 AM    <DIR>          pico-examples
    03/31/2021  09:57 AM    <DIR>          pico-sdk
    04/03/2021  02:11 PM    <DIR>          project1
    04/03/2021  02:11 PM             2,365 project1.zip

     

    Open the 'Developer Command Prompt for VS 2019'

    image

     

    Set the 'PICO_SDK_PATH' environment variable as such:

    I:\Embedded\RaspiPico>setx PICO_SDK_PATH "..\..\pico-sdk"

     

    Then cd into the project1 folder and create a 'build' folder or just cd into the one provided.

    I:\Embedded\RaspiPico>cd project1
    
    
    I:\Embedded\RaspiPico\project1>cd build
    
    
    I:\Embedded\RaspiPico\project1\build>

     

    Then run 'cmake -G "NMake Makefiles" ..'

    I:\Embedded\RaspiPico\project1\build>cmake -G "NMake Makefiles" ..
    Using PICO_SDK_PATH from environment ('..\..\pico-sdk')
    PICO_SDK_PATH is I:/Embedded/RaspiPico/pico-sdk
    Defaulting PICO_PLATFORM to rp2040 since not specified.
    Defaulting PICO platform compiler to pico_arm_gcc since not specified.
    -- Defaulting build type to 'Release' since not specified.
    PICO compiler is pico_arm_gcc
    PICO_GCC_TRIPLE defaulted to arm-none-eabi
    -- The C compiler identification is GNU 10.2.1
    -- The CXX compiler identification is GNU 10.2.1
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2020-q4-major/bin/arm-none-eabi-gcc.exe
    Defaulting PICO target board to pico since not specified.
    Using board configuration from I:/Embedded/RaspiPico/pico-sdk/src/boards/include/boards/pico.h
    -- Found Python3: C:/Users/jomodev/AppData/Local/Programs/Python/Python39/python.exe (found version "3.9.1") found components: Interpreter
    TinyUSB available at I:/Embedded/RaspiPico/pico-sdk/lib/tinyusb/src/portable/raspberrypi/rp2040; adding USB support.
    -- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
    ELF2UF2 will need to be built
    -- Configuring done
    -- Generating done
    -- Build files have been written to: I:/Embedded/RaspiPico/project1/build

     

    Then run 'nmake'

    I:\Embedded\RaspiPico\project1\build>nmake
    
    
    Microsoft (R) Program Maintenance Utility Version 14.28.29912.0
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    
    Scanning dependencies of target ELF2UF2Build
    [  1%] Creating directories for 'ELF2UF2Build'
    [  3%] No download step for 'ELF2UF2Build'
    [  5%] No update step for 'ELF2UF2Build'
    [  6%] No patch step for 'ELF2UF2Build'
    [  8%] Performing configure step for 'ELF2UF2Build'
    -- The C compiler identification is MSVC 19.28.29912.0
    -- The CXX compiler identification is MSVC 19.28.29912.0
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/bin/Hostx86/x86/cl.exe - skipped
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/bin/Hostx86/x86/cl.exe - skipped
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Configuring done
    -- Generating done
    -- Build files have been written to: I:/Embedded/RaspiPico/project1/build/elf2uf2
    [ 10%] Performing build step for 'ELF2UF2Build'
    
    
    Microsoft (R) Program Maintenance Utility Version 14.28.29912.0
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    
    Scanning dependencies of target elf2uf2
    [ 50%] Building CXX object CMakeFiles/elf2uf2.dir/main.cpp.obj
    main.cpp
    I:\Embedded\RaspiPico\pico-sdk\tools\elf2uf2\main.cpp(325): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
    I:\Embedded\RaspiPico\pico-sdk\tools\elf2uf2\main.cpp(331): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
    [100%] Linking CXX executable elf2uf2.exe
    [100%] Built target elf2uf2
    [ 11%] No install step for 'ELF2UF2Build'
    [ 13%] Completed 'ELF2UF2Build'
    [ 13%] Built target ELF2UF2Build
    Scanning dependencies of target bs2_default
    [ 15%] Building ASM object pico-sdk/src/rp2_common/boot_stage2/CMakeFiles/bs2_default.dir/boot2_w25q080.S.obj
    [ 16%] Linking ASM executable bs2_default.elf
    [ 16%] Built target bs2_default
    Scanning dependencies of target bs2_default_padded_checksummed_asm
    [ 18%] Generating bs2_default.bin
    [ 20%] Generating bs2_default_padded_checksummed.S
    [ 20%] Built target bs2_default_padded_checksummed_asm
    Scanning dependencies of target project1
    [ 21%] Building C object CMakeFiles/project1.dir/main.c.obj
    [ 23%] Building C object CMakeFiles/project1.dir/extrafunc.c.obj
    [ 25%] Building C object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/pico_stdlib/stdlib.c.obj
    [ 26%] Building C object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/hardware_gpio/gpio.c.obj
    [ 28%] Building C object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/hardware_claim/claim.c.obj
    [ 30%] Building C object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/hardware_sync/sync.c.obj
    [ 31%] Building C object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/pico_platform/platform.c.obj
    [ 33%] Building C object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/hardware_uart/uart.c.obj
    [ 35%] Building ASM object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/hardware_divider/divider.S.obj
    [ 36%] Building C object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/common/pico_time/time.c.obj
    [ 38%] Building C object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/common/pico_time/timeout_helper.c.obj
    [ 40%] Building C object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/hardware_timer/timer.c.obj
    [ 41%] Building C object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/common/pico_sync/sem.c.obj
    [ 43%] Building C object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/common/pico_sync/lock_core.c.obj
    [ 45%] Building C object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/common/pico_sync/mutex.c.obj
    [ 46%] Building C object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/common/pico_sync/critical_section.c.obj
    [ 48%] Building C object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/common/pico_util/datetime.c.obj
    [ 50%] Building C object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/common/pico_util/pheap.c.obj
    [ 51%] Building C object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/common/pico_util/queue.c.obj
    [ 53%] Building C object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/pico_runtime/runtime.c.obj
    [ 55%] Building C object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/hardware_clocks/clocks.c.obj
    [ 56%] Building C object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/hardware_watchdog/watchdog.c.obj
    [ 58%] Building C object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/hardware_xosc/xosc.c.obj
    [ 60%] Building C object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/hardware_pll/pll.c.obj
    [ 61%] Building C object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/hardware_vreg/vreg.c.obj
    [ 63%] Building C object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/hardware_irq/irq.c.obj
    [ 65%] Building ASM object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/hardware_irq/irq_handler_chain.S.obj
    [ 66%] Building C object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/pico_printf/printf.c.obj
    [ 68%] Building ASM object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/pico_bit_ops/bit_ops_aeabi.S.obj
    [ 70%] Building C object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/pico_bootrom/bootrom.c.obj
    [ 71%] Building ASM object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/pico_divider/divider.S.obj
    [ 73%] Building ASM object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/pico_double/double_aeabi.S.obj
    [ 75%] Building C object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/pico_double/double_init_rom.c.obj
    [ 76%] Building C object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/pico_double/double_math.c.obj
    [ 78%] Building ASM object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/pico_double/double_v1_rom_shim.S.obj
    [ 80%] Building ASM object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/pico_int64_ops/pico_int64_ops_aeabi.S.obj
    [ 81%] Building ASM object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/pico_float/float_aeabi.S.obj
    [ 83%] Building C object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/pico_float/float_init_rom.c.obj
    [ 85%] Building C object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/pico_float/float_math.c.obj
    [ 86%] Building ASM object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/pico_float/float_v1_rom_shim.S.obj
    [ 88%] Building C object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/pico_malloc/pico_malloc.c.obj
    [ 90%] Building ASM object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/pico_mem_ops/mem_ops_aeabi.S.obj
    [ 91%] Building ASM object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/pico_standard_link/crt0.S.obj
    [ 93%] Building CXX object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/pico_standard_link/new_delete.cpp.obj
    [ 95%] Building C object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/pico_standard_link/binary_info.c.obj
    [ 96%] Building C object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/pico_stdio/stdio.c.obj
    [ 98%] Building C object CMakeFiles/project1.dir/I_/Embedded/RaspiPico/pico-sdk/src/rp2_common/pico_stdio_uart/stdio_uart.c.obj
    [100%] Linking CXX executable project1.elf
    [100%] Built target project1

     

     

    You should have a list of compiled files under build.

    I:\Embedded\RaspiPico\project1\build>dir
     Volume in drive I is BackupData
     Volume Serial Number is 56BF-5385
    
    
     Directory of I:\Embedded\RaspiPico\project1\build
    
    
    04/03/2021  02:15 PM    <DIR>          .
    04/03/2021  02:15 PM    <DIR>          ..
    04/03/2021  02:14 PM            21,350 CMakeCache.txt
    04/03/2021  02:15 PM    <DIR>          CMakeFiles
    04/03/2021  02:14 PM             1,835 cmake_install.cmake
    04/03/2021  02:15 PM    <DIR>          elf2uf2
    04/03/2021  02:14 PM    <DIR>          generated
    04/03/2021  02:14 PM            86,022 Makefile
    04/03/2021  02:14 PM    <DIR>          pico-sdk
    04/03/2021  02:15 PM             7,892 project1.bin
    04/03/2021  02:15 PM           147,016 project1.dis
    04/03/2021  02:15 PM           149,820 project1.elf
    04/03/2021  02:15 PM           158,806 project1.elf.map
    04/03/2021  02:15 PM            22,257 project1.hex
    04/03/2021  02:15 PM            15,872 project1.uf2
                   9 File(s)        610,870 bytes
                   6 Dir(s)  182,777,622,528 bytes free

     

     

    If any of this fails for you, please post the output of the error along with the command you ran.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • rubeola2006
    rubeola2006 over 1 year ago in reply to jomoenginer

    Hello,

             Thanks for your answers.

     

             The VS Code was running on Windows 10 (64 Bits) and in Spanish.

     

             I tried to provide the full access to stdlib.h in my project; but then; another library reports compilation problems.

     

             I'll try the suggestion about use the Getting Started document in "Chapter 8. Creating Your Own Project."

     

            Other last option is to ninstall all and follow again all the isntructions.

     

             Thank you very much for your recommendation.

     

    Greetings

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2023 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • Facebook
  • Twitter
  • linkedin
  • YouTube