- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is it possible to define an external command to be called each time I build my project? You see, I want to compile in values from my revision control system. We use TortoiseSVN, and there is a program called SubWCRev to use, http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-subwcrev-example.html
I also thought about solving this manually by always building my project from command line, by creating a build script. Is then the Cypress command line program cyprjmgr.exe the way to go? Actually, since I am a programmer, I prefer using command line anyway, so is it possible (in an easy way) to do building, programming and debugging from command line?
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For building Creator projects using commands, check the link - http://www.cypress.com/?id=4&rID=91866.
For Programming, check the link - http://www.cypress.com/?id=4&rID=92892. This link will tell you the the scripts available in various languages (C#, C++ , Perl, and Python) to program PSoC.
Debugging is tough using commands, but you can find useful information on ARM website for PSoC4/5.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for the links. Yes, it is probably easier to just use the debugger in PSoC Creator.
I was able to create a command line build script (in Cygwin), which runs the SubCWRev program before building my project. But SubCWRev will not be run if I build from GUI. So I am still wondering how to define an external command to be run each time I build my project, regardless of building from PSoC Creator (GUI) or cyprjmgr (command line). If this is possible. Because I want to be sure that each build will have the correct values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Unfortunately, there is no way to add commands to a build in Creator.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One could imagine using Python, something similiar, to modify script
and code files to customize them, and the script of course run compiler/linker
at command line/batch level ? Although I think this would be a involved to implement
this, not portable. Not clean.
Of course if you took a bootloader approach that would be relativelky easy.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For Your Interest, I post my Cygwin bash-shell script, ./compile.sh : #!/bin/bash # switch to directory of this file PATH_DIR="$( cd "$( dirname "$0" )" && pwd )" cd $PATH_DIR PATH_CYPRESS_BIN='/cygdrive/c/Program Files (x86)/Cypress/PSoC Creator/3.0/PSoC Creator/bin/' PATH_SOURCE="$(readlink -f FinalApp/MainApp/)" PATHWIN_WRK=$(cygpath -w $(readlink -f FinalApp/PSoC5LP.cywrk)) export PATH="$PATH:$PATH_CYPRESS_BIN" echo "creating 'cfg_revision.h' from TortoiseSVN..." SubWCRev . cfg_revision.h.template FinalApp/MainApp/app_cfg/cfg_revision.h echo "" echo "building project 'PSoC5LP'..." #cyprjmgr.exe -wrk $USER_PATH_WRK -prj PSoC5LP -build #^ did don work 😞 cygstart -w cyprjmgr -wrk $PATHWIN_WRK -prj PSoC5LP -build echo ""
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
#!/bin/bash
# switch to directory of this file
PATH_DIR="$( cd "$( dirname "$0" )" && pwd )"
cd $PATH_DIR
PATH_CYPRESS_BIN='/cygdrive/c/Program Files (x86)/Cypress/PSoC Creator/3.0/PSoC Creator/bin/'
PATH_SOURCE="$(readlink -f FinalApp/MainApp/)"
PATHWIN_WRK=$(cygpath -w $(readlink -f FinalApp/PSoC5LP.cywrk))
export PATH="$PATH:$PATH_CYPRESS_BIN"
echo "creating 'cfg_revision.h' from TortoiseSVN..."
SubWCRev . cfg_revision.h.template FinalApp/MainApp/app_cfg/cfg_revision.h
echo ""
echo "building project 'PSoC5LP'..."
#cyprjmgr.exe -wrk $USER_PATH_WRK -prj PSoC5LP -build
#^ did don work 😞
cygstart -w cyprjmgr -wrk $PATHWIN_WRK -prj PSoC5LP -build
echo ""
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks a lot!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is a little detail with the script above. I had to run cyprojmgr.exe through cmd.exe (this script is for cygwin bash). cmd.exe will just close when finished, regardless of cyprojmgr.exe program result. So it is not easy to see any build errors. This could probably be solved by calling a "wait' program if non-zero program result. But I am not good at scripting, so I just leave this for now. I program my chips with PSoC Creator 3 anyway, so I wil see my errors there.
And for this script, the project folder is FinalApp/ and source folder is FinalApp/MainApp/