Keil Logo

µVISION DEBUGGER: FILL MEMORY WITH CONSTANT BEFORE LOAD


Information in this article applies to:

  • µVision Version 2 and Later

QUESTION

I need the code space filled with 0xFF before I load code from a HEX file. Is there a way to do this?

I have the following code in an assembler source file.

CSEG        at  1000H
version:    dw  0
crc:        dw  03273H,0F1A6H
date:       dw  042B0H,025D3H
pad:        ds  100
checksum:   dw  00F71H

When the simulator loads the program, the data in pad is all 0x00. When it is loaded into the target it is all 0xFF. Is there a way to fill the memory in the simulator with 0xFF?

ANSWER

Yes. The µVision debugger has several pre-defined debug functions. The function memset allows you to initialize the memory with a constant.

The following steps explain how to preset the memory in the simulator:

  • Disable Load Application under Project — Options — Debug.
  • Start the debugger and enter the following in the command window:
      memset (C:0, 0x10000, 0xFF)   // fill memory with 0xFF
      LOAD application              // load application code
    
    

You may automate this process by using an INI file that contains these debugger commands. This INI file can be entered under Project — Options — Debug — Initialization File.

MORE INFORMATION

SEE ALSO

FORUM THREADS

The following Discussion Forum threads may provide information related to this topic.

Last Reviewed: Thursday, January 11, 2007


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.