Silicon Labs has a pretty nice IDE for their microcontrollers: Simplicity Studio. Apart from the usual C/C++ features, it also has an extensive third-party library collection and the ability to generate configuration code for various peripherals (e.g. clocks, UARTs, GPIOs), which greatly reduce the pain of embedded development. You no longer need to twiddle bits in a dozen registers just to set the correct baud rate, because someone else has already done it for you!
Unfortunately, Simplicity Studio is based on Eclipse and the Eclipse CDT which, at least for me, renders it almost unusable. I wanted to be able to edit code in VSCode, and use Simplicity only for debugging, installing libraries, and configuring the MCU.
For posterity, here is how it can be done with Simplicity Studio v5 and the GNU ARM compiler. YMMV with other setups.
-
First, you'll need to get the compiler flags Simplicity uses to build your project.
- Right-click the project in the Project Explorer pane, click Properties,
and navigate to
C/C++ Build -> Settings -> GNU ARM C Compiler
: - Grab the command-line in the "All options" text box.
- Convert the command-line to a JSON array of arguments. You can use Python's
shlex.split
for this. - Wherever there is a reference to the project directory, replace it with
${workspaceFolder}
.
- Right-click the project in the Project Explorer pane, click Properties,
and navigate to
-
Make sure you have the C/C++ extension installed.
-
Create a
.vscode/c_cpp_properties.json
file with the following format:{ "configurations": [ { "name": "My Config", "compilerPath": "/path/to/arm-none-eabi-gcc", "compilerArgs": [ "-IamAnArgument" ], "intelliSenseMode": "gcc-arm", "browse": { "path": [ "${workspaceFolder}" ] } } ], "version": 4 }
-
That's it! IntelliSense, code navigation, and refactoring should now work.
Again, this is only for editing code. To build the project and debug it you still have to use Simplicity Studio.