This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

HEX utility: create a TXT file with the filename from a #define in the source code

Hello,

I would like to create a TXT file automatically with the Hex utility. The file name should correspond to a #define in the source code.

For example:

#define DEVICESN V3_07_SN3019

should create a file "V3_07_SN3019.txt". The text behind DEVICESN changes with each device.

Thanks for the help

Stefan

  • There is no method for automatically propagating the value of a #define outside a C file.  But you can go the other way around.

    You could automatically generate a compiler option like --define=DEVICESN=V3_07_SN3019.  However you do that can also generate the file name at a later point in the build.

    Thanks and regards,

    -George