XML Editor & Checker for CMSIS-Pack in Eclipse

So far, the XML files I had to work on were very simple ones, so a normal text editor was fine. Now I’m tapping into the world of CMSIS-Packs (see “Are ARM CMSIS-Pack the Future of Software Components?“). And definitely this adds a complexity for which I better use some XML editing and checking tools. The ARM tutorial for CMSIS recommends either Notepad++ or Visual C++. But hey, Eclipse should be able to do that maybe even better right? So this is about adding an XML editor and XML checker to Eclipse.

Editing CMSIS-Pack .pdsc File in Eclipse

Editing CMSIS-Pack .pdsc File in Eclipse

Outline

In this post I describe how to add an editor to edit and verify XML files. I use that for ARM CMSIS-Pack XML files with NXP Kinetis Design Studio, but the steps are applicable to any Eclipse or any kind of XML editing.

Adding XML Editor to Eclipse

I’m using Eclipse Mars and Luna. The easiest way to get XML capabilities is to to install the “Eclipse XML Editors and Tools“. Use the standard Eclipse update site (e.g. luna or mars) for your Eclipse distribution. The XML editor is under ‘Programming Languages’. Screenshot shown for NXP Kinetis Design Studio (Luna based):

💡 You can filter the entries for ‘xml’ as I did in the screenshot below.

Eclipse XML Editors and Tools

Eclipse XML Editors and Tools

Then go through the installation process with ‘Next >’.

CMSIS-Packs

Make sure you have the PACK.xsd (XML Schema Definition) file present in the root of the pack:

CMSIS-Pack XML Schema Definition File

CMSIS-Pack XML Schema Definition File

The PACK.xsd file is part of ‘CMSIS’ Pack and e.g. can be found here (using version 4.5.0 inside the Keil installation:

<Keil MDK>\ARM\Pack\ARM\CMSIS\4.5.0\CMSIS\Utilities

Or the place where you have installed the packs with the GNU ARM Eclipse Pack manager:

CMSIS Core Pack Installed

CMSIS Core Pack Installed

With the XML editor installed I can double-click on that .xsd file and get a nice schema definition viewer:

XSD Viewer in Eclipse

XSD Viewer in Eclipse

Trying to do the same with the .pdsc gives me this dialog as the extension is not a usual XML file extension:

pdsc is not a supported XML extension

pdsc is not a supported XML extension

Clicking on that link in the dialog gives me a dialog where I can add the *.pdsc extension to be handled as XML:

Adding extension

Adding extension

Next I have to add as well a file association:

Added File Association

Added File Association

Now I can directly use the XML editor for CMSIS-Pack .pdsc files:

Added File Association

Added File Association

Now I have a graphical editor for my file: I can switch between the ‘Design’ and ‘Source’ view:

Editing CMSIS Pack File with Eclipse XML Editor

Editing CMSIS Pack File with Eclipse XML Editor

And best of all: I can now validate my XML files with the Schema Definition File (*.xsd):

Validating XML File

Validating XML File

And it shows me that I have problem with my XML file (ups!):

Identified Schema Error

Identified Schema Error

So next I have to fix that issue…..

Summary

Eclipse is a very versatile IDE and environment: for pretty much everything you can imagine there is a plugin. Of course as well for something for XML editing. The XML support is not included in the normal Eclipse CDT distribution for C/C++ development, but can be easily added. That way I can now produce better CMSIS-Pack files :-).

Happy XMLing 🙂

1 thought on “XML Editor & Checker for CMSIS-Pack in Eclipse

  1. Pingback: Are ARM CMSIS-Pack the Future of Software Components? | 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.