CDE Hacking: Where is my stuff? A dissection…

What I describe here is an overview about the different locations, folder and files you will see if you are importing or developing a Processor Expert User component. I’m showing below example screenshot for the FreeRTOS component, as this is probably the most complex one I ever have created.

!!!Warning!!!

Important Note: Most of the files and folders described here are maintained by the Processor Expert Component Wizard. All the files (with the exception of icon/bitmap files) are text or XML files, so you can use any text editor to inspect (and change!) them. But make sure that you have backups or things in a version control system. If you screw up, you probably will screw up badly. The information I give in my blog are as good and as best I can, but there is no guarantee. Just to make sure you are warned ;-).

Where are the files?

I have imported a Processor Expert user component with the CodeWarrior menu Processor Expert > Import Package, but where are all the file(s) now?

Unfortunately, the answer is not that easy. In Eclipse based CodeWarrior, I use the menu Help > Window > Preferences > Processor Expert > Processor Expert System. This shows where the user components are installed:

User component directory

User component directory

Because I cannot use (say copy) that path here, the same path is reported in the Console View too:

Console View with User Working Directory

Console View with User Working Directory

The Console view is used by other providers of console information. So if the above information is not shown, I select the Processor Expert output:

Switching Console View Content

Switching Console View Content

PE Folders

If I go up one level (in my case: C:\ProgramData\Processor Expert), then I have following folders:

PE Folders

PE Folders

The naming scheme of the folders is <product>_PE_<version>:

  • CodeWarrior for MCU V10.x (Eclipse based): CWMCU_PE5_00
  • CodeWarrior for MCU V6.3 (non-Eclipse): CW08_PE3_09
  • CodeWarrior for S12(X) V5.1 (non-Eclipse): CW12_PE3_02
  • CodeWarrior for DSC56800E v8.3: CW56800_PE3_00

I cannot count on these folder names: they can change if I install a service pack which comes with a new version (number) of Processor Expert. The consequence of this is that even if all my user components are compatible, I need to have them in separate folders on my host.

Tip: the only suitable workaround  for this ‘Processor Expert version folder structure’ is using a version control system like SVN. Developing and testing/using Processor Expert user components without a version control system easily ends up in a desaster.

User Working Directory

From the Console View I can copy/paste the path into the Windows Explorer to show my components:

CWMCU_PE5_00 Folder

CWMCU_PE5_00 Folder

Tip: Because it is hard to remember that folder location, I have created a shortcut on my desktop (or as a ‘Library folder’ in Windows 7).

Users of SVN will notice the two red folder icons for ‘Beans’ and ‘Drivers’ folders: I have these folders under version control as the important stuff in these two folders. More on this follows below.

Note: there is as well the ‘Templts’ folder which has Processor Expert User Templates. See Copy my Component Settings: Processor Expert Templates.

Beans Folder

The Beans folder inside the ‘User Working Directory’ contains a folder for each Component (I have more than 100 :-), many are published here):

Beans Folder with Components and Global Interfaces

Beans Folder with Components and Global Interfaces

Components can have ‘private’ or ‘local’ interfaces. I use ‘global’ interfaces for ‘classic’ Processor Expert as otherwise I ended up with creating duplicated components in the project (one for each (local) interface). The solution was to assign a ‘global’ interface instead. The Eclipse version of Processor Expert has removed that limitation, but I keep the global interfaces for backward compatibility.

Component Folder

The component folder has the component interface(s), icon, properties, script and help files. This screenshot shows the content for the folder Beans\FreeRTOS:

FreeRTOS Component Folder

FreeRTOS Component Folder

    • *.bean: XML file describing the component properties. The property is what you see in the Component Inspector:

      FreeRTOS Properties in Inspector

      FreeRTOS Properties in Inspector

This post explains special settings in the *.bean file for RTOS components.

  • *.bean0, *.bean1 etc are backup files of the *.bean file.
  • *.bmp: Binary bitmap and source of the icon for the component. See CDE Hacking: Component Icon.
  • *.chg are CHG (Change) script files, executed when the user (or Processor Expert) changes a property.
  • *.html are HTML help files.
  • *.rtos is an XML file used as RTOS Adapter to describe such as memory allocation using an RTOS.
  • *.tps are XML files describing User Types and Globals which are used in properties.
  • *.uis is a normal text file listing all interfaces used.
  • *.ust are XML files describing User Property Types which are used in properties.
  • *.gif is a binary file produced from the .bmp file
  • *.dev is an XML file with a template for the component/interface. Templates are the ‘default’ settings of properties which are used at component creation time.
  • *.int is an XML file describing an interface between component. Interfaces describe the name and parameters of methods and events.

Note: Additionally I can add my own files (e.g. text files) to the folder. If I export the component, all the extra files will be exported too. Apart of this, these files are not under Component Wizard control.

Drivers Folder

So far the previous files are ‘description’ files. The most important things are in the ‘Drivers’ Folder:

Drivers Folder Content

Drivers Folder Content

  • The Common Folder contains *.inc include files which are included in the driver as ‘function’ header. See CDE Hacking: *.inc Files for more information.
  • The sw folder contains the driver file(s): they are used to generate the code.
  • It is possible that a component uses its custom folders. I recommend this for components which copy files or using a more complex structure. For this I maintain the RTOS files for example in the ‘Drivers\freeRTOS‘ folder. Such folders are not under Component Wizard control.
  • The *.src file is the main file of the driver, which actually includes the real driver from the sw folder: Example for FreeRTOS:
    %include sw\FreeRTOS.%DriverExtension
  • It is possible that the component is using its own files to include other files. I’m using *.prg files to include other files. These files are not under Component Wizard control.

Drivers\sw Folder

Drivers sw Folder

Drivers sw Folder

The Drivers\sw folder has the heart of the component: the driver files, all under Component Wizard control:

  • RTOSAdaptor: Folder with RTOS adapter specific files
  • *.drv: the driver code file
  • *.ts2: only used for RTOS adapter comonents, contains symbol definition
  • *.tst: test script file which is used to do consistency checks for component properties.

Summary

It is important to know the structure and purpose of all the different files. Yes, there are many, and they are important and interlocked. But after a while things get clear and easy to handle. The preferred way to manipulate the files is using the Component Wizard, but with the knowledge of this post there should be an easy start to understand the things behind Processor Expert components.

Happy Hacking 🙂

Advertisements

16 thoughts on “CDE Hacking: Where is my stuff? A dissection…

  1. Pingback: CDE Hacking: *.inc Files | MCU on Eclipse

  2. Pingback: CDE Hacking: Component Icon | MCU on Eclipse

  3. Pingback: CDE RTOS Hacking: Show it as an RTOS component | MCU on Eclipse

  4. Pingback: How to use MCUonEclipse GitHub without Git | MCU on Eclipse

  5. I can find any where to fit my question about the bean 24AA_EEPROMW, so I question here, may be have some related to.
    I look at in the code generated by PE, like method EE241_WriteByte(), at the end of method, it will call I2C2_SendStop(), but I connect the EE24 with bean of InternalI2C, it don’t have SendStop, but can “AutoStop”. so I have to changing the code of “24AA_EEPROM.drv”, and make a new property name “CanAutoStopOfI2C” to adapt to InternalI2C. this change can suit for my application.

    by now there is another problem, no mater the bean create by me or the original, the compiler complain:
    res = I2C2_SelectSlave(EE241_DEVICE_ADDR(addr));
    Error[Pe018]: expected a “)” D:\Kinetis\Kinetis.git\IAR_Freedom_FreeRTOS\Generated_Code\EE241.c 80
    I’m checking the source how to fixed it by now.

    Cai.

    Like

      • both IAR or Keil have same problem. I found IAR and Keil don’t understand :
        #define EE241_CTRL_NBL (0b1010<<3)
        may change to, that not compiler will complain,
        #define EE241_CTRL_NBL (0x0A<<3)

        Like

        • Now that makes it clear. ANSI does not allow 0b for binary data, and not every compiler allows this. I have this changed in the component to use the hex constant.

          Like

      • I make EE24 connect with InternalI2C, and InternalI2C don’t have SendStop() method, I2C2_SendBlock() have set LDD_I2C_SEND_STOP. So I need to disable execute I2C2_SendStop(), may be I2C2_SendStop() is for GenericI2C

        Like

        • Hello Cai,
          in the InternalI2C component, you need to set the ‘Automatic stop condition’ setting to ‘no’. Then SendStop() method is availble. Have you tried this?

          Like

  6. Pingback: DIY: Changing Processor Expert Components | MCU on Eclipse

  7. Pingback: Processor Expert Component Repositories | MCU on Eclipse

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.