AN219434 - Importing PSoC Creator Code into an IDE for a PSoC 6 Project

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

cross mob
MichaelF_56
Moderator
Moderator
Moderator
250 sign-ins 25 comments on blog 10 comments on blog

AN219434 shows how to import the code generated by PSoC Creator™ into your preferred IDE for PSoC 6 firmware. With this knowledge, you can combine the benefits of automatically generated code with your preferred IDE. High-level options are explained, with detailed instructions for each option.

Learn more: https://www.cypress.com/documentation/application-notes/an219434-importing-psoc-creator-code-ide-pso...

11 Replies
GeEd_1216226
Level 4
Level 4
5 sign-ins 25 replies posted 10 replies posted

Hey Michael,

I have read through the APP Note 219434, still does not clarify a few things for me.

I have a challenge where a PSoC6 dual core has a locked CM0+ with firmware on it. So starting a new file etc is not possible and I need to ADD code to an existing file.

I am trying to port an application to CM4 from PSoC Creator, via VSCode since PSoC Creator will not allow us to program CM4 when CM0 is locked. 

Do you have any specific examples for VSCode of porting PSoC Creator files?  Alan Hawes in his recent video indicated that PSoC Creator files can be ported to Modus toolbox and VSCode, but I have not seen much information that helps us mere mortals achieve this.

Any assistance appreciated.

0 Likes

Adding JamesT_21​ from the Applications Team.

0 Likes

Geoff, hi! I'm tagging RakshithM_16​ who currently owns that app note (although I wrote it).

PSoC6 dual core has a locked CM0+ with firmware on it. So starting a new file etc is not possible and I need to ADD code to an existing file. I am trying to port an application to CM4 from PSoC Creator, via VSCode since PSoC Creator will not allow us to program CM4 when CM0 is locked.

So I take it you want to update/modify/program code on the CM4, but Creator is being a pain. I'm hoping Rakshith is more familiar with that. I haven't encountered that limitation, probably because I never played with a locked CM0+. The AN is really about what files PSoC Creator generates, where they are, and which you need. It definitely does not address this problem or the particulars of VS Code.

Probably not much help, but just in case....

There is good info for getting from PSoC Creator into Modus, but there is no simple export. The underlying design implementations are radically different. Creator > MTB v1.1, here.

https://www.cypress.com/file/507391/download . But that's a pretty old version.

I wrote a KBA on how to get from MTB 1.1 > v2 here. Migrating from ModusToolbox v1.1 to v2.x - KBA229043 . Again, some significant changes under the hood, so no simple way to export a project or migrate, it has to be manual to some extent.

Finally MTB > VS Code, that's (almost) trivial. A place to start is in the ModusToolbox User Guide, there is a chapter on exporting to IDEs, and VS Code is one of them. But that support doesn't exist in Creator.

I'm not aware of any collateral that guides someone directly from PSoC Creator > MTB 2.2 (current version). Rakshith may be aware of something. I'm 99% sure there is nothing on Creator > VS Code directly.

0 Likes

Wow.... what are the chances I can navigate this pathway without stepping into the valley of death? 

0 Likes

I'd laugh, but it would be a grim laughter, and that clearly wouldn't help. Let's see what Rakshith has to say here. If there is no joy in mudville, we shall regroup and see what we can come up with.

If we don't have a relatively straight path from PSoC Creator to MTB 2.2, we should get out the bulldozer and make one. Some stuff won't work (UDBs for example). But stuff that does, there should be a recipe.

Jim

0 Likes

James,

From a relative novice perspective, it seems a bit strange that we can program CM4 independently using third part IDEs like VSCode, yet from PSoC Creator we cannot. I am not interested in going the Modus toolbox route. I use Cypress because the tools have always been seamless. Develop in PSoC Creator, hit the debug button and go. Now, it seems Cypress is abandoning its faithful users who love the product and IDE, for some crazy pathway only intended for those with a bent on spending lots of time manually bashing code. I would rather switch to another vendor for my microprocessing than have to navigate a space-race development pathway just to get code onto a chip.

<https://go.cypress.com/traci> https://go.cypress.com/traci just FYI.

Isn’t there anyone at Cypress who can advise if programming CM4 alone is possible directly from PSoC Creator Version “Please help Geoff”?

Thanks for your responses….. this is why I have enjoyed Cypress support

Dr Geoff Edwards

Applied Resolution Technologies

<http://www.appliedresolution.com.au/> http://www.appliedresolution.com.au

<http://www.linkedin.com/in/geoff-edwards-lasersystems> www.linkedin.com/in/geoff-edwards-lasersystems

Lot 521 Sullivans Road

YAMBA NSW 2464

(02) 6645 8868

0407542440

LEGAL DISCLAIMER. The contents of this electronic communication and any attached documents are strictly confidential and they may not be used or disclosed by someone who is not a named recipient.

If you have received this electronic communication in error please notify the sender by replying to this electronic communication inserting the word "misdirected" as the subject and delete this communication from your system.

0 Likes

Hi Geoff,

I have a challenge where a PSoC6 dual core has a locked CM0+ with firmware on it. So starting a new file etc is not possible and I need to ADD code to an existing file.

Can you please provide more details regarding this? How was the CM0+ project created and programmed into the device? This would help us in providing a workaround that might help you.

In PSoC 6 devices, both CM0+ and CM4 CPUs share a common flash region, and the size of the flash region for each CPU is not fixed, mainly because it gives the flexibility to the developer to allocate the right amount of flash to both the CPUs based on the application. As a result, the CM4 code starts from the point at which the CM0+ flash region stops and this is defined by the linker script.

During boot up, the CM0+ boots up first, enables the CM4 CPU, and points it to the start of CM4 code using the API -Cy_SysEnableCM4(CY_CORTEX_M4_APPL_ADDR);

In PSoC Creator, the CM0+ code is compiled and a <project>.elf file is created. This is then merged with the CM4 code, after it is compiled, to create a single hex file using CyMCUElfTool. You can refer to the CyMCUElfTool User Guide for further details regarding this.

We could try to manually merge the files of both the CPUs as a workaround for your issue. That being said, there are certain limitations to consider as we cannot modify the CM0+ code -

1. The CM4 start address should remain the same.

2. Top Design of the project should not be modified.

3. All peripherals'/components' initialization should be done manually instead of taking the Top Design approach.

This will not affect the CM0+ code and we can use the previous CM0+ build artifacts with the new CM4 code, merge it together and create the final hex file that can be programmed into the device.

Do you have the build artifacts of the CM0+ project? Based on the modifications that are to be made for the CM4 code and whether you have the CM0+ elf file, we can try to merge the code manually to modify the CM4 code. However, there may be corner cases and we cannot assure that it works every time. It is always better/safer to recreate the CM0+ code.

Thanks and Regards,

Rakshith M B

Thanks and Regards,
Rakshith M B
0 Likes

Hi Rakshith,

I have passed your email onto the guys from Onethinx for their comment. But they are using VSCode now for their PSoC6 system. Their VSCode project perhaps includes sufficient information because it does allow for CM4 to be programmed with locked CM0+. I see in their CMake that they are using the cymcuelftool and are using some BASHTOOL that seems to do some memcalc and some numbers that perhaps provide the CM4 start address. They also have a special Onethinx dependencies pack set-up for VSCode that contains the information required.

The links for the Onethinx information is at <https://github.com/onethinx> https://github.com/onethinx. The Onethinx dependencies are where some of the key information is from what I see. They have done a lot of work since they discovered that CM4 could not be programmed independently.

My task is to get some products out there. At the moment I am standing with one leg either side of the valley of death with VSCode on one side and PSoC Creator on the other (with my working system that I need to interface into the VSCode).

It might actually be best for me to follow a path of preparing the PSoC Creator information to port into VSCode. But going to other IDEs means that I perhaps should just use other than Cypress in the first place, which is stupid given that they are Cypress ICs. I intend running the code that goes on CM4 most of the time, and switching through to a couple of commands that access CM0+ every so often to send LoRaWAN. That is the theory anyway.

I really appreciate your help.

Regards,

Dr Geoff Edwards

Applied Resolution Technologies

<http://www.appliedresolution.com.au/> http://www.appliedresolution.com.au

<http://www.linkedin.com/in/geoff-edwards-lasersystems> www.linkedin.com/in/geoff-edwards-lasersystems

Lot 521 Sullivans Road

YAMBA NSW 2464

(02) 6645 8868

0407542440

LEGAL DISCLAIMER. The contents of this electronic communication and any attached documents are strictly confidential and they may not be used or disclosed by someone who is not a named recipient.

If you have received this electronic communication in error please notify the sender by replying to this electronic communication inserting the word "misdirected" as the subject and delete this communication from your system.

0 Likes

Hi Geoff,

I checked a few projects in the Onethinx repo that you shared. In the design folder of VSCode_HelloWorld example, you will find the design.modus file. This makes me think that a ModusToolbox project was ported to VSCode. The launch.json and tasks.json files present in .vscode folder are very similar to the files generated when a ModusToolbox project is exported to VSCode. Also, if you check in the files present in design/GeneratedSource/ folder you will see that the PDL version is 1.3.1 which is supported only in ModusToolbox and not in PSoC Creator - Tags · cypresssemiconductorco/psoc6pdl · GitHub.

In Capsense_example project, the cyfitter.h, project.h files are present and they do have PSoC Creator 4.3 mentioned and this example is exported from PSoC Creator and the PSoC Creator project used is also provided in the repo. So you should be able to directly use the PSoC Creator project in this case.

Hope this helps,

Thanks and Regards,

Rakshith M B

Thanks and Regards,
Rakshith M B
0 Likes

Rakshith,

The Capsense project actually does not have any of the LoRaWAN functionality, and in fact it seems to be for a blank module without a CM0+ locked. Also, it does not compile and run because there are components missing in the make file. Even if it did function, it would not function on a locked module. I believe the HelloWorld was done using Modus Toolbox. Just FYI, I have been able to program the modules directly using PSoC Creator when CM0+ is not locked. No problems.

I think my pathway will be to gradually transport my C-files over in cut-down form straight into VSCode, and then cater for the various functions as I add them. It seems to me as a non-pro programmer to perhaps be the pathway of least pain to getting it working. If I have to build some of the functionality using some hand-building, then so be it. At least I know the code works, and the C-files will be unchanged except for some Cy calls which I may be able to drag in because I have the exported components.

Let me see how I go with this approach.

Thanks for your help and advice. I will report back if I make significant progress.

Regards,

Dr Geoff Edwards

Applied Resolution Technologies

<http://www.appliedresolution.com.au/> http://www.appliedresolution.com.au

<http://www.linkedin.com/in/geoff-edwards-lasersystems> www.linkedin.com/in/geoff-edwards-lasersystems

Lot 521 Sullivans Road

YAMBA NSW 2464

(02) 6645 8868

0407542440

LEGAL DISCLAIMER. The contents of this electronic communication and any attached documents are strictly confidential and they may not be used or disclosed by someone who is not a named recipient.

If you have received this electronic communication in error please notify the sender by replying to this electronic communication inserting the word "misdirected" as the subject and delete this communication from your system.

0 Likes

Hi Geoff,

Thank you for providing an update on this thread. The Application Note hopefully should be able to help you with understanding the different files generated by PSoC Creator. If you face any issues, please create a new thread and we will try to provide a resolution or a workaround that might help you.

Thanks and Regards,

Rakshith M B

Thanks and Regards,
Rakshith M B