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):
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.)
Rename that folder to what you want it to be. (i.e. myProj) Keep the PSOC_Creator.cysdn folder untouched for now.
Inside your folder, using Creator, open a new workspace. Name it whatever you want.
Ignore the fact that you have the workspace files at the same level as the CMakeLists.txt
Copy the CreatorPostBuild.exe file into your .cysdn folder (myProj.cysdn) from the PSOC_Creator.cysdn folder.
Move the PSOC_Creator.cysdn folder to the trash.
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.
Once you have OK’d this, your project folder is now named PSOC_Creator.cysdn, but your workspace is named something significant.
(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.)
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.
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).
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…”
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.
Do the same for the “Header Files” folder.
In the Project menu, choose Build Settings… In the Build Settings Dialog, click on the ARM GCC section, choose User Commands, and enter “CreatorPostBuild”
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.
Once you have finished the above, build and debug.
Stop the debug, and if using VMWare, disconnect the CMSIS-DAP KitProg3 from the Virtual machine, open the folder in VSCode.
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