element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • 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 Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • 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
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Blog Raspberry Pico - code hints, auto-resolve and squiggly lines with IntelliSense in VSCode
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
GPIO Pinout
Raspberry Pi Wishlist
Comparison Chart
Quiz
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Jan Cumps
  • Date Created: 30 Dec 2022 2:27 PM Date Created
  • Views 2428 views
  • Likes 13 likes
  • Comments 3 comments
Related
Recommended
  • raspberry
  • gcc
  • pico
  • vscode

Raspberry Pico - code hints, auto-resolve and squiggly lines with IntelliSense in VSCode

Jan Cumps
Jan Cumps
30 Dec 2022

In this post, 3 VSCode c analysis and support topics:

  • how to set the c/c++ standard (e.g.: the new c++20 standard) for the IntelliSense extension
  • how make IntelliSense find the right includes for the Pico and the c SDK
  • how to tell IntelliSense that you use a cross-platform toolchain?

IntelliSense is the extension that enables code auto-complete and popup code insight for c and c++ code. It is the module that shows you the "squiggly lines" when you make an error against language constructs.

You can change settings via the extension editor, or directly in the .vscode/c_cpp_properties.json file. Both options are available from the command palette when you press CTRL+SHIFT+P -> C/C++: Edit Configurations(UI/JSON). I'm going to use the JSON text editor in this blog and show the contents directly.

IntelliSense defaults to the OS platform, and to the compiler you set in the extension's config. I'm making a new configuration for Pico on my cross-compile platform (OS: Windows. Compiler: arm-none-eabi).

{
    "configurations": [
    {
      "name": "Pico",
      "includePath": [
      "${workspaceFolder}/**",
      "C:/Users/jancu/Documents/Pico/pico-sdk/src/**"
      ],
      "defines": [
      "_DEBUG",
      "UNICODE",
      "_UNICODE"
      ],
      "windowsSdkVersion": "10.0.19041.0",
      "compilerPath": "C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2021.10/bin/arm-none-eabi-gcc.exe",
      "cStandard": "c11",
      "cppStandard": "c++20",
      "intelliSenseMode": "gcc-arm",
      "configurationProvider": "ms-vscode.makefile-tools"
    }
  ],
  "version": 4
}

c/c++ standard

It's best to set the IntelliSense language the same as the ones in your CMake settings. If you have this in CMakeList.txt:

set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 20)

then set the same ones in the IntelliSense config:

            "cStandard": "c11",
            "cppStandard": "c++20",

include path for Pico board and SDK

To take care that IntelliSense can find Pico related includes, add this:

           "includePath": [
                "${workspaceFolder}/**",
                "C:/Users/jancu/Documents/Pico/pico-sdk/src/**"
 

set the cross-platform ARM toolchain

VSCode defaults to your platform. If you run a Windows install on an Intel architecture, it will default to that. We want that it does the checking for the ARM family. In the mean time, setting the compiler path will also automatically resolve all toolchain related include paths.

            "compilerPath": "C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2021.10/bin/arm-none-eabi-gcc.exe",
            "intelliSenseMode": "gcc-arm",

 references:

  • VSCode documentation: IntelliSense for cross-compiling
  • Sign in to reply
  • shabaz
    shabaz over 2 years ago

    Very useful resource! It makes a huge difference to productivity having such nice tools.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Andrew J
    Andrew J over 2 years ago

    Yes, really useful

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 2 years ago

    Nice post Jan.

    • 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 © 2025 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

  • X
  • Facebook
  • linkedin
  • YouTube