Visual Studio Code setup for PSoC5 with PSoC Creator 'embedded'.

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

cross mob
lock attach
Attachments are accessible only for community members.
Rolf_Nooteboom
Level 5
Level 5
10 sign-ins 5 solutions authored First solution authored

For the ones interested, I created a Visual Studio Code setup for PSoC5.

 

The setup makes use of PSoC Creator which is needed for the (one time) configuration of the schematic / system / UDB part (and needs Windows to run of course). Once the configuration is done, coding and debugging can be done with Visual Studio Code (which can run on the platform of your choice). The advantage as well is that the PSoC Creator is 'embedded'. Changing the schematic / system / UDB part can be done in the 'embedded PSoC Creator project' without having to export / copy the project.

 

The result is a very fast, transparent, smooth and stable IDE for use with PSoC5.

https://github.com/RolfNoot/PSoC5_VS_Creator

When there's enough interest I can provide PSoC3 and PSoC4 setups as well.

Edit: Added the post build executable C# project sources.

1 Solution
AlenAn14
Moderator
Moderator
Moderator
500 replies posted 100 solutions authored 250 replies posted

Hi ,

Thank you @Rolf_Nooteboom for taking the time for creating and contributing the Visual Studio Code Setup for PSoC Creator. We appreciate this contribution :).

Locking this thread due to inactivity for long time, you can continue the discussion on the topic by opening a new thread with reference to the locked one. The continuous discussion in an inactive thread may mostly be unattended by community users.

Thanks and Regards,
Alen Austin

View solution in original post

0 Likes
9 Replies
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

Rolf,

Thank you for your contribution.

I personally would like to see the UDB structure to be continued to be used.  However it might be that Creator might have reached End-of-Life.

Maybe Infineon can use your efforts as an impetuous to 'break-off' the UDB creation/editing tools so that it can be used on their IDE of choice (ModusToolBox).

Len
"Engineering is an Art. The Art of Compromise."

Len,

I fear Creator is EOL. Just a little effort is needed on PSoC Creator to enable the use of UDBs for PSoC6, but it seems it doesn't have the attention. 

I had looked into isolating the schematic editor from PSoC Creator (the .NET source is not obfuscated), but just haven't had the time to dig deeper. The dos tool cydsfit.exe reads the schematic and the component verilogs to convert in into the UDB bitstream. It seems to be generating a netlist internally which is being processed into the bitstream. Once one is able to analyze this netlist and feed it to the tool, it should be possible to use other tools to create schematic.

Maybe Infineon is willing to put (parts of) their tools into the open-source space like they did with the elftool. Anything is welcome!

0 Likes
KyTr_1955226
Level 6
Level 6
250 sign-ins 10 likes given 50 solutions authored

Very cool!

I'm generally pretty alright with using the Creator IDE to write code but this is definitely a great option to have (Sometimes Creator gets a little sluggish when writing code for reasons I've been unable to determine).  Will definitely give this a try.

I'd love to have something like this for my various Microchip PIC projects.




[EDIT]:

I gave this a try on a project I'm currently working on and for some reason CMAKE_CURRENT_SOURCE_DIR seems to be stuck on .../PSoC_Creator.cydsn/ rather than the actual folder for my project so it's unable to find the generated source directory inside.  Do you know how I might change that macro to match my actual project directory?

Nevermind, found where the macro is defined, in CMakeLists.txt (line 29):

set(CREATOR_DIR ${CMAKE_CURRENT_SOURCE_DIR}/PSoC_Creator.cydsn)

Clean/Reconfigure now works, I also needed to adjust the source directory to the same .cydsn folder (no separate "source" folder in this project).

Now getting a bunch of build errors for some reason, lots of undeclared identifiers.  Maybe I need to re-generate the code in creator.  It's also complaining about not being able to find compile_commands.json, which is weird since I'm looking right at it and it's right where it's looking for it...

 

0 Likes

I am using the Cmake Tools extension in VS Code which sets up these variables like CMAKE_CURRENT_SOURCE_DIR. The variable should be pointed to your project directory indeed.

I am also using VSCode_OnethinxPack
 for some settings, OpenOCD and the GNU ARM GCC tools. As VS Code gets better and better, I now prefer it above PSoC Creator.

As PSoC Creator shows the build log, it's easy to see which files are compiled along with the compiler options. It also shows which files and libraries are included in the linker. With some fiddling in cmakelists, a nearly matching build output could be accomplished. 

Rolf_Nooteboom_1-1636388436695.png

 

0 Likes

@KyTr_1955226 wrote:

Now getting a bunch of build errors for some reason, lots of undeclared identifiers.  Maybe I need to re-generate the code in creator.  It's also complaining about not being able to find compile_commands.json, which is weird since I'm looking right at it and it's right where it's looking for it...

 


OK I think I figured something out.  There were a bunch of source files in generated_source that were orphaned (signal/component names changed or deleted but the generated source files were still present).  Clearing out the Generated_Source file cleared up the undeclared identifiers.

Now a new problem, everything manages to build except for the following error:

mingw32-make.exe[2]: *** No rule to make target '../KeyTest.cydsn/CyComponentLibrary.a', needed by 'KeyTester.elf'.  Stop.

 

Not sure why this specific file is a problem, everything else seems to build just fine...

0 Likes

Best is to leave the name of the PSoC_Creator.cydsn the same (there are lots of references, also in launch.json.

 

The original sources from the PSoC creator project shouldn’t be added as the library instead is already added in the cmakelists.

I would suggest to take the original project and do your modifications from there. Or at least make sure you have your PSoC_Creator project with the correct name and folder. Also take note the original project has a post build action to copy the CyComponents library.

0 Likes

The project uses the separate 'source' folder for your source files. In fact your project sources should be there and only the 'chip design / configuration' should be in the PSoC_Creator.cydsn folder.

The part below adds the include files (headers) to the project. The latter part (recursively) searches all the .c files inside the source folder and adds them to the project.

Rolf_Nooteboom_0-1636390805428.png

This parts adds the (PSoC Creator) compiled components library to the project:

Rolf_Nooteboom_1-1636391020428.png

 

 

0 Likes
Rolf_Nooteboom
Level 5
Level 5
10 sign-ins 5 solutions authored First solution authored

There is one executable CreatorPostBuild.exe which should be run at the post-build process. This program loads the Build and Rebuild logs to check for (location of) the library. When found it copies to the .cydsn folder. I will share the C# CreatorPostBuild project in case you prefer to build the binary your own.

 

Rolf_Nooteboom_0-1636396414298.jpeg

 

0 Likes
AlenAn14
Moderator
Moderator
Moderator
500 replies posted 100 solutions authored 250 replies posted

Hi ,

Thank you @Rolf_Nooteboom for taking the time for creating and contributing the Visual Studio Code Setup for PSoC Creator. We appreciate this contribution :).

Locking this thread due to inactivity for long time, you can continue the discussion on the topic by opening a new thread with reference to the locked one. The continuous discussion in an inactive thread may mostly be unattended by community users.

Thanks and Regards,
Alen Austin

0 Likes