MCUXpresso: Importing Kinetis Design Studio Projects
The MCUXpresso IDE makes it easy to improt Kinetis Design Studio projects. Even better, you get updated features and toolchains to use on your work.
Join the DZone community and get the full member experience.Join For Free
Many of my currently active projects are using Kinetis Design Studio (KDS) V3.2.0 from NXP (I have published many of my projects on GitHub). Now with the advent of the MCUXpresso IDE (see MCUXpresso IDE: Unified Eclipse IDE for NXPs ARM Cortex-M Microcontrollers), I have migrated several projects from KDS to MCUXpresso. This post is about how to easily get KDS projects ported and running in MCUXpresso IDE.
This article is part of a series to get up to speed using the new NXP MCUXpresso IDE. Published so far are:
- MCUXpresso IDE: Unified Eclipse IDE for NXPs ARM Cortex-M Microcontrollers
- MCUXpresso IDE: S-Record, Intel Hex, and Binary Files
- MCUXpresso IDE: Adding the Eclipse Marketplace Client
MCUXpresso uses the newer (Neon) Eclipse IDE than KDS (Luna) with a different build system: MCUXpresso IDE is using the same build system and integration as LPCXpresso, while KDS is using the GNU ARM Eclipse plugins. Both approaches have their pros and cons (as always). Plus, MCUXpresso does not include Processor Expert, but KDS does. To migrate and use KDS projects with the MCUXpresso IDE, there are the following basic approaches:
- Importing KDS (non-Processor Expert) projects: For this, the GNU ARM Eclipse plugins need to be installed, along with the GNU ARM Eclipse build tools. This allows us to use KDS projects as in KDS, but with the extra functionalities of MCUXpresso.
- Importing Processor Expert projects: Same as above, but this needs the installation of Processor Expert plugins, too. That way, I can continue to use Processor Expert projects as in KDS, but keep in mind that NXP does not offer newer device support for Processor Expert.
- Porting KDS projects to MCUXpresso IDE: This means migrating a KDS project to the MCUXpresso build system. This is a fairly simple approach, basically creating a new project in MCUXpresso and moving the files over.
In general I follow the approach not to switch IDEs or toolchains for projects. Migrating or porting a project only makes sense when it is really necessary. I do have many projects I keep maintained in older toolchains like CodeWarrior, and I only migrate projects that I continue to develop and evolve.
Because it is too much to describe everything in one post, I focus on approach 1 in this article.
At the time of this article, I’m using the following software:
- KDS projects using Kinetis Design Studio V3.2.0
- MCUXpresso IDE V10.0.0 build 344
- GNU ARM Embedded Toolchain v6-2017-q1
- GNU ARM Eclipse Build tools v2.8-201611221915
- GNU ARM Eclipse plugins v3.3.1-201702251311
I’m using Windows as my host, but similar steps apply to Mac and Linux hosts. I’m assuming you already have Kinetis Design Studio V3.2.0 installed. If not, the steps below install everything you need to use Kinetis Design Studio projects in MCUXpresso, and you don’t need KDS V3.2.0 installed (e.g. if you downloaded a project from somewhere).
Note that tutorial does not include the installation of Processor Expert into MCUXpresso IDE: This is the subject of a future article.
GNU ARM Embedded Toolchain
KDS has pre-installed the GNU ARM Embedded Toolchain. While it would be possible to use that same version, I’m using the latest version from https://launchpad.net/gcc-arm-embedded, which is the 6-2017-q1-update I can get from https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads:
I recommend downloading the installer and running the setup with the default settings:
On Windows, I need to install other build tools that are already part of Kinetis Design Studio (inside the <kds>\bin folder).
Follow the instructions at http://gnuarmeclipse.github.io/windows-build-tools/install/ and download the latest setup from https://github.com/gnuarmeclipse/windows-build-tools/releases, then run the setup with the default settings:
GNU ARM Eclipse Plugins
To have the build tools working in Eclipse, I need to install the GNU ARM Eclipse plugins. Otherwise, KDS projects in MCUXpresso IDE will show an error message similar to the one below:
Orphaned configuration. No base extension cfg exists for ilg.gnuarmeclipse.managedbuild.cross.config.elf.debug.1376620489
Basically, it means that the project (.cproject file) needs the ilg.gnuarmeclipse.managedbuild.cross.config.elf build plugin/integration, which is not installed by default in MCUXpresso. The general process is described in http://gnuarmeclipse.github.io/install/.
To install the plugins, I have two ways:
- Eclipse Marketplace (preferred)
- Install new software
With the Eclipse Marketplace, you need that plugin installed (see MCUXpresso IDE: Adding the Eclipse Marketplace Client), then use the menu: Help > Eclipse Marketplace:
Search for the plugin and install it:
I recommend you install all plugins. That way, it is possible to create and debug any ARM Cortex-M projects (beyond NXP):
If you are running into a ‘handshake’ problem, then there is a problem with the security settings to get access to SourceForge (see this link).
In that case, I recommend downloading a ZIP file as described in the next step.
I can use the menu Help > Install New Software and point to the following update site:
But beware that this might not work because SourceForge has recently changed the security settings (see this link). Instead, I recommend downloading the ZIP file from here. Use that ZIP file in the dialog accessible by Help > Install New Software:
I can drag and drop the ZIP file into the dialog.
NOTE: Be warned! I recommend to *copy* the projects, and *not* to try to use with MCUXpresso and KDS in parallel. MCUXpresso is using a newer Eclipse, but while it *might* work to open that project afterwards in KDS again, it is certainly not something I would like to do. So make a copy/backups of the project before importing (and changing) it in MCUXpresso! Likewise, you should NEVER share a workspace folder with different Eclipse versions.
With this, I have everything I need to import, build, and debug Kinetis Design Studio V3.2.0 projects! There are multiple ways to import projects. The easiest one is to use the Quickstart panel and use ‘Import project(s) from file system…’:
Alternatively use the normal Eclipse way using the menu File > Import > General > Existing Projects into Workspace
Then browse to the folder or use the ZIP archive:
Then go through the dialog to import the project(s).
With the installed plugins and software in the previous steps, everything should be in place to build and debug the imported projects. Here are a few things to verify and check if everything is configured correctly.
Use the ‘edit project settings’ menu in the Quickstart panel (or use the menu Project > Settings):
Opening the project properties, the settings should show up as in KDS:
There is a small glitch in the Quickstart menu action where it might show only the ‘Error Parsers’. In that case, use the ‘left’ icon to get to the left side of the panels:
The toolchain shall show up as ‘GNU Tools for ARM Embedded Processors‘ in the project settings:
The GNU ARM Eclipse plugins allow a very flexible and powerful toolchain configuration (up to separate toolchains for each project). Below are the workspace settings (menu Window > Preferences). It specifies which toolchain and build tools are used, and it shows where I have installed them in the previous steps:
I’m using here *different* (newer) build tools and tool chain than what is installed in KDS v3.2.0! If you have KDS installed, and if you want to use the same toolchain, then you can configure that in that dialog.
MCUXpresso has an extra setting in the project to specify the microcontroller used. Because that project has been created outside the MCUXpresso IDE, the MCU is not correctly assigned. This setting is not important for building it with the GNU ARM tools, but it is needed if I want to use other advanced MCUXpresso IDE settings like automatic probe discovery (more about this later).
I recommend going to the C/C++ Build > MCU settings and assigning the correct MCU used in that project:
However, I need the MCUXpresso SDK (see MCUXpresso IDE: Unified Eclipse IDE for NXPs ARM Cortex-M Microcontrollers) installed for that MCU!
I recommend having the SDK installed. Otherwise (and if there is no SDK for the MCU used in the project), I recommend you set a matching ‘generic’ MCU from the preinstalled MCUs
With this, everything is set up to build and debug!
An important step after importing projects is to get rid of any old files with a ‘clean’. The easiest way is to use the ‘clean’ in the Quickstart panel (or use the menu Project > Clean):
Yet again, use the Quickstart panel to build the project (or use the menu Project > Build):
This should build the project without errors (as in KDS).
KDS projects use normal Eclipse launch configuration files and settings. The launch files are usually stored in a ‘settings’ folder inside the project:
MCUXpresso, on the other hand, is able to detect debug probes automatically and create and manage the launch configurations (see MCUXpresso IDE: Unified Eclipse IDE for NXPs ARM Cortex-M Microcontrollers).
I can continue to use the launch configurations in the project, the same way as in KDS. I can check them using the Debug Configurations menu:
The screenshot below shows some debug configurations in my workspace:
Compared to KDS, there is a group on the top for launch configurations for the LPC-Link/LPC-Link2 debug connection.
Because the debug plugin for P&E is the same (provided by P&E), the group combines both imported KDS and MCUXpresso configurations.
Notice that there are two groups for the Segger debug plugin: One for MCUXpresso and one for the GNU ARM Eclipse Segger plugin we installed in one of the previous steps. The one on the bottom is exactly the one you know from KDS.
If you compare the features and responsiveness of the GNU ARM Eclipse SEGGER plugin and the one installed with the GNU ARM Eclipse plugins, then you might like the one from GNU ARM Eclipse more, especially as it provides more detailed settings. The good thing is that by installing the GNU ARM Eclipse plugins, you can use them for any project. However, it won’t work with the MCUXpresso automatic probe detection.
You can determine which Segger J-Link binaries are used by the GNU ARM Eclipse debugger plugin in a setting behind the menu Window > Preferences > Run/Debug > SEGGER J-Link:
Verify the folder settings or use the ‘Restore Defaults’ folder if you have updated the SEGGER files.
With this, I can debug my KDS project in MCUXpresso IDE:
Using MCUXpresso Probe Detection
One benefit of the ‘combined’ IDE and plugins is that now I can use the extra features of MCUXpresso for my imported project. And one of it is the automatic probe detection (see MCUXpresso IDE: Unified Eclipse IDE for NXPs ARM Cortex-M Microcontrollers). For this, I launch the debugger with the blue debug icon (instead of the normal green one):
If you get a dialog about “No MCU associated with this project. Please select an MCU before continuing,” then check the section “MCU Settings” from above: It means that the project settings have no MCU assigned.
Otherwise, I get the automatic probe discovery dialog:
And then it will create the selected debug connection/configuration, and I can debug with it.
To re-trigger the automatic probe discovery, a simple method is to remove the created launch configurations (but then I will lose any custom settings I have made):
The presented approach even works with Processor Expert projects, only that you won’t be able to generate Processor Expert code with it. So as long you have generated code in the KDS project, you can import it as any normal project using the above approach.
As for how you could continue to use Processor Expert projects in MCUXpresso and fully use Processor Expert as in KDS, that's the subject of a future article.
I can easily import existing Kinetis Design Studio (KDS) projects. By installing the toolchain (if not already installed) plus the GNU ARM Eclipse plugins in the MCUXpresso IDE, I can build and debug existing KDS projects without any porting effort or any project conversion: They simply work. Compared with the original KDS, I have a newer Eclipse, the latest toolchain, and can use the extra features offered in MCUXpresso. I have this working with several existing KDS projects, and it works very well — to the point that I might leave KDS behind and continue to use all KDS projects with the MCUXpresso IDE.
What I have not covered in this article is how to get Processor Expert running in MCUXpresso IDE, or how to switch the toolchain/project from KDS to the native MCUXpresso one. So this next on my list of things. I hope that what I was able to write up is already useful for you.
Published at DZone with permission of Erich Styger, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.