ARM Technical Support Knowledge Articles

How do I display custom coprocessor registers in RVD?

Applies to: RealView Development Suite (RVDS)

Answer

Using the Board Chip Description (BCD) files, it is possible to tell RVD about memory mapped registers and have them displayed in the register pane.  BCD files do not provide a mechanism for non-memory mapped registers, such as those of a custom coprocessor.  Or for memory mapped registers which have special access requirements.

Instead it is possible to access these registers by using the macro language.  Included with this FAQ are two example macros which demonstrate how this can be achieved.  Both macros are targeted at the ARM1136J(F)-S, and are designed to display the values of the CP14 registers.  These are provided for demonstration purposes only, and you will need to adapt them for your own requirements.

The first macro (cli.inc) shows how to display the value on the RVD command line.  The second (gui.inc) shows how a custom GUI window can be created for displaying the registers.

Both macros use the same method for accessing the coprocessor.  The macro writes the bit pattern of the required instruction into memory.  It then sets the PC to point at the instruction, and single steps the core.  And example code snippet is given below:

 $setmem /W MemAddr=0xEE100E10$;  <-- Write bit pattern of MRC into memory
 $setreg @r15=MemAddr$;   <-- set pc to point at the instruction
 $stepi$;   <-- step instruction
 temp = reg_str("@r0");  <-- extract read value
 $printf "DIDR = 0x%08x", temp$;  <-- print value
 $pause 1$;  <-- pause required in RVDS 3.0 first release

For information on to use the example macros, please see the readme.txt file provided with the macros in the zip archive.

Download Example Macros

Attachments: coproc.zip

Article last edited on: 2011-08-16 16:35:24

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