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.
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:
Because I cannot use (say copy) that path here, the same path is reported in the Console View too:
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:
If I go up one level (in my case: C:\ProgramData\Processor Expert), then I have following 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:
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.
The Beans folder inside the ‘User Working Directory’ contains a folder for each Component (I have more than 100 :-), many are published here):
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.
The component folder has the component interface(s), icon, properties, script and help files. This screenshot shows the content for the folder Beans\FreeRTOS:
- *.bean: XML file describing the component properties. The property is what you see in the Component 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.
So far the previous files are ‘description’ files. The most important things are in the ‘Drivers’ Folder:
- 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:
- 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.
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.
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 🙂