| |||
| Home > Configuring Custom Targets > Example descriptions > Setting up memory blocks | |||
This example uses the connection created in Setting up an Integrator board and
core module. However, the AP and CM940T board
groups are removed to ensure a default memory mapping.
This example assumes that you have worked through Setting up a custom register , because it uses some of the configuration details set up in that example and saved in the board file.
This example describes how to set up two memory blocks that
are activated at different times according to the value of a register.
It uses the Newreg register created in Setting up a custom register . This is displayed
in the MYREG tab in the Register pane.
This example also describes setting a memory rule to specify
how the memory is used. When IND1 is set to Enabled, MEM2 is
activated. Otherwise, MEM1 is used. The example
is split into these sections, which must be executed in this sequence:
The first stage is to define the two Memory_blocks
named MEM1 and MEM2:
Select Target ? Connect to Target... to display the Connection Control window.
Ensure that RealView Debugger is not connected to a target.
Right-click on the MP3Player entry
and select Connection Properties... from
the context menu.
Expand the following entries in turn:
CONNECTION=MP3Player (change
as required)
Advanced_Information
Default
Memory_Block
Right-click on the REGS entry,
in the left pane, and select Make New... from
the context menu to see the prompt shown in Figure 3.34.
Enter a new name for this entry, for example MEM1,
and click Create.
Click on the MEM1 entry, in the
left pane.
Set the value of Start to 0x0 (this
is the default).
Set the value of Length to 0x80000.
Set the value of Description to Fast
Static RAM.
Set the value of Access entry
to RAM (this is the default).
Use Make Copy... on MEM1 to
create a new group, MEM2.
Click on the MEM2 entry, in the
left pane, to display the settings values.
Set the value of Access to ROM.
Set the value of *Description to Slow
Boot ROM.
Select File ? Save Changes to save the these changes.
The second stage is to define the rules that control which memory block is used:
Expand the Map_rule group.
The map rule defines which memory block to use. In this example, MEM2 is activated
if IND1 is set to Enabled (one).
Otherwise MEM1 is used.
Click on the Default entry.
Set the following values, shown in Figure 3.35:
Register to Newreg (use
the context menu).
Mask to 0x0001 (to
check IND1 value only)
Value to 0 (IND1 set
to Disabled)
On_equal to MEM1.
Rename the Default entry of Map_rule to RULE1.
Use Make Copy... on RULE1,
to create a new group, RULE2.
Click on RULE2 and set the value
of Value to 1 (IND1 set
to Enabled).
Set the value of *On_equal to MEM2,
shown in Figure 3.36.
All board file entries are now complete.
Select File ? Save and Close to save your changes and close the Connection Properties window.
Connect to your target.
In the Code window, select View ? Registers to view the MYREG tab.
Select View ? Memory Map tab to view the Map tab, shown in Figure 3.37.
Set the IND1 value to Enable to
activate the memory rule (RULE2) and so change
the memory map. The Start entry in the Map tab
changes to a ROM entry, indicated by a yellow icon.