MQX Eclipse Working Sets

Working Sets are a very useful feature in the Eclipse Framework (see Working Sets Explained). But: with a standard Eclipse distribution it is not possible to import or export working sets. The good news is: the AnyEdit plugins (see 5 Best Eclipse plugins) provides that missing functionality. The other good news is: Buried in the Freescale MQX 3.8 distribution for Eclipse CodeWarrior, there is an even better implementation for the Eclipse Working Sets.

About MQX

Freescale offers a complimentary version of MQX on http://www.freescale.com\mqx. It supports many Freescale 32bit processors and comes with RTOS, communication stacks and drivers. MQX has its origins at the Dy4 Systems from Ottawa/Canada. The technology want through several acquisitions, including Precise Software, ARC International and Embedded Access. Unlike other RTOS’es like FreeRTOS or uC-OS, MQX comes with the Kernel plus the drivers. While this is great on one end, it complicates things a lot. To simplify things in the Eclipse framework, the Freescale MQX team added Eclipse features to make things easier. Even if you do not plan to use the MQX operating system, that feature is very interesting: it comes with a really nice extension to the Eclipse Working Sets.

It solves a problem with MQX and Eclipse in general: MQX comes with many sub-projects  building the PSP (Processor Support Package) and the BSP (Board Support Package). Using MQX typically means selecting the correct PSP and BSP, each having multiple projects. Eclipse Subprojects greatly simplifies things dealing with that complexity, but does not help much with importing projects and subprojects. This is where the MQX Eclipse Working Set plugin comes to the rescue.

Installation

To install the plugin (well: MQX), I download MQX from http:\\www.freescale.com/mqx and install it. It will automatically detect your Eclipse CodeWarrior installation and installs the plugins. Kind of. MQX 3.8.0 only supports MCU10.1 as at the time of MQX 3.8 the new MCU10.2 was not released yet:

MQX 3.8.0 Installer for MCU10.1

MQX 3.8.0 Installer for MCU10.1

But there is a solution to this: To install the MQX 3.8 plugins into MCU10.2, this link provides batch files to install/uninstall the plugins. I install the plugins with this command line:

install_cw10.2_plugin.bat "c:\Freescale\CW MCU v10.2"

Note: It is important to quote the path to Eclipse CodeWarrior as it could contain spaces in the path.

Another (better) way is to download the Freescale MQX RTOS 3.8 for TWR-PXS3020: this file is only around 65 MByte and supports both MCU10.1 and MCU10.2:

Installing MQX TWRPXS30

Installing MQX TWRPXS30

The MQX TWRPXS30 installation is a better choice as well because it offers an additional toolbar item to build a working set:

Build Working Set Toolbar Item

Build Working Set Toolbar Item

Importing and Exporting Working Sets

The plugin adds an import and export wizard:

MQX import/export Working Sets

MQX import/export Working Sets

Importing exported Working Sets works as well with drag&drop: I simply drag&drop a *.wsd file into the Eclipse workbench:

Drag&Drop of WSD file

Drag&Drop of WSD file

That Importer does not only import the Working Set, it imports the projects as well. Wow, this is way cool! This does multiple things in one step: importing the Working Set, and importing all the projects too:

Imported projects

Imported projects

Beside of the projects, it has imported as well the Working Set:

Imported Working Set

Imported Working Set

Exporting the Working Sets is performed with the menu File > Export > Other > Export Working Sets. In addition to the destination file I need to specify ‘Projects relative to path’. This ensures that all the projects are relative to a given location:

Export Working Set

Export Working Set

Warning: There seems to be a bug in the Export wizard: if your Working Set has a closed project, then the Export Wizard will not allow you to finish or to save the file. As a consequence: Import/Export only works with OPEN projects.

Dissection of the .wsd File

The .wsd (Working Set Description?) files are XML files describing the working sets and project dependencies. Below is the example .wsd file found in

C:\Freescale\Freescale MQX 3.8\config\twrmcf51mm\cw10\twrmcf51mm.wsd

has following content:

<?xml version="1.0" encoding="UTF-8"?>

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="workingsets.xsd">
  <projects>
    <project>
      <name>bsp_twrmcf51mm</name>
      <path>..\..\..\mqx\build\cw10\bsp_twrmcf51mm</path>
      <open>true</open>
      <activeconfig>Debug</activeconfig>
      <buildreferences config="Debug">false
      <buildreferences config="Release">false
    </project>
    <project>
      <name>mfs_twrmcf51mm</name>
      <path>..\..\..\mfs\build\cw10\mfs_twrmcf51mm</path>
      <open>true</open>
      <reference>bsp_twrmcf51mm</reference>
      <reference>psp_twrmcf51mm</reference>
      <activeconfig>Debug</activeconfig>
      <buildreferences config="Debug">false
      <buildreferences config="Release">false
    </project>
    <project>
      <name>psp_twrmcf51mm</name>
      <path>..\..\..\mqx\build\cw10\psp_twrmcf51mm</path>
      <open>true</open>
      <activeconfig>Debug</activeconfig>
      <buildreferences config="Debug">false
      <buildreferences config="Release">false
    </project>
    <project>
      <name>rtcs_twrmcf51mm</name>
      <path>..\..\..\rtcs\build\cw10\rtcs_twrmcf51mm</path>
      <open>true</open>
      <reference>bsp_twrmcf51mm</reference>
      <reference>mfs_twrmcf51mm</reference>
      <reference>psp_twrmcf51mm</reference>
      <activeconfig>Debug</activeconfig>
      <buildreferences config="Debug">false
      <buildreferences config="Release">false
    </project>
    <project>
      <name>shell_twrmcf51mm</name>
      <path>..\..\..\shell\build\cw10\shell_twrmcf51mm</path>
      <open>true</open>
      <reference>bsp_twrmcf51mm</reference>
      <reference>mfs_twrmcf51mm</reference>
      <reference>psp_twrmcf51mm</reference>
      <reference>rtcs_twrmcf51mm</reference>
      <activeconfig>Debug</activeconfig>
      <buildreferences config="Debug">false
      <buildreferences config="Release">false
    </project>
    <project>
      <name>usb_ddk_twrmcf51mm</name>
      <path>..\..\..\usb\device\build\cw10\usb_ddk_twrmcf51mm</path>
      <open>true</open>
      <reference>bsp_twrmcf51mm</reference>
      <reference>mfs_twrmcf51mm</reference>
      <reference>psp_twrmcf51mm</reference>
      <activeconfig>Debug</activeconfig>
      <buildreferences config="Debug">false
      <buildreferences config="Release">false
    </project>
    <project>
      <name>usb_hdk_twrmcf51mm</name>
      <path>..\..\..\usb\host\build\cw10\usb_hdk_twrmcf51mm</path>
      <open>true</open>
      <reference>bsp_twrmcf51mm</reference>
      <reference>mfs_twrmcf51mm</reference>
      <reference>psp_twrmcf51mm</reference>
      <activeconfig>Debug</activeconfig>
      <buildreferences config="Debug">false
      <buildreferences config="Release">false
    </project>
  </projects>
  <workingsets>
    <workingSet editPageId="org.eclipse.cdt.ui.CElementWorkingSetPage" id="1323268527287_1" label="twrmcf51mm" name="twrmcf51mm">
      <item factoryID="org.eclipse.cdt.ui.PersistableCElementFactory" path="/bsp_twrmcf51mm" type="4"/>
      <item factoryID="org.eclipse.cdt.ui.PersistableCElementFactory" path="/psp_twrmcf51mm" type="4"/>
      <item factoryID="org.eclipse.cdt.ui.PersistableCElementFactory" path="/rtcs_twrmcf51mm" type="4"/>
      <item factoryID="org.eclipse.cdt.ui.PersistableCElementFactory" path="/mfs_twrmcf51mm" type="4"/>
      <item factoryID="org.eclipse.cdt.ui.PersistableCElementFactory" path="/shell_twrmcf51mm" type="4"/>
      <item factoryID="org.eclipse.cdt.ui.PersistableCElementFactory" path="/usb_ddk_twrmcf51mm" type="4"/>
      <item factoryID="org.eclipse.cdt.ui.PersistableCElementFactory" path="/usb_hdk_twrmcf51mm" type="4"/>
    <!--<span class="hiddenSpellError" pre=""-->workingSet>
  </workingsets>
  <cdtconfigurations>
    <workingSet name="twrmcf51mm">
      <config name="Release">
        <project config="com.freescale.coldfire.toolchain.configuration.895204208" name="psp_twrmcf51mm" configName="Release"/>
        <project config="com.freescale.coldfire.toolchain.configuration.895204208" name="mfs_twrmcf51mm" configName="Release"/>
        <project config="com.freescale.coldfire.toolchain.configuration.895204208" name="rtcs_twrmcf51mm" configName="Release"/>
        <project config="com.freescale.coldfire.toolchain.configuration.895204208" name="bsp_twrmcf51mm" configName="Release"/>
        <project config="com.freescale.coldfire.toolchain.configuration.895204208" name="shell_twrmcf51mm" configName="Release"/>
        <project config="com.freescale.coldfire.toolchain.configuration.895204208" name="usb_ddk_twrmcf51mm" configName="Release"/>
        <project config="com.freescale.coldfire.toolchain.configuration.895204208" name="usb_hdk_twrmcf51mm" configName="Release"/>
      </config>
      <config name="Debug">
        <project config="com.freescale.coldfire.toolchain.configuration.1095006444" name="psp_twrmcf51mm" configName="Debug"/>
        <project config="com.freescale.coldfire.toolchain.configuration.1095006444" name="mfs_twrmcf51mm" configName="Debug"/>
        <project config="com.freescale.coldfire.toolchain.configuration.1095006444" name="rtcs_twrmcf51mm" configName="Debug"/>
        <project config="com.freescale.coldfire.toolchain.configuration.1095006444" name="bsp_twrmcf51mm" configName="Debug"/>
        <project config="com.freescale.coldfire.toolchain.configuration.1095006444" name="shell_twrmcf51mm" configName="Debug"/>
        <project config="com.freescale.coldfire.toolchain.configuration.1095006444" name="usb_ddk_twrmcf51mm" configName="Debug"/>
        <project config="com.freescale.coldfire.toolchain.configuration.1095006444" name="usb_hdk_twrmcf51mm" configName="Debug"/>
      </config>
    <!--<span class="hiddenSpellError" pre=""-->workingSet>
  </cdtconfigurations>
</workspace>

The XML file lists first all the projects within <project>…</project>:

    <project>
      <name>bsp_twrmcf51mm</name>
      <path>..\..\..\mqx\build\cw10\bsp_twrmcf51mm</path>
      <open>true</open>
      <activeconfig>Debug</activeconfig>
      <buildreferences config="Debug">false</buildreferences>
      <buildreferences config="Release">false</buildreferences>
    </project>
  • <name>: name of the project
  • <path>: relative path of the project, relative to the path specified in the Export wizard
  • <open>: if the project is in open state or not (true or false)
  • <activeconfig>: which is the active build configuration
  • <buildreferences…>: list of build configurations

Thelists the Working Sets they are set up:

  <workingsets>
    <workingSet editPageId="org.eclipse.cdt.ui.CElementWorkingSetPage" id="1323268527287_1" label="twrmcf51mm" name="twrmcf51mm">
      <item factoryID="org.eclipse.cdt.ui.PersistableCElementFactory" path="/bsp_twrmcf51mm" type="4"/>
      <item factoryID="org.eclipse.cdt.ui.PersistableCElementFactory" path="/psp_twrmcf51mm" type="4"/>
      <item factoryID="org.eclipse.cdt.ui.PersistableCElementFactory" path="/rtcs_twrmcf51mm" type="4"/>
      <item factoryID="org.eclipse.cdt.ui.PersistableCElementFactory" path="/mfs_twrmcf51mm" type="4"/>
      <item factoryID="org.eclipse.cdt.ui.PersistableCElementFactory" path="/shell_twrmcf51mm" type="4"/>
      <item factoryID="org.eclipse.cdt.ui.PersistableCElementFactory" path="/usb_ddk_twrmcf51mm" type="4"/>
      <item factoryID="org.eclipse.cdt.ui.PersistableCElementFactory" path="/usb_hdk_twrmcf51mm" type="4"/>
    </workingSet>
  </workingsets>

A very interesting part is the block with <cdtconfigurations>:

  <cdtconfigurations>
    <workingSet name="twrmcf51mm">
      <config name="Release">
        <project config="com.freescale.coldfire.toolchain.configuration.895204208" name="psp_twrmcf51mm" configName="Release"/>
        <project config="com.freescale.coldfire.toolchain.configuration.895204208" name="mfs_twrmcf51mm" configName="Release"/>
        <project config="com.freescale.coldfire.toolchain.configuration.895204208" name="rtcs_twrmcf51mm" configName="Release"/>
        <project config="com.freescale.coldfire.toolchain.configuration.895204208" name="bsp_twrmcf51mm" configName="Release"/>
        <project config="com.freescale.coldfire.toolchain.configuration.895204208" name="shell_twrmcf51mm" configName="Release"/>
        <project config="com.freescale.coldfire.toolchain.configuration.895204208" name="usb_ddk_twrmcf51mm" configName="Release"/>
        <project config="com.freescale.coldfire.toolchain.configuration.895204208" name="usb_hdk_twrmcf51mm" configName="Release"/>
      </config>
      <config name="Debug">
        <project config="com.freescale.coldfire.toolchain.configuration.1095006444" name="psp_twrmcf51mm" configName="Debug"/>
        <project config="com.freescale.coldfire.toolchain.configuration.1095006444" name="mfs_twrmcf51mm" configName="Debug"/>
        <project config="com.freescale.coldfire.toolchain.configuration.1095006444" name="rtcs_twrmcf51mm" configName="Debug"/>
        <project config="com.freescale.coldfire.toolchain.configuration.1095006444" name="bsp_twrmcf51mm" configName="Debug"/>
        <project config="com.freescale.coldfire.toolchain.configuration.1095006444" name="shell_twrmcf51mm" configName="Debug"/>
        <project config="com.freescale.coldfire.toolchain.configuration.1095006444" name="usb_ddk_twrmcf51mm" configName="Debug"/>
        <project config="com.freescale.coldfire.toolchain.configuration.1095006444" name="usb_hdk_twrmcf51mm" configName="Debug"/>
      </config>
    </workingSet>
  </cdtconfigurations>

This specifies what belongs to a build configuration for the Working Sets. This is what I can see from the additional toolbar item which is installed by the plugin:

Build Working Set Toolbar Item

Build Working Set Toolbar Item

I was not able to get this kind of information set up except with modifying the XML file directly. Additionally if I export my working sets, that information is not exported neither. So I assume that this is either something missing, or subject of a future release.

Summary

The Working Set extensions delivered with Freescale MQX is a great add-on. It simplifies importing large sets of projects, and it has built in build configuration settings. For now it requires a rather large MQX download to get that plugin. It would be good if this could be available as separate download. And it would be really cool if the CDT build configuration part could be edited or changed outside the XML file.

So even if you are not considering to use the MQX Operating system and drivers with Eclipse CodeWarrior, that Working Set plugin is a great add-on.

Happy MQXing 🙂

1 thought on “MQX Eclipse Working Sets

  1. Pingback: Fixing the Morpho Core Exception | 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 )

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.