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?
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.
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.
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:
But, what I want is this:
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.
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
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.
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 ----
default: version.h output/$(PROJNAME).hex
$(VERSIONCC) > version.h