VSCode Intellisense For Your Mbed Projects
mbed-vscode-tools is 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.
Notes
- This 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 see the official docs.
Dependencies
Python 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.0
- arm-none-eabi-gcc >= 9.0.0 or armcc >= 6.0.0
- cmake >= 3.19.0
- ninja >= 1.0.0
Installation
$ pip install mbed-vscode-tools
Run $ pip uninstall mbed-vscode-tools to uninstall mbed-vscode-tools.
Tutorial
Create c_cpp_properties.json
Prepare your c_cpp_properties.json that has "Mbed" configuration entry like 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 project
Make sure you're at an mbed program directory root.
Run the following command:
$ mbed-tools configure -t MBED_TOOLCHAIN -m MBED_TARGET -b MBED_PROFILE
MBED_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.json
Make sure you're at an mbed program directory root.
Run the following command to update your c_cpp_properties.json:
$ mbed-vscode-tools update ./cmake_build/{MBED_TARGET}/{MBED_PROFILE}/{MBED_TOOLCHAIN} VSCODE_CONF_FILE
VSCODE_CONF_FILE(required)
Path to your c_cpp_properties.json.
If everything goes well, includePath and defines fields 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.
Documentation
update
Update 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_DIR
Set 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_FILE
Path to your c_cpp_properties.json.
Options
--mbed-program-dir
Path to an mbed program directory root. If not specified, it's set to your current working directory.--vscode-conf-entry
Specify the target config entry of your c_cpp_properties.json. The default parameter is "Mbed".--verbose
Show complete message logs.--help
Show help messages.
Metadata
Release files for mbed-vscode-tools 0.1.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mbed_vscode_tools-0.1.4.1-py3-none-any.whl | Python 3 | none | any | Details |
Release files / mbed_vscode_tools-0.1.4.1-py3-none-any.whl
| Download URL | mbed_vscode_tools-0.1.4.1-py3-none-any.whl |
|---|---|
| Size | 10.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
63b969a300536d3b84146bd0b754f9ee8150e3dfa49924acac1ab92c60d8ffc1
|
|
BLAKE2b-256 checksum How to use checksums |
86ba0d896229fe97847ca3d8ad951f911c2a90cd8865807278314f47e44aa388
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.11
|
Security for mbed-vscode-tools 0.1.4.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.