Hello,
I'm developing a nRF53832 project with SES. As part of the compile/debug workflow, I need to execute a batch file after the build, to create an additional file for jLink to flash. I'm using the project option "user build step" to launch the batch file and "additional load file" to flash the hex file. So far, so good, it all works.
The batch file used to create the additional hex file needs the app version as a parameter. Currently I invoke it as "$(SolutionDir)/scripts/SES_Postbuild_DBG.bat 1234" (no quotes, and 1234 is my app version number). The version number 1234 is used in multiple places in the app, and defined as a preprocessor definition "APP_VER=1234", then used in my code as appropriate
Is there a way to pass APP_VER to the batch file as if it were a macro? In reality I have multiple configurations executing different batch files depending on build options, and the only way to ensure all the app version numbers are in sync is to document each use and ensure that all members of the team remember to select all the configurations and manually ensure everything is in sync (or "open solution in editor" and do a search&replace there)
Being able to pass a user defined macro/preprocessor option to my batch file would be a much more elegant solution, but I don't see a way to do it. Is there a trick I'm not aware of?
I'm developing a nRF53832 project with SES. As part of the compile/debug workflow, I need to execute a batch file after the build, to create an additional file for jLink to flash. I'm using the project option "user build step" to launch the batch file and "additional load file" to flash the hex file. So far, so good, it all works.
The batch file used to create the additional hex file needs the app version as a parameter. Currently I invoke it as "$(SolutionDir)/scripts/SES_Postbuild_DBG.bat 1234" (no quotes, and 1234 is my app version number). The version number 1234 is used in multiple places in the app, and defined as a preprocessor definition "APP_VER=1234", then used in my code as appropriate
Is there a way to pass APP_VER to the batch file as if it were a macro? In reality I have multiple configurations executing different batch files depending on build options, and the only way to ensure all the app version numbers are in sync is to document each use and ensure that all members of the team remember to select all the configurations and manually ensure everything is in sync (or "open solution in editor" and do a search&replace there)
Being able to pass a user defined macro/preprocessor option to my batch file would be a much more elegant solution, but I don't see a way to do it. Is there a trick I'm not aware of?