Update on Using VSCode / PSOC5LP compile/debug natively on Mac/Linux/Windows

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Level 5
Level 5
First comment on blog 100 replies posted 50 replies posted

I recently posted a follow on to the RolfNoot suggestion on how to natively compile/debug with VSCode for the PSOC5 on Mac, Linux, Windows. 

After some experiences, I did another post describing using a more "normal" project from Creator at https://socmaker.com/?p=1027

There are no ads on my site.  It is basically an informational give-back to the community.  Here are the basic steps (building on the previous posts here or at socmaker):

  1. To make this simple, take the example folder from the last post(s) as your starting point. (PSOC_VS_Creator-main) (If you want to avoid being simple, copy the .vscode directory, config directory, CMakeLists.txt file, and “source” directory into your destination folder. Empty the source directory so you don’t get cross-project contamination.)
  2. Rename that folder to what you want it to be. (i.e. myProj) Keep the PSOC_Creator.cysdn folder untouched for now.
  3. Inside your folder, using Creator, open a new workspace. Name it whatever you want.
  4. Ignore the fact that you have the workspace files at the same level as the CMakeLists.txt
  5. Copy the CreatorPostBuild.exe file into your .cysdn folder (myProj.cysdn) from the PSOC_Creator.cysdn folder.
  6. Move the PSOC_Creator.cysdn folder to the trash.
  7. Open your project (if it is not already open) in Creator, and click on the WorkSpace Explorer Window, on the “Project myProj” and hit F2. Rename it to be PSOC_Creator. Your Workspace is now myProj, and your project is PSOC_Creator.
  8. Once you have OK’d this, your project folder is now named PSOC_Creator.cysdn, but your workspace is named something significant.
  9. (NOTE: If you feel lucky, skip steps 7 and 8, and edit CMakeLists.txt and change the PSOC_Creator.cysdn references to your folder. I choose not to for now, so the whole thing is portable to new projects without having to remember too much in the future.)
  10. THIS IS IMPORTANT: Go to the Design Wide Resources, click on System and make sure “Store Configuration data in ECC Memory” is UNCHECKED. Your project will build and run, but do nothing to the outside world if that box is checked. Very confusing.
  11. Move all the C and H files into the “source” directory (which is at the same level as CMakeLists.txt (after cleaning it out from the last project).
  12. In Creator, delete these files using the Workspace Explorer. Then right-click on the “Source Files” folder in the explorer and choose “Add->Existing Item…”
  13. In the dialog that comes up, you can enter *.c in the file name box at the bottom. You can then click on a file name, use the shift key, and select multiple files to put back into your project.
  14. Do the same for the “Header Files” folder.
  15. In the Project menu, choose Build Settings… In the Build Settings Dialog, click on the ARM GCC section, choose User Commands, and enter “CreatorPostBuild”
  16. Optional: Creator’s debugging system has an issue when debugging using a lot of files. You can be pointed to the wrong file while debugging. To fix this, click on Linker[+] and click on Optimizations in the Build Settings Dialog. Change “Removed Unused Sections” from True to False.
  17. Once you have finished the above, build and debug.
  18. Stop the debug, and if using VMWare, disconnect the CMSIS-DAP KitProg3 from the Virtual machine, open the folder in VSCode.
  19. It should prompt you for a kit. If not, click on the bottom “select a kit” area. Then, at the bottom of VSCode: 1) Choose GCC 9.3.1. 2) Change “CMake” to Debug. 3) Click “Clean-Reconfigure” If that all works, you should be good to build and debug on the Mac


1 Reply
500 replies posted 50 likes received 25 likes received

Hi @WaMa_286156,


Thanks a lot for your valuable contribution and this information will help a lot of community users.