Biko's House of Horrors

Simplicity Code

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.

  1. First, you'll need to get the compiler flags Simplicity uses to build your project.

    1. Right-click the project in the Project Explorer pane, click Properties, and navigate to C/C++ Build -> Settings -> GNU ARM C Compiler: Screenshot of the C compiler settings page
    2. Grab the command-line in the "All options" text box.
    3. Convert the command-line to a JSON array of arguments. You can use Python's shlex.split for this.
    4. Wherever there is a reference to the project directory, replace it with ${workspaceFolder}.
  2. Make sure you have the C/C++ extension installed.

  3. 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
    }
    
  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.