A Visual Studio Code 'project wrapper' for PSoC5 development using PSoC Creator for routing / system setup.
For Windows, Linux, MacOs
The example project is a 'Kitt Scanner' using only a handfull of magnificent UDB blocks. Just connect 8 LED's to Port2.
Project structure:
Visual Studio Code Project | ||
---|---|---|
.vs | visual studio code settings | |
build | the build output for the project (project.elf & project.hex will be here) | |
config | additional files for VS Code setup / configuration | |
PSoC_Creator.cydsn | PSoC Creator project | |
source | location of your source files (main.c etc.) |
- Most of the prerequisites are already bundled in the Onethinx Pack (GNU ARM tools, VS Code extensions etc.)
- For Windows: VSCode_OnethinxPack_Windows
- For Linux: VSCode_OnethinxPack_Linux
- For MacOS: VSCode_OnethinxPack_MacOS
- Clone or download the project to your local machine.
- Start VS Code
- Load the project: File >> Open (Folder) >> Select the folder of the project >> OK
- Click "⚙︎ Build" in the status bar to build the project.
- if it fails to build, try "Clean Reconfigure" + "Clean Rebuild" from the Cmake extension (left bar).
- if it still fails, try deleting the contents of the 'build/' folder.
- Debug the project using the (Cortex-) Debug extension from the left bar.
- depending on your debug adapter select "Debug CMSIS-DAP (OpenOCD)", "Debug J-Link" or "Debug J-Link (OpenOCD)" and press 'start'.
- PSoC Creator is needed for the routing / system setup. A Windows environment is required to run PSoC Creator. PSoC Creator is only needed for the chip configuration (often a one-time setup).
- OpenOCD and J-Link don't support programming of ECC memory. Make sure the 'Store configuration data in ECC memory' setting in the Design Wide Resources (.cydwr) is disabled.
- The build process uses Cypress' cyelftool which is officialy built for Windows only. Included is a rebuilt version for MacOs, the binary for Linux can be built using the C source files here or here. Another possibility is to use Wine.
- PSoC Creator uses CyComponentLibrary.a from the PSoC Creator application folder. The postbuild action copies CyComponentLibrary.a from the PSoC Creator application folder to the project folder.