This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Component Viewer Description Files

Hi,

Is there a schedule when the Application Note 283: "Create Description Files for Component Viewer" will be available?

Thanks Martin

Parents
  • Hello Martin,

    The developers are fine-tuning a few examples and testing some new features for the Component Viewer. I don't know the exact date, but the application note should bec soon.

    Until then, examples can be found in the middleware pack's file system and network folders as "*.scvd" files.

    Here is a preview of an example for structures:
    Create a new file in the project and save it as "Keil.MyView.scvd2".
    Paste the code below into the new file. Instructions are available in the comments below:

    
    <?xml version="1.0" encoding="utf-8"?>
    <!-- Save as "Keil.MyView.scvd" -->
    
    
    <!--
      This is a minimal viewer displaying the values of a structure with to members:
    
      Add the following to your application:
    
    /* Type 'A' */
    typedef struct TypeA {
      uint32_t                Number;
      uint32_t                Status;
      uint32_t                Size;
    } TypeA;
    
    /* Type 'G' */
    typedef struct TypeB {
      uint32_t                Number;
      uint32_t                Cluster;
      uint32_t                ClusterSize;
            uint32_t                Status;
    } TypeG;
    
    /* Type Array */
    typedef struct TypeArray {
      void   *type_ref;
      char    id[2];
      uint8_t attr;
    } TypeArray;
    
    TypeA  type_a0 = { 0x1111, 0x01, 0x1400 };
    TypeA  type_a1 = { 0x2222, 0x11, 0x4000 };
    TypeG  type_g0 = { 0x3333, 0x200, 0x100, 0x11 };
    TypeG  type_g1 = { 0x4444, 0x400, 0x800, 0x41 };
    
    TypeArray type_array[4] =  {
      { &type_a0, "A0", 1 },
      { &type_g0, "G0", 2 },
      { &type_g1, "G1", 2 },
      { &type_a1, "A1", 1 },
    };
    
      Write some code in your application changing the mysymbol member variables.
    
      In uVision OFT -> Debug Dialog add this SCVD file under "Manage Component Viewer Description Files". Enter the debug mode and watch the values changing as you debug your application.
     -->
    
    <component_viewer schemaVersion="0.1" xmlns:xs="">www.w3.org/.../XMLSchema-instance" xs:noNamespaceSchemaLocation="Component_Viewer.xsd">
      <component name="MyView2" version="0.0.1"/>    <!-- name and version of the component  -->
    
      <typedefs>
        <typedef name="TypeArray" size="8">
          <member name="type_ref"  type="uint32_t"          offset="0"  info="Pointer to TypeA or TypeG" />
          <member name="id0"    type="uint8_t"  size="2" offset="4"  info="Type ID" />
          <member name="id1"    type="uint8_t"           offset="5"  info="Type ID" />
          <member name="attr"   type="uint8_t"     offset="6"  info="Type Attribute"/>
          <var    name="idx"    type="uint32_t"       info="Index in Type_x_ array" />
        </typedef>
    
        <typedef name="TypeA"  size="12">
          <member name="Number"    type="uint32_t"          offset="0" />
          <member name="Status"    type="uint32_t"          offset="4" />
          <member name="Size"      type="uint32_t"          offset="8" />
        </typedef>
    
        <typedef name="TypeG"  size="16">
          <member name="Number"      type="uint32_t"          offset="0" />
          <member name="Cluster"     type="uint32_t"          offset="4" />
          <member name="ClusterSize" type="uint32_t"          offset="8" />
          <member name="Status"      type="uint32_t"          offset="12" />
          <var    name="Size"        type="uint64_t"   />
        </typedef>
      </typedefs>
    
      <objects>
        <object name="MyTypeList">
          <var name="i" type="int32_t" value="0" />
          <var name="z" type="int32_t" value="0" />
    
          <readlist name="TypeA" type="TypeA" init="1" />
          <readlist name="TypeG" type="TypeG" init="1" />
    
          <readlist name="TArray" type="TypeArray" symbol="type_array" count="4" init="1" />  <!-- Type Array -->
    
          <list name="i" start="0" limit="TArray._count">
            <calc  cond="TArray[i].attr==1"> TArray[i].idx=TypeA._count;   </calc>
            <readlist cond="TArray[i].attr==1" name="TypeA"  type="TypeA" offset="TArray[i].type_ref" />
    
            <calc cond="TArray[i].attr==2">  TArray[i].idx=TypeG._count;   </calc>
            <readlist cond="TArray[i].attr==2"    name="TypeG"  type="TypeG" offset="TArray[i].type_ref" />
          </list>
    
          <list name="i" start="0" limit="TypeG._count">
            <calc>  TypeG[i].Size = TypeG[i].Cluster * TypeG[i].ClusterSize;   </calc>
          </list>
    
          <calc> z = 'A'; </calc>
          <list name="i" start="0" limit="TArray._count">
            <calc> TArray[i].id0[0] = z;   </calc>
            <calc> ++z;                    </calc>
          </list>
    
          <out name="MyTypeList">
            <list name="i" start="0" limit="TArray._count">
              <item property="String TArray[%d[i]].id0" value="%t[TArray[i].id0]" />
            </list>
    
            <list name="i" start="0" limit="TArray._count">
               <item cond="TArray[i].attr==1" property="Type A%d[TArray[i].id1-0x30]:" value="ref=%x[TArray[i].type_ref] idx=%x[TArray[i].idx]" >
              <item property="Type A, size=%d[TypeA[TArray[i].idx].Size]" value="Num=%x[TypeA[TArray[i].idx].Number] Status=%x[TypeA[TArray[i].idx].Status]" />
               </item>
               <item cond="TArray[i].attr==2" property="Type G%d[TArray[i].id1-0x30]:" value="ref=%x[TArray[i].type_ref] idx=%x[TArray[i].idx]" >
    
               <!-- value="Type B, size=%d[TypeG[TArray[i].idx].Size]"/> -->
    
               <item property="Type G, size=%d[TypeG[TArray[i].idx].Size]" value="Num=%x[TypeG[TArray[i].idx].Number] Status=%x[TypeG[TArray[i].idx].Status]" >
               <item property="Cluster" />   <!-- value="n=%x[TypeG[TArray[i].idx].Cluster] Size=%x[TypeG[TArray[i].idx].ClusterSize]" -->
               </item>
             </item>
            </list>
    
            <item property="" value="--- Types ---" />
    
            <list name="i" start="0" limit="TypeA._count">
              <item property="Type A%d[i]" value="Num=%x[TypeA[i].Number], size=%x[TypeA[i].Size]" />
            </list>
    
            <list name="i" start="0" limit="TypeG._count">
              <item property="Type G%d[i]" value="Num=%x[TypeG[i].Number], size=%x[TypeG[i].Size]" />
            </list>
    
          </out>
        </object>
      </objects>
    
    </component_viewer>
    
    
    

Reply
  • Hello Martin,

    The developers are fine-tuning a few examples and testing some new features for the Component Viewer. I don't know the exact date, but the application note should bec soon.

    Until then, examples can be found in the middleware pack's file system and network folders as "*.scvd" files.

    Here is a preview of an example for structures:
    Create a new file in the project and save it as "Keil.MyView.scvd2".
    Paste the code below into the new file. Instructions are available in the comments below:

    
    <?xml version="1.0" encoding="utf-8"?>
    <!-- Save as "Keil.MyView.scvd" -->
    
    
    <!--
      This is a minimal viewer displaying the values of a structure with to members:
    
      Add the following to your application:
    
    /* Type 'A' */
    typedef struct TypeA {
      uint32_t                Number;
      uint32_t                Status;
      uint32_t                Size;
    } TypeA;
    
    /* Type 'G' */
    typedef struct TypeB {
      uint32_t                Number;
      uint32_t                Cluster;
      uint32_t                ClusterSize;
            uint32_t                Status;
    } TypeG;
    
    /* Type Array */
    typedef struct TypeArray {
      void   *type_ref;
      char    id[2];
      uint8_t attr;
    } TypeArray;
    
    TypeA  type_a0 = { 0x1111, 0x01, 0x1400 };
    TypeA  type_a1 = { 0x2222, 0x11, 0x4000 };
    TypeG  type_g0 = { 0x3333, 0x200, 0x100, 0x11 };
    TypeG  type_g1 = { 0x4444, 0x400, 0x800, 0x41 };
    
    TypeArray type_array[4] =  {
      { &type_a0, "A0", 1 },
      { &type_g0, "G0", 2 },
      { &type_g1, "G1", 2 },
      { &type_a1, "A1", 1 },
    };
    
      Write some code in your application changing the mysymbol member variables.
    
      In uVision OFT -> Debug Dialog add this SCVD file under "Manage Component Viewer Description Files". Enter the debug mode and watch the values changing as you debug your application.
     -->
    
    <component_viewer schemaVersion="0.1" xmlns:xs="">www.w3.org/.../XMLSchema-instance" xs:noNamespaceSchemaLocation="Component_Viewer.xsd">
      <component name="MyView2" version="0.0.1"/>    <!-- name and version of the component  -->
    
      <typedefs>
        <typedef name="TypeArray" size="8">
          <member name="type_ref"  type="uint32_t"          offset="0"  info="Pointer to TypeA or TypeG" />
          <member name="id0"    type="uint8_t"  size="2" offset="4"  info="Type ID" />
          <member name="id1"    type="uint8_t"           offset="5"  info="Type ID" />
          <member name="attr"   type="uint8_t"     offset="6"  info="Type Attribute"/>
          <var    name="idx"    type="uint32_t"       info="Index in Type_x_ array" />
        </typedef>
    
        <typedef name="TypeA"  size="12">
          <member name="Number"    type="uint32_t"          offset="0" />
          <member name="Status"    type="uint32_t"          offset="4" />
          <member name="Size"      type="uint32_t"          offset="8" />
        </typedef>
    
        <typedef name="TypeG"  size="16">
          <member name="Number"      type="uint32_t"          offset="0" />
          <member name="Cluster"     type="uint32_t"          offset="4" />
          <member name="ClusterSize" type="uint32_t"          offset="8" />
          <member name="Status"      type="uint32_t"          offset="12" />
          <var    name="Size"        type="uint64_t"   />
        </typedef>
      </typedefs>
    
      <objects>
        <object name="MyTypeList">
          <var name="i" type="int32_t" value="0" />
          <var name="z" type="int32_t" value="0" />
    
          <readlist name="TypeA" type="TypeA" init="1" />
          <readlist name="TypeG" type="TypeG" init="1" />
    
          <readlist name="TArray" type="TypeArray" symbol="type_array" count="4" init="1" />  <!-- Type Array -->
    
          <list name="i" start="0" limit="TArray._count">
            <calc  cond="TArray[i].attr==1"> TArray[i].idx=TypeA._count;   </calc>
            <readlist cond="TArray[i].attr==1" name="TypeA"  type="TypeA" offset="TArray[i].type_ref" />
    
            <calc cond="TArray[i].attr==2">  TArray[i].idx=TypeG._count;   </calc>
            <readlist cond="TArray[i].attr==2"    name="TypeG"  type="TypeG" offset="TArray[i].type_ref" />
          </list>
    
          <list name="i" start="0" limit="TypeG._count">
            <calc>  TypeG[i].Size = TypeG[i].Cluster * TypeG[i].ClusterSize;   </calc>
          </list>
    
          <calc> z = 'A'; </calc>
          <list name="i" start="0" limit="TArray._count">
            <calc> TArray[i].id0[0] = z;   </calc>
            <calc> ++z;                    </calc>
          </list>
    
          <out name="MyTypeList">
            <list name="i" start="0" limit="TArray._count">
              <item property="String TArray[%d[i]].id0" value="%t[TArray[i].id0]" />
            </list>
    
            <list name="i" start="0" limit="TArray._count">
               <item cond="TArray[i].attr==1" property="Type A%d[TArray[i].id1-0x30]:" value="ref=%x[TArray[i].type_ref] idx=%x[TArray[i].idx]" >
              <item property="Type A, size=%d[TypeA[TArray[i].idx].Size]" value="Num=%x[TypeA[TArray[i].idx].Number] Status=%x[TypeA[TArray[i].idx].Status]" />
               </item>
               <item cond="TArray[i].attr==2" property="Type G%d[TArray[i].id1-0x30]:" value="ref=%x[TArray[i].type_ref] idx=%x[TArray[i].idx]" >
    
               <!-- value="Type B, size=%d[TypeG[TArray[i].idx].Size]"/> -->
    
               <item property="Type G, size=%d[TypeG[TArray[i].idx].Size]" value="Num=%x[TypeG[TArray[i].idx].Number] Status=%x[TypeG[TArray[i].idx].Status]" >
               <item property="Cluster" />   <!-- value="n=%x[TypeG[TArray[i].idx].Cluster] Size=%x[TypeG[TArray[i].idx].ClusterSize]" -->
               </item>
             </item>
            </list>
    
            <item property="" value="--- Types ---" />
    
            <list name="i" start="0" limit="TypeA._count">
              <item property="Type A%d[i]" value="Num=%x[TypeA[i].Number], size=%x[TypeA[i].Size]" />
            </list>
    
            <list name="i" start="0" limit="TypeG._count">
              <item property="Type G%d[i]" value="Num=%x[TypeG[i].Number], size=%x[TypeG[i].Size]" />
            </list>
    
          </out>
        </object>
      </objects>
    
    </component_viewer>
    
    
    

Children
No data