- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi there,
I would to add a custom build step to my PSoC Designer project. Is this possible? I can't find any options for it in the GUI. Is there some way I can do this?
Many thanks
Hugo Elias
- Labels:
-
PSoC 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What specifically you want to achieve by custom build. There is an option to build the project via Comand Line Interface. I can suggest you whether it'll help or not based on your requirements.
Best regards,
Pushek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a python script which generates a .h file like this:
#define SVN_REVISION 1644
This is the actual SVN version of the code being compiled. Therefore, when the code is programmed into the PSoC, I can ask the PSoC exactly which code version is has.
Actually, a custom build step is very useful for users who have any kind of automatically generated code. E.G. users who are using Flex and Bison.
Hugo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please see this post under the PSoC Designer Software forum :
Using Shared Libraries of Code with Multiple PSoC1 Projects
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi tommoxon,
thanks for the reply. However, this is not what I am looking for. I don't just want to include a file from another path, I want to generate a file befor compilation, using a python script.
Currently, when I press F6 to build, the following things happen:
- Generating project
- code generation
- DRC
- starting MAKE
- code is compiled
- code is linked
But, what I want is this:
- Generating project
- code generation
- DRC
- starting MAKE
- gen_svn_header.bat is executed
- code is compiled
- code is linked
gen_svn_header.bat is a batch file which runs a python script which generates a .h file which will be included into my code.
Hugo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do I take it that it's impossible to add a custom build step?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Rocketmagnet,
Did you ever get a solution for this? Would like to write the SVN revision number to a header file pre-build.
Thanks.
Stephen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I never saw a solution to this. However, I haven't looked at the recent updates on PSoC creator, so they might have sneaked it in recently.
Hugo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One solution would be use of a bootloader approach.
Just a thought.
http://www.cypress.com/?rID=50230 AN68272 UART BL PSOC 3, 4, 5LP
http://www.cypress.com/?rID=41002 AN60317 I2C BL PSOC 3, 5LP
http://www.cypress.com/?rID=57561 AN73503 USB HID BL with GUI Host PSOC 3, 5LP
http://www.cypress.com/?rID=56014 PSoC® 3, PSoC 4, and PSoC 5LP Introduction To Bootloaders
http://www.cypress.com/?rID=83293 AN86526 - PSoC® 4 I2C Bootloader
http://www.cypress.com/?rID=50230 AN68272 - PSoC® 3, PSoC 4 and PSoC 5LP UART Bootloader
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You could use a batch file to call your python script to generate your .h file then compile using the CLI
Check this link about PDCLI:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hmm, I'm disappointed there isn't a hook for triggering a custom command within the build process like some other IDEs, I'm trying to do the same and moving to CLI building isn't much simpler than manually triggering the batch file before building. I created some hooks that tie into TortoiseSVN commits/updates which gets me closer to what I want in the meantime.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I will respond late because earlier I had no need for PSOC1. Now I am making some maintenance to old project and am in the same issue. There is a trick. The designer does use GNU Make as the make handler and you can create local.mk. Inside the local.mk you can add a rule for version.h file, then this rule is going to run your custom script. Note that the local.mk seems to be loaded before any rules are defined. Thus I needed to add default rule before the version.h rule and instruct it to build the hex target.
---- local.mk ----
VERSIONCC:=..\PATH\TO\YOURVERSION.BAT
default: version.h output/$(PROJNAME).hex
.PHONY: version.h
version.h:
$(VERSIONCC) > version.h