Building a Simple C Project with SimpleSwitch™

In this tutorial, we’ll walk you through the process of building a simple C project using the Simple Switch framework. We’ll be using Visual Studio Code (VS Code) for this demonstration, but everything we cover can also be done from the command line.

Installing Simple Switch

  1. Install the Simple Switch extension for VS Code.
  2. Configure the extension settings by specifying the SDK location, application name, container name, and template type.
  3. Review the workspace settings (simple-switch.json) and launch.json file for project-specific configurations and debug configurations, respectively.

Creating and Compiling the Project

  1. Initialize a new project and select the C template for a debug build.
  2. Compile your first C project.
  3. Fix any errors that arise and recompile.

Packaging and Deploying the Project

  1. Package and deployed the application bundle to the target device.
  2. Verify that the container has started on the device using the simple-switch helper status command.

Viewing Logs and Debugging

  1. View application logs directly in VS Code.
  2. Enable the debug session and repackage the application.
  3. Redeploy the application and use the debugger.
  4. Set breakpoints, step through the code, and observe debug output in the logs.

Conclusion

This tutorial has provided a hands-on introduction to developing Simple Switch projects using VS Code. We’ve covered the essential steps of creating, compiling, packaging, deploying, and debugging Simple Switch applications. Feel free to experiment and explore the full capabilities of Simple Switch to build more complex and sophisticated projects.

Embedded Software Sessions

Copyright ©2024 Avnet, Inc. All rights reserved.