Exporting a project using a cyprjmgr CLI

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

cross mob
vacovnik
Level 1
Level 1
5 sign-ins First reply posted First question asked

Hi,

I am using CMake to build a PSoC 4 project. Until now I was doing some manual work to update or at least validate the CMakeLists.txt after regenerating the cypress API.

Now I discovered that those manual steps could be automated using `cyprjmgr -wrk ... -prj ... -export ...` command.

 

I tried exporting for all targets that are listed available. All of them throwed an unhandled exception:

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at CyDesigner.Common.ProjMgmt.CyPrjMgr.BuildActionComplete[T](CyBuildStatus status, T buildDone)
   at CyDesigner.Common.ProjMgmt.Model.CyPrjMgmtDebugBuildProvider.BuildSucceededOrSkipped(CyBuildStatus status, BuildDone callback)
   at CyDesigner.Common.ProjMgmt.Model.CyBuildManager.<>c__DisplayClass6`1.<BeginBuild>b__4(CyBuildStatus status)
   at CyDesigner.Common.ProjMgmt.Model.CyBuildManager.BuildExecutor.ExecuteBuild()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

It would also simplify things for me a lot if the makefile target would be available. Since the PSoC creator seems to know how to export a project to makefile, I suppose that it could also be possible with the help of the cyprjmgr CLI.

Thanks for all the help in advance and best regards.

0 Likes
1 Solution
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi @vacovnik

Can you please let me know the entire command that you tried? I tried it with a PSoC Creator PSoC 4 project and for me the export command succeded - 

Rakshith_0-1647369665269.png

Unfortunately, makefile is not a valid target for the cyprjmgr tool.

Thanks and Regards,
Rakshith M B

View solution in original post

0 Likes
6 Replies
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi @vacovnik

Can you please let me know the entire command that you tried? I tried it with a PSoC Creator PSoC 4 project and for me the export command succeded - 

Rakshith_0-1647369665269.png

Unfortunately, makefile is not a valid target for the cyprjmgr tool.

Thanks and Regards,
Rakshith M B
0 Likes

Hi @Rakshith,

Thank you for a quick reply.

Below, you can see the command I've been trying to use to export the project.
vacovnik_1-1647372021655.png

As stated before, I am mainly looking for option to export a project to makefile and then parse the output to set the target sources with CMake, but I think I could live with some other format, too. I will just need to learn how to parse it and mainly relate on `Export/PSoCCreatorExportIde.xml` file.

However I noticed something weird running the following command to regenerate the API:

vacovnik_0-1647371939404.png

The command finishes successfully, but no additional export data is created.

Best regards,
Marko

0 Likes
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi Marko, 

Can you please confirm if the project is building successfully in the PSoC Creator IDE? It seems like the issue is not with the export command. Would it be possible to share the project?

Thanks and Regards,
Rakshith M B
0 Likes

Hi @Rakshith,

Sorry for a late response.
I didn't work on that project much in the past week.

I did not try to build the project in the PSoC Creator IDE. I am writing the code in c++ so the only thing I would like the Creator to do for me is its API for my peripheral configuration.
However the API could be successfully generated from within the IDE and also exporting to makefile works just fine in IDE.

 

0 Likes
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi @vacovnik

You did mention that the files/APIs were successfully generated from within the IDE. Can you please try the export command after this step? This is just to confirm whether the export command works at your end. 

Thanks and Regards,
Rakshith M B
0 Likes

Hi @Rakshith,

As stated before, both API generation and exporting to makefiles work within the IDE.

Best regards,
Marko

0 Likes