ARM Technical Support Knowledge Articles

TESTING VON NEUMANN MEMORY AREAS

Applies to: MON51 Target Monitor

Answer


Information in this article applies to:


QUESTION

I'm trying to configure the monitor for my target hardware. How can I verify that my memory is von Neumann mapped?

ANSWER

Checking for von Neumann memory is fairly easy.

One method is to create a stand-alone program that uses the XBYTE and CBYTE absolute access macros to write to XDATA and read from CODE memory. For example:

unsigned long addr;

for (addr = 0x8000; addr < 0x10000; addr++)
  {
  XBYTE [addr] = (unsigned char) ('A' + addr);
  if (CBYTE[addr] != (unsigned char) ('A' + addr))
    printf ("Error at address %4.4X
", (unsigned) addr);
  }

This example code writes values into XDATA from 0x8000 to 0xFFFF and outputs an error message if the values do not match. You could create a simple program to scan the von Neumann areas of memory and report on whether or not they "pass".

Another method is to use the Keil uVision Debugger to fill XDATA memory with a value and to then check it by reading CODE memory.

To start the debugger and connect to your target hardware, you must...
  1. Program the monitor into your target hardware.
  2. In your project, select the Debug tab from the Project Options dialog. Select Use Keil Monitor-51 Driver and configure the settings (specifically the baud rate) to match your target.
  3. Make sure that Load Application at Startup is NOT CHECKED.
  4. Start the debugger. This will establish communications with the monitor but will NOT download your application.
  5. If the message, "Connected to Monitor-51 V3.0" appears in the Command Window, the monitor and debugger are connected and communicating. If you get this far, the monitor is working. Next, you should test the von Neumann memory to make sure it is OK.
To test the von Neumann Memory Areas...

The monitor must have 2 von Neumann memory areas. One is for your target program. When the debugger downloads the program to the monitor, the monitor actually writes the code into the XDATA space. The code it writes must appear in CODE space to be executed. Therefore, this memory area must be von Neumann.

The other von Neumann memory area is reserved for the monitor. This 256-byte area is the monitor's data area. It, too, must be von Neumann mapped because the monitor generates code on-the-fly that it writes into this area.

To test the Target Program Memory...

  1. Use the debugger's memset function to fill memory with a value like 'A'. For example, for a von Neuman memory range of 0x8000-0xFFFF, use memset (X:0x8000, 0x8000, 'A').
  2. If the debugger loses communications with the monitor, you have written over the monitor data area.
  3. Check XDATA memory using D X:0x8000. Check CODE memory ussing D C:0x8000.
  4. The data displayed for each should show all 'A's. If they do not, then that memory is NOT von Neumann memory.

To test the Monitor Data Memory...

  1. If you fill the monitor data area with a value, you will lose connection between the debugger and the monitor. If this happens, you may reset the target board to reestablish communications with the monitor.
  2. The best way to test that the monitor data area is von Neumann is to view the XDATA and CODE memory and be sure they are the same.
To Summarize...

Most of the monitor problems we see are related to monitor configuration or to memory configuration. The above steps should help you resolve the von Neumann aspects of your memory map.

SEE ALSO

Article last edited on: 2006-06-02 16:40:13

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential