Package: mbed-vscode-tools
VSCode Intellisense For Your Mbed Projectsmbed-vscode-toolsis made for software engineers who want to develop their mbed projects in vscode instead of mbed studio.
Our tool offers a commandline interface to generate and update your c_cpp_properties.json for correct vscode intellisense.NotesThis tool works in conjunction with the official cli tool (mbed-tools) provided by the mbed team.We assume that the users know how to use mbed-tools and its workflow. Otherwise seethe official docs.DependenciesPython interpreter:python >= 3.6.0 (f strings are used in our code)Python packages:8.0.0 > click >= 7.0.0 (the latest mbed-tools requires click 7.x)Other softwares:mbed-tools >= 7.0.0arm-none-eabi-gcc >= 9.0.0 or armcc >= 6.0.0cmake >= 3.19.0ninja >= 1.0.0Installation$pipinstallmbed-vscode-toolsRun$ pip uninstall mbed-vscode-toolsto uninstall mbed-vscode-tools.TutorialCreate c_cpp_properties.jsonPrepare your c_cpp_properties.jsonthat has "Mbed" configuration entrylike below:{"env":{},"configurations":[{// "Mbed" entry will be automatically managed and updated by this tool."name":"Mbed","compilerPath":"/usr/bin/arm-none-eabi-gcc",// Path to an arm compiler executable to use"includePath":[],// Leave empty"defines":[],// Leave empty"cStandard":"c17",// Set your favorite"cppStandard":"c++17",// Set your favorite"intelliSenseMode":"gcc-arm"// Depends on your compiler}],"version":4}Configure build settings for your mbed projectMake sure you're at an mbed program directory root.Run the following command:$mbed-toolsconfigure-tMBED_TOOLCHAIN-mMBED_TARGET-bMBED_PROFILEMBED_TOOLCHAIN(required)Set "GCC_ARM" if you like to use a gnu arm compiler. If use a paid official arm c/c++ compiler, set "ARM" instead.MBED_TARGET(required)Set your mbed-enabled board identifier. You can easily find it by connecting your board via usb and run$ mbed-tools detect.The "Build target(s)" field is what you are looking for.MBED_PROFILE(optional)Choose an mbed build profile from "debug", "develop", or "release". The default parameter is "develop".Update your c_cpp_properties.jsonMake sure you're at an mbed program directory root.Run the following command to update your c_cpp_properties.json:$mbed-vscode-toolsupdate./cmake_build/{MBED_TARGET}/{MBED_PROFILE}/{MBED_TOOLCHAIN}VSCODE_CONF_FILEVSCODE_CONF_FILE(required)Path to your c_cpp_properties.json.If everything goes well,includePathanddefinesfields of your c_cpp_properties.json are automatically updated and your vscode intellisense should work fine.Run this command right after every execution of$ mbed-tools configure.DocumentationupdateUpdate your c_cpp_properties.json.$ mbed-vscode-tools update MBED_BUILD_DIR VSCODE_CONF_FILE [--mbed-program-dir str] [--vscode-conf-entry str] [--verbose store_true] [--help store_true]Positional arguments:MBED_BUILD_DIRSet a build directory created by$ mbed-tools configure. Generally, set MBED_BUILD_DIR = {MBED_PROGRAM_DIR}/cmake_build/{MBED_TARGET}/{MBED_PROFILE}/{MBED_TOOLCHAIN} if you've executed$ mbed-tools configure -t MBED_TOOLCHAIN -m MBED_TARGET -b MBED_PROFILE -p MBED_PROGRAM_DIR.VSCODE_CONF_FILEPath to your c_cpp_properties.json.Options--mbed-program-dirPath to an mbed program directory root. If not specified, it's set to your current working directory.--vscode-conf-entrySpecify the target config entry of your c_cpp_properties.json.
The default parameter is "Mbed".--verboseShow complete message logs.--helpShow help messages.