17.4.3. Setting up a custom register

This example describes the steps to follow to specify a register MYREG, that appears as a new tab in the Register pane. It also describes how to set up named bit fields in this register. To set up the custom register, you must make changes in the Memory_block, Register, Register_enum, and Register_Window groups.

In this example:

The example is split into the following sections, which must be executed in this sequence:

  1. Setting up the configuration

  2. Creating enumerations for the register values

  3. Creating the register descriptions

  4. Creating the register tab

  5. Displaying the register.

Setting up the configuration

In this stage, you set up a memory group that provides the base address for the new registers:

  1. Ensure that RealView Debugger is not connected to a target.

  2. Expand the following entries of the selected board group:

    1. CONNECTION=RVI-ME

    2. Advanced_Information

    3. Default

  3. Expand the Memory_block group.

  4. Rename the Default entry under Memory_block to REGS.

  5. Click on the REGS entry, in the left pane, to display the group contents.

  6. Set the value of Start, in the right pane, to 0x10000000.

  7. Set the value of Length to 0x800000 (Figure 17.16).

    Figure 17.16. Configuring REGS

    Configuring REGS
  8. Set the value of Description to I/O Registers.

Creating enumerations for the register values

In this stage you set up enumerations, or names for specific values, that are used when the register value is displayed:

  1. Expand Register_enum in the left pane.

  2. Use Make New... to create a new Register_enum. Name this E_SWITCH.

  3. Click on the E_SWITCH entry, in the left pane, to display the group contents.

  4. Set the value of Names, in the right pane, to On,Off.

  5. Rename the Default entry under Register_enum to E_ENABLE.

  6. Click on the E_ENABLE entry, in the left pane, to display the group contents.

  7. Set the value of the Names entry, in the right pane, to Disable,Enable (Figure 17.17).

    Figure 17.17. Creating enumerations

    Creating enumerations

Creating the register descriptions

In this stage you create descriptions of each register:

  1. Expand the Register group.

  2. Rename the Default entry under Register to Newreg.

  3. Expand the Newreg group.

  4. Set the value of Base to REGS.

  5. Set the value of Start to 0x20.

  6. Expand the Bit_fields group, to set up the four bit fields.

  7. Rename the Default entry under Bit_fields to IND1.

  8. Use Make Copy... on IND1. The dialog suggests the name IND2. Click Create.

  9. Use Make Copy... on IND2. The dialog suggests the name IND3. Click Create.

  10. Use Make Copy... on IND3. The dialog suggests the name IND4. Click Create.

  11. Click IND1, in the left pane and set these values (Figure 17.18):

    • Position=0 (this is the default)

    • Size=4

    • Enum=E_ENABLE.

    Figure 17.18. Creating bit field descriptions

    Creating bit field descriptions
  12. Click on the IND2 entry and set these values:

    • Position=4

    • Size=4

    • Enum=E_SWITCH.

  13. Click on the IND3 entry and set these values:

    • Position=8

    • Size=4.

  14. Click on the IND4 entry and set these values:

    • Position=12

    • Size=4.

Creating the register tab

In this stage you create a Register_Window group to display the new register in the Register pane:

  1. Expand the Register_Window group.

  2. Rename the Default entry under Register_Window to MYREG. This is the name of the new tab in the Register pane.

  3. Click on MYREG, in the left pane.

  4. Set the Line entry, to _INDICATORS. (Literals entered in Line must be preceded by an underscore.)

  5. Use Make New... on *Line to create a new *Line entry.

  6. Set the new *Line to IND1,IND2,IND3,IND4.

    The Connection Properties window looks like Figure 17.19.

    Figure 17.19. The MYREG group

    The MYREG group

    All board file entries are now complete.

Displaying the register

In the last stage save the changes and display the new register in the Register pane:

  1. Select File → Save and Close to save the new settings and close the Connection Properties window.

  2. Connect to your target.

  3. Select View → Pane Views → Registers to view the new tab, MYREG, shown in Figure 17.20.

    Figure 17.20. MYREG in the Register pane

    MYREG in the Register pane
Copyright © 2003, 2004 ARM Limited. All rights reserved.ARM DUI 0234B
Non-Confidential