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

Can LOAD file to a specified memory area ?

The command "SAVE" can be used to save a specified memory to hex file. So, my question is that there is any command for loading a file into a specified memory area?
For example, I have a hex file, I want to write it into external memory from 0x0100 to 0x0200. The website http://www.keil.com/support/man/docs/uv3/uv3_cm_load.htm is about command "LOAD", but it seem can not load file into a specified memory.

Thank you for helping.

Best Regard.

Parents Reply Children
  • The Hex file from Save includes address information - so that Load will put it back where it came from.

    You mean, if I SAVE to SIM1.hex from a specified memory 0~0x1000 at first, then use LOAD will cause SIM1.hex load into 0~0x1000, because the hex file already include address information by SAVE. Is that your meaning ?

    How can I LOAD SIM1.hex into 0x0300~0x2000 not 0~0x1000 ?

    However if I did LOAD hex file without address information at first, it will cause a error ?

    Actually, I want to find a way out that I can load(read) my own bin file into a data memory area I defined, and maybe the bin file just include some raw data.

    Another question is that, from http://www.keil.com/support/docs/2397.htm, where is definition of S:, T:, U:, and V: ?

    After testing, I already know that S:/T:/U:/V: are specified memory name with start and end address, and it seems that I must give name as S/T/U/V.

    Thank you for helping.

    Best Regards,

  • "You mean, if I SAVE to SIM1.hex from a specified memory 0~0x1000 at first, then use LOAD will cause SIM1.hex load into 0~0x1000, because the hex file already include address information by SAVE. Is that your meaning ?"

    Correct.

    "How can I LOAD SIM1.hex into 0x0300~0x2000 not 0~0x1000 ?"

    As I said, you would have to edit the Hex file.

    Do you understand how Intel Hex files work?
    There is a description here: http://www.keil.com/support/docs/1584.htm

    The Hex file contains both data and the addresses at which to place that data.

    "if I did LOAD hex file without address information"

    There is no such thing - see above.

    "Actually, I want to find a way out that I can load(read) my own bin file"

    I don't think uVision supports loading BIN files - you can check in the Manual.

    But you can convert a BIN file to HEX - see the links in the page I cited earlier.

    "where is definition of S:, T:, U:, and V: ?"

    It tells you they are user-defined - so you define them!

  • But you can convert a BIN file to HEX - see the links in the page I cited earlier.

    There are ready-made tools available for this purpose - some of them are even available for free, like "srecord". They can also do the address manipulation for you.

  • "There are ready-made tools available for this purpose - some of them are even available for free"

    And some included with the Keil tools!
    Of course, the Link describes the Keil ones.

  • Thank you very much, Andy.

    I had used BIN2HEX to convert the bin file to be a hex file, and I LOAD it into memory in uVision2 command window successfully.

    But it got a error while loading the hex file with big size. I set the starting address is 0x3000, and the hex file size is around 10MB. uVision2 feedback a error message "error 57: illegal address:0x00FFFF".

    I guess it is that loading 10MB hex file get over 64KB address defintion, because loading 3KB hex file doesn't.

    How can I solve it?

    BR,

  • "I guess it is that loading 10MB hex file get over 64KB address defintion"

    Of course it does!

    "How can I solve it?"

    Don't attempt to load files that are too big!!