[ABANDONED] SES - Multiple HEX output variations

  • [ABANDONED] SES - Multiple HEX output variations

    Hi, I have the following situation where in the same project I have code for different transceivers in order to avoid having multiple projects for different transceivers. If possible, I would like to automatically generate three different HEX file outputs for the different transceivers (a kind of HEX file output variations). We can implement a manual system where we would compile a single HEX file output each time based on the C preprocessor definition selected, but that would be time consuming.

    Any idea how this can be done? So for example in my code I'd have some kind of preprocessor definition that for variation 1 it would compile certain methods and for variation 2 it would compile other certain methods. Then in my Output Files I would ideally get out_variation1.hex and out_variation2.hex for example.
  • I would use a post-build command.
    This can be found in Code->User Build Step in the project options.
    Her a screenshot from a private project of mine:



    Basically all modern toolchains have such an option.
    My company uses it extensively to similiar purposes, like calculating a checksum over the Hex/S19 output and patch the checksum into the ex/S19 artifact.
  • I am not sure if we mean the same.
    Post-build steps happen after the build, not involving any build tools (compiler, linker).
    This are usually external tools, or batches/scripts.

    In the example I mentioned, this is a self-written tool that reads/parses the build artifact (an *.S19 file in this case), calculates a checksum over a given address range, and patches this checksum into the build artifact.
    In other cases, these are output format converters (Bin, Hex, S19, ...).

    In your case, I would suggest to have a look at the srec-tools (srecord.sourceforge.net).
    It is a powerful tool to convert, split, join and manipulate FLASH/EEPROM file formats like Hex, S19 and many others.

    The idea is to add the call the tool into the post-build step setup, or use a script (batch) for more complex tasks requiring multiple passes.