Creating Custom Memory Mapped CCStudio Register Windows

From Texas Instruments Embedded Processors Wiki

Jump to: navigation, search
Translate this page to   

Contents

Background

Register information has traditionally been defined in a binary file called the TPI. To find what information to display in the CCStudio Register Window, CCStudio would query the TPI. CCStudio has recently gone to a new method where this information is contained in XML files. Devices that have been released since then are defined by these XML files. One nice feature about the XML file driven implementation is that it is expendable by users who wish to add additional information, like custom memory mapped registers. This information would then be available in certain windows like the Register Window.

Custom Memory Mapped Registers

Users can add their own custom memory mapped registers to appear in the Register Window by creating their own custom module XML files in the target database. To do so, a device XML file must exist for your particular device. Device XML files are located in the <CCStudio Install Dir>\drivers\TargetDB\Devices directory. If a device XML file exists for you device, then a module XML file where describes your custom register may be created. Module XML files are usually located in the <CCStudio Install Dir>\drivers\TargetDB\Modules directory.

Creating a Module XML File

A module XML file can have the following elements:


<module>: Specifies a group of registers. This is the top level element of the module XML file.

Attributes of interest:

<module id="PLLC0" HW_revision="0" XML_version="1" description="PLL Controller">

<register>: Specifies a register. It is a sub-element of <module>

Attributes of interest:

<register id="PID" acronym="PID" offset="0x0" width="32" description="Contains peripheral ID and revision information">

<bitfield>: Allows a register to be grouped into fields of bits for easier interpretation and manipulation. It is a sub-element of <register>.

Attributes of interest:


<register id="PID" acronym="PID" offset="0x0" width="32" description="Contains peripheral ID and revision information">
         
    <bitfield id="TYPE" width="8" begin="23" end="16" resetval="0" description="Peripheral Type: 0x01 to identify as PLLCTRL" range="" rwaccess="RW">
    ...
    </bitfield>

    <bitfield id="CLASS" width="8" begin="15" end="8" resetval="0" description="Peripheral Class: 0x08" range="" rwaccess="RW">
    ...
    </bitfield>

    <bitfield id="REV" width="8" begin="7" end="0" resetval="0" description="Peripheral Revision" range="" rwaccess="RW">
    ...
    </bitfield>

</register>

<bitenum>: Allows a bitfield to be defined so that it can only be populated with specific values that can be represented by strings. It is a sub-element of <bitfield>.

Attributes of Interest

<bitfield id="PLLEN" width="1" begin="0" end="0" resetval="0" description="PLL Mode Enable.  PLLCTL. PLLENSRC must be cleared to 0 before this bit will have any effect." range="" rwaccess="RW">                 
    <bitenum id="0: Bypass mode" value="0" token="0: Bypass mode" description="" />
    <bitenum id="1: PLL mode" value="1" token="1: PLL mode" description="" />
</bitfield>

Modifying the Device XML File

Once the module XML file has been created, it needs to be referenced by the applicable device XML file. This is done by adding a new <instance> element to the device XML file.

<instance>: References a module XML file to be used by the Register Window

Attributes of Interest

<instance href="..\Modules\pllc0_arm.xml" id="PLLC0" xml="pllc0_arm.xml" xmlpath="..\Modules\" HW_revision="1.0" description="PLLC0" requestor="TMS470R2X" baseaddr="0x01C40800" endaddr="0x01C4096B" size="" accessnumbytes="4" permissions="p" />

Referencing the Device XML File

Once the module and device XML files have been created, the device XML file will need to be referenced by CCStudio to get the Register Window to display your register(s). Depending on the setup configuration, the device file may automatically be referenced. You can check this in your setup configuration in CCStudio setup. When you select a configuration in setup that looks something has an extra level in setup, then a device XML file is being used. You can see the extra level in setup highlighted below.

Regwin device select.PNG


If there is no extra level, then a device XML file is not being referenced. A custom configuration can be created that references a device XML file. When choosing the processor type, you can choose either a processor or a device represented by a device XML file. An easy way to determine which is representing a device XML file is to see if there is a driver location associated with the option. The ones without a driver location indicate that it is a device represented by a device XML file. Also looking closely at the icons, you’ll notice that the icon for a processor is slightly different than an icon for a device.

Regwin setup.PNG


Note that when adding some of the device XML files to your setup, it may have extra (or incorrect) information underneath so carefully check the added devices and modify as needed.

Instead of creating a configuration in setup which references a device XML file, you can also explicitly load the device XML file inside CCStudio with the GEL_InitializeRegisterData(“C:\\CCStudio_v3.3\\drivers\\TargetDB\\Devices\\device.xml”) GEL command. One trick is to place this call in the OnTargetConnect() GEL callback so that it is run every time connection to the target is established. Please note that running this command will reset the current register information and replace it only with the register information contained in the specified file. If the device XML file referenced does not expose those registers then those register will not be available.

Another thing to note is that the XML files are cached as .cache files in the <CCStudio Install Dir>\drivers\TargetDB\Devices folder. If changes are made to the XML files, the .cache file associated with the device (device.xml.cache) must be removed (deleted) otherwise the changes will not be loaded.

If the module and device XML files have been properly created/updated and referenced, then the new custom register group(s) will now be available in the register window for that device.

Regwin.PNG


More examples of module and device XML files can be found in <CCStudio Install Dir>\drivers\TargetDB\Devices and <CCStudio Install Dir>\drivers\TargetDB\Modules

E2e.jpg For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article Creating Custom Memory Mapped CCStudio Register Windows here.
Hyperlink blue.png Links
ARM Microcontroller MCU ARM Processor Digital Media Processor Digital Signal Processing Microcontroller MCU Multi Core Processor
Ultra Low Power DSP 8 bit Microcontroller MCU 16 bit Microcontroller MCU 32 bit Microcontroller MCU

Leave a Comment
Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox