CrossStudio memory map files are structured using XML syntax to enable simple construction and parsing.

The first entry of the project file defines the XML document type which is used to validate the file format.

<!DOCTYPE Board_Memory_Definition_File>

The next entry is the Root element; there can only be one Root element in a memory map file.

<Root name="My Board" >

A Root element has a name attribute - every element in a memory map file has a name attributes. Names should be unique within a hierarchy level. Within a Root element there are MemorySegment elements which represent memory regions within the memory map.

<Root name="My Board" >
  <MemorySegment name="Flash" start="0x1000" size="0x200" access="ReadOnly" >

MemorySegment elements have the following attributes.

A MemorySegment can contain Register and RegisterGroup elements. RegisterGroup elements are used to group sets of registers. Register elements are used to define peripheral registers.

<Root name="My Board" >
  <MemorySegment name="System" start="0x2000" size="0x200" >
    <RegisterGroup name="Peripheral1" start="0x2100" size="0x10" >
      <Register name="Register1" start="+0x8" size="4" >

Register group elements have the same attributes as MemorySegment elements. Register elements have the following attributes.

A Register element can contain BitField elements that represent bits within a peripheral register.

<Root name="My Board" >
  <MemorySegment name="System" start="0x2000" size="0x200" >
    <RegisterGroup name="Peripheral1" start="0x2100" size="0x10" >
      <Register name="Register1" start="+0x8" size="4" >
        <BitField name="Bits_0_to_3" start="0" size="4" />

BitField elements have the following attributes.

You can refer to other memory map files using the Import element.

<Root name="My Board" >
  <MemorySegment name="External SRAM" start="0x3000" size="0x200" access="ReadOnly" >
  <Import filename="$(StudioDir)/targets/Manufacturer1/Processor1.xml" />

The filename attribute is an absolute filename which is macro expanded using CrossWorks system macros. An imported memory map file must be an XML file (without a DOCTYPE). The Processor element can be used to group several MemorySegment elements for this purpose.

<Processor name="Processor1" >
  <MemorySegment name="Internal SRAM" start="0x1000" size="0x200" access="ReadOnly" >
  <MemorySegment name="System" start="0x2000" size="0x200" >