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

PSoC™ Creator & Designer Forum Discussions

StephenMc
Level 1
Level 1
First reply posted First question asked Welcome!

I am using Creator 4.4 and I am trying to modify the API code for a existing component (TCPWM_P4_v2_10).I imported the component in my design and modified name/version so as not to clash with existing component. Then I edited the API files, but when I added the modified component to my design and generated the application the program used the API files from the original component not the modified ones. I confirmed that this was true by modifying the originals in the library to check.

It appears list of API files and the path to use is coded somewhere in the component, does any body no where?

Also the Major and minor version numbers are also set inside the customiser code somewhere.

I presume this is a bug as you should be able to modify the existing components.

 

0 Likes
1 Solution

Stephen,

Simply put:  Modifying or adding components in Creator is not for the "faint of heart".

There is some documentation about how to add or modify.  However given the sophistication of what occurs in Creator behind the scenes, the documentation is lacking to cover all conditions the user can encounter.

I have not 'fixed' all the issues I found and posted earlier.

I have created a "modified version of the "TCPWM_P4_v2.10" component to a new name "TCPWM_P4_v2.11".   I have uploaded the project with this modification.  It compiles on my machine.

I tried to get your "TCPWM_pp_v1_0" to work in the method I got the "TCPWM_P4_v2.11" to work.  No luck for some reason.

To get the "TCPWM_P4_v2.11" to work, I had to perform a Computer "RESTART".  Without the restart a build of the modified customizers complained it could find the associated .dll file.   This is because the imported "TCPWM_P4_v2.10" dll was cached.   A RESTART forced Creator to recompile the new component's dll.

There was a number of other changes such as

  • The macro names (to append the v2_11).
  • The macro Properties Catalog/(Collection) to "Community/MyComponents/"
  • Remove the "TCPWM_P4_v2.10" component from the .cymacro file and replacing it with the "TCPWM_P4_v2.11" component configured to the desired type.

Question:   Why did your project specify the "Build Settings.../Toolchain:" as "ARM GCC Generic".  This needed to be modified to the latest ARM GCC update.

Try the uploaded code with these changes.

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

View solution in original post

0 Likes
12 Replies
Len_CONSULTRON
Level 9
Level 9
500 solutions authored 1000 replies posted 750 replies posted

Stephen,

Are you allowed to share your project with the forum?

It would be helpful to see your project and reproduce the same results.

I've modified a number of Cypress components as well as created new ones.

In general the component part of Creator works.

When you imported the TCPWM component into your project and renamed it, did you drop this "renamed" component onto your TopDesign?

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

StephenMc,

First step after importing stock component is to rename it to avoid name collision. 

In the Component explorer panel select the imported component and rename it, for example Timer_0_0 -> TimerEx_0_0.

2. Open all API  and Customizer files of the renamed component and find/replace All instances of old filename to a new one.

3. In the Component symbol->options change Component API prefix to match the name (for example TimerEx).

Change component location to something like "Community/myComponents/" 

4. Build project to see if renamed component is functioning properly.

5. If everything is OK, now is the time to modify the code of  the component. 

0 Likes
StephenMc
Level 1
Level 1
First reply posted First question asked Welcome!

I did rename the part as far as I could find the old version numbers, please see attached project. I am working on replacing selected components with C++ classes, starting with the TCPWM (don't know why I started on the most complicated component?!). The component when dropped into top design show the old version numbers in their properties. Please look at the project and see what I am doing wrong...

0 Likes

Stephen,

Thanks for the upload.

I believe I solved ONE of the issues.

When you imported and modified and renamed the TCPWM component (TCPWM_pp_v1_0), you didn't delete the previous Cypress TCPWM version from the TopDesign.  See pic.

 

Len_CONSULTRON_1-1643238798135.png

You need to remove all the "TCPWM_P4_v2_10" components from the TopDesign and replace them with the "TCPWM_pp_v1_0" components you created.  You'll find it in the "Community/MyComponents" tab

Len_CONSULTRON_0-1643294551164.png

New Issues

The component "TCPWM_pp_v1_0" only shows up in this tab.  The macros do not.

Once you drop the "Community/MyComponents/TCPWM" on the TopDesign

 

Len_CONSULTRON_2-1643294871305.png

However trying to configure this component yields another issue:

Len_CONSULTRON_3-1643294936024.png

This needs more work to solve.

 

 

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

Stephen,

Simply put:  Modifying or adding components in Creator is not for the "faint of heart".

There is some documentation about how to add or modify.  However given the sophistication of what occurs in Creator behind the scenes, the documentation is lacking to cover all conditions the user can encounter.

I have not 'fixed' all the issues I found and posted earlier.

I have created a "modified version of the "TCPWM_P4_v2.10" component to a new name "TCPWM_P4_v2.11".   I have uploaded the project with this modification.  It compiles on my machine.

I tried to get your "TCPWM_pp_v1_0" to work in the method I got the "TCPWM_P4_v2.11" to work.  No luck for some reason.

To get the "TCPWM_P4_v2.11" to work, I had to perform a Computer "RESTART".  Without the restart a build of the modified customizers complained it could find the associated .dll file.   This is because the imported "TCPWM_P4_v2.10" dll was cached.   A RESTART forced Creator to recompile the new component's dll.

There was a number of other changes such as

  • The macro names (to append the v2_11).
  • The macro Properties Catalog/(Collection) to "Community/MyComponents/"
  • Remove the "TCPWM_P4_v2.10" component from the .cymacro file and replacing it with the "TCPWM_P4_v2.11" component configured to the desired type.

Question:   Why did your project specify the "Build Settings.../Toolchain:" as "ARM GCC Generic".  This needed to be modified to the latest ARM GCC update.

Try the uploaded code with these changes.

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

Thank you Len, your project works perfectly. I could replace the API source file and they generated the correct code.

I will actually be building the application in an external IDE that understands c++ (and has latest GCC). The modified components just replace the cypress code with instantiations of my C++ classes.

I don't follow how to do the third step above to remove the components and replace in the .cymacro files.

0 Likes

Stephen,


I don't follow how to do the third step above to remove the components and replace in the .cymacro files.


Open up each .cymarco file.  It contains the "TCPWM_P4_v2_10" component.  Remove this component and replace it with the "TCPWM_P4_v2_11" component.   This forces the macro to use the V2.11 of the component which is your modified one.

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

I think that restarting computer is overkill. The old copies of the component are cashed in the fitter file  *.cyfit and Generated Source files. So it is sufficient to close Creator and delete the fitter file and Generated Source folder. 

0 Likes

odissey1,

Good to know.    I'll try that next time.

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
StephenMc
Level 1
Level 1
First reply posted First question asked Welcome!

Hi Len,

I must be missing something because I can't get the new component into the macro. I have read the meagre info in the cypress doc 'Component Author Guide'  which is pretty useless. Is there a better document?

I presume you have to get the schematic/symbol into the macro and set it to the desired config...

The components in the catalogue are the old parts you are trying to modify so cant be used and I cant find any other source.

Please tell me what I am missing as I seen like it should be simple but ...

Thanks Stephen

P.S. thanks odissey1 for that tip it will speed thing up..

0 Likes

StephenMc,

I think that macro's should be renamed also to avoid name collision with stock macros.

Do you really need macros? I can't recollect when last time I used them.

On the other note, to use C++ natively it may be beneficial to switch a "micro", not "macro".

0 Likes

Stephen,

Are you still unsuccessful to change the component in the .cymacro files?

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