This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to include a Hex along with C codes in uv2 simulator?

Hi, there,

I want to use uv2 to debug a system consisting of a set of C codes and one hex file. The C codes will read the data from this hex file.

In uv2, I have created a project for this set of C codes, I can debug/trace the their execution.

The question is how to include the Hex file into this project?

Plausible solution 1, I added the Hex file into the project along with the C codes, and specify the Hex file's type as "Text file". The C codes could *not* read the data from the Hex file correctly.

Plausible solution 2, in the "Options for Task" popup utility, there is a Linker panel. However, I didn't figure out where to put the Hex file.

Any suggestion?

For details of my task, please refer to the following discussion thread.

http://www.keil.com/forum/docs/thread3564.asp

Kan

Parents
  • I added the Hex file into the project along with the C codes, and specify the Hex file's type as 'Text file'."

    When you specify a file as a 'Text File' that tells uVision that the only thing it has to do with that file is to display it in the editor - it does not form part of the build.

    "in the 'Options for Task' popup utility, there is a Linker panel."

    The linker deals with Object files - not hex files.
    The Linker's output is converted to hex (if required) after the Linker has finished - the linker knows nothing about hex files.
    If you want to merge a hex file with the hex file generated by the uVision build, you will have to do that via the 'Run User Program' options on the 'Output' tab.

    "Any suggestion?"

    Presumably, your hex file contains absolutely-located data?
    Why not just define a 'C' pointer to that location?
    Or maybe use the _at_ keyword extension to place a suitable 'C' symbol there?

Reply
  • I added the Hex file into the project along with the C codes, and specify the Hex file's type as 'Text file'."

    When you specify a file as a 'Text File' that tells uVision that the only thing it has to do with that file is to display it in the editor - it does not form part of the build.

    "in the 'Options for Task' popup utility, there is a Linker panel."

    The linker deals with Object files - not hex files.
    The Linker's output is converted to hex (if required) after the Linker has finished - the linker knows nothing about hex files.
    If you want to merge a hex file with the hex file generated by the uVision build, you will have to do that via the 'Run User Program' options on the 'Output' tab.

    "Any suggestion?"

    Presumably, your hex file contains absolutely-located data?
    Why not just define a 'C' pointer to that location?
    Or maybe use the _at_ keyword extension to place a suitable 'C' symbol there?

Children