cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC™ Creator & Designer

Anonymous
Not applicable

I would like to use the cydsfit.exe tool from the command line. There are many good reasons for doing so: build automation for example.

   

When building from within the Creator IDE the output provides the following command:

   
    

"c:\Program Files (x86)\Cypress\PSoC Creator\3.3\PSoC Creator\bin\cydsfit.exe" -.appdatapath "C:\Users\xxxx\AppData\Local\Cypress Semiconductor\PSoC Creator\3.3" -.fdsnotice -.fdswarpdepfile=warp_dependencies.txt -.fdselabdepfile=elab_dependencies.txt -.fdsbldfile=generated_files.txt -p C:\Users\xxxx\my_project\my_project.cydsn\my_project.cyprj -d CY8C4248LQI-BL483 -s C:\Users\xxxx\my_project\my_project.cydsn\Generated_Source\PSoC4 -- -yv2 -q10 -ygs -o2 -v3 -.fftcfgtype=LE

   
   

My immediate problem is that the source code generated from this command when run from the cmd.exe shell is placed in the same directory as our application code. i.e. the generated source code is placed in

   
    

C:\Users\xxxx\my_project\my_project.cydsn

   
   

not in

   
    

C:\Users\xxxx\my_project\my_project.cydsn\Generated_Source\PSoC4

   
   

When this command is run from the PSoC Creator IDE the generated code is placed in the correct directory Generated_Source\PSoC4.

   

What trickery is required to get the command line cydsfit.exe invocation to perform the same way as the IDE invocation?

   

Thanks,

   

-- Nat

0 Likes
1 Solution
HeLi_263931
Honored Contributor II

Just a guess: cydsfit places the output into the current directory, which is the directory from where you are running it. So CD into the target dir, and call the command from there. All paths given are absolute so this will work.

View solution in original post

0 Likes
7 Replies
HeLi_263931
Honored Contributor II

Just a guess: cydsfit places the output into the current directory, which is the directory from where you are running it. So CD into the target dir, and call the command from there. All paths given are absolute so this will work.

View solution in original post

0 Likes
Anonymous
Not applicable

That was a good idea. However, when I did that I get a very unexpected error:

   

This may be a fools errand (I am the fool).

   

 

   

Bitstream Generation ...
Error: bse.M0105: cyfitter_cfg.c: Unable to open the file for writing. The process cannot access the file 'C:\Users\xxxx\xxx\xxx.cydsn\Generated_Source\PSoC4\cyfitter_cfg.c' because it is being used by another process. (File=cyfitter_cfg.c)
[Notice;ERROR;LEVEL_0;YnNlLk0wMTA1OiBjeWZpdHRlcl9jZmcuYzogVW5hYmxlIHRvIG9wZW4gdGhlIGZpbGUgZm9yIHdyaXRpbmcuIFRoZSBwcm9jZXNzIGNhbm5vdCBhY2Nlc3MgdGhlIGZpbGUgJ0M6XFVzZXJzXG5lcnNvelx0dXNjYW55XEJyYW5jaGVzXG5hdF9mbGFzaFxUdXNjYW55LmN5ZHNuXEdlbmVyYXRlZF9Tb3VyY2VcUFNvQzRcY3lmaXR0ZXJfY2ZnLmMnIGJlY2F1c2UgaXQgaXMgYmVpbmcgdXNlZCBieSBhbm90aGVyIHByb2Nlc3MuIChGaWxlPWN5Zml0dGVyX2NmZy5jKQ==;VW5hYmxlIHRvIG9wZW4gdGhlIGZpbGUgZm9yIHdyaXRpbmcuIFRoZSBwcm9jZXNzIGNhbm5vdCBhY2Nlc3MgdGhlIGZpbGUgJ0M6XFVzZXJzXG5lcnNvelx0dXNjYW55XEJyYW5jaGVzXG5hdF9mbGFzaFxUdXNjYW55LmN5ZHNuXEdlbmVyYXRlZF9Tb3VyY2VcUFNvQzRcY3lmaXR0ZXJfY2ZnLmMnIGJlY2F1c2UgaXQgaXMgYmVpbmcgdXNlZCBieSBhbm90aGVyIHByb2Nlc3Mu;docloc:cyfitter_cfg.c#/ (cyfitter_cfg.c);bse;M0105;VGhlIGdpdmVuIGZpbGUgY291bGQgbm90IGJlIG9wZW5lZCBmb3Igd3JpdGluZy4gQ2hlY2sgdGhhdCB5b3UgaGF2ZSB3cml0ZSBwZXJtaXNzaW9uLg==;;True]

0 Likes
HeLi_263931
Honored Contributor II

Are you sure that no other process is running? This error doesn't look as if it could be caused by running from a different folder.

Anonymous
Not applicable

I found the magic to make this work:

   

mkdir codegentemp

   

cd codegentemp

   

cygsfit.exe ...

   

 

   

It may be that this tool only work properly when run one directory below the project directory. Or perhaps it on works when run from a directory with the name 'codegentemp'

   

Re: Process conflict: Yes, I rebooted just to make certain.

Anonymous
Not applicable

actually this workaround is not satisfying as I'm supposed to run this tool in a specific folder but want to put the output in another one. Are there any other suggestions?

0 Likes
Anonymous
Not applicable

In order to provide some more background informations:

   

I'm using make in order to build my project. Generation become rather part of build process this way. Thus actually I'm using option -C in order to change build dir before starting build but this doesn't work either as location for build has not changed effectivelly.

0 Likes
Anonymous
Not applicable

After studying docs to PSoC Creator I became aware that this requested feature is obviously not provided.

   

Here is an another workaround - an answer to my own question:

   

->As I'm currently working with CMAKE to configure project and generate Makefiles for build. I'm using add_custom_command() to call cydsfit.exe by make in the latter. This CMAKE-function provides an option WORKING_DIRECTORY which actually makes it possible to determine location where to exececute cydsfit.exe!

   

 

   

Cheers

0 Likes