Keil C51 flash download, how to select a different hex file?

I am using the silicon labs C8051 Fxxx driver to program my target device.

during flash download, is there an option to select a different hex file?

I could not find it in the "configure flash tools"

Thank you.

Fausto 

  • First, some general information: When you perform a flash download, µVision loads the file that is specified under 'Options for Target - Output - Name of Executable' and the folder that is selected left of it. So by default, µVision loads the linker output file (OMF format) rather than the hex file. Therefore it doesn't make any difference if you select 'Create HEX File' in the same dialog or not, because the HEX file is not used by default.

    In theory, you could specify the HEX file under 'Options for Target - Output - Name of Executable' and a Flash download would load this HEX file. However, with the next project build, this file would be overwritten with the OMF file that is generated by the linker. So this is not really an option. This could only be used if you define a separate target for Flash programming, which you never use for building the application.

    The best solution would probably be to specify an initialization file where you load a HEX file. So you can generate an INI file that only contains one line with a load command:

    LOAD myhexfile.hex

    This file can then be specified in the dialog 'Options for Target - Utilities - Init File'. If you want to load an additional file to the one that is generated in your project (e.g. bootloader, ROM tables and the like), you should use the keyword 'INCREMENTAL' in your load command. For example:

    LOAD myhexfile.hex INCREMENTAL

    See https://www.keil.com/support/man/docs/uv4cl/uv4cl_cm_load.htm for more details about the LOAD command.