There are plenty of different software packages available for microcontroller these days from all the silicon vendors. Finding a good software package is one challenge, getting what I really need is another one. Freescale is now part of NXP since December 2015, so this is probably the first release of the former Freescale part now as NXP: The NXP Kinetis SDK Version 2.0.
It comes with an interesting distribution way: instead of downloading huge packages with all-and-everything in it, I can build it ‘on demand’ online and get what I need, on demand from a web-based front end:
NXP provides a software driver library for their Kinetis ARM Cortex-M0 and M4 devices, the ‘Kinetis SDK’, available from http://www.nxp.com/ksdk.
I have used the v1.x SDK in a few projects already (see for example “Tutorial: FreeRTOS Projects with Kinetis SDK V1.3 and the SDK Project Generator“). As with similar complex software packages it needed some time to learn, and several aspects of it made it not very easy to use. From the 1.0 version of the SDK to the latest V1.3 more and more devices got added and the package has grown in size and complexity. The SDK V1.3 comes in an ‘all and everything’ package, with all the devices, IDE’s and operating systems supported. Finding my way through the different source file folders and versions was not easy for me. And for me as a FreeRTOS lover I always had to clean up and simplify the structure to make it easier to use in my classes, or to upgrade it to the latest and greatest FreeRTOS released.
So time to check the version 2 of the SDK right before the new university semester starts. The hope is that I might be able to turn around quickly and use the SDK 2.0 in the next semester course starting Feb 22nd.
There is an online/web version of the ‘Power Estimation’ tool which was already available as local installation.
For me the interesting part is the ‘Build an SDK’ button.
Build my own SDK!
Clicking on ‘Build an SDK’ guides me to a configuration dialog. So I have to first define one (of possible multiple) ‘configurations’. I select the board/device I’m interested in:
I can select either a package for a board or for a device. And I can have multiple configurations which I can manage here:
I was hoping I could use the SDK 2.0 with the FRDM-KL25Z board I use in class, and that board is supported in the SDK 1.3. But that board/device is not supported in v2.0 at least in the current version, I can only use the 1.3 😦
However the K64F is supported by the Kinetis SDK v2.0 :-).
I’m using FreeRTOS in the course. If you are using MQX, this is supported in the SDK v1.3:
This option goes away with the selection of SDK 2.0, and a community discussion about this:
But that’s not a problem for me as most of my projects are either bare metal or using FreeRTOS, with on exception using μCOS-II.
The concept is that I make my configuration (device/board, SDK, toolchain and host OS), and then ask for a tailored SDK package for it. Clicking on ‘Build SDK Package’ queues the package, and shortly afterwards I receive a notification that it is ready to download:
From the File Vault I can then download the file:
The files stay in the vault, so I can download it several times if I need it. Not sure if there is any file number or disk size limit. I had built up several packages without problems.
So I can build my custom package for a board/device and SDK. Compared to a +300 MByte download of the SDK V1.3, that download only has what I have selected, and is only a third of the size (102 MByte in above case). So I don’t get all the ‘noise’ for other devices, RTOS and tool chains I don’t need. On the down side if I want the SDK for multiple devices, I need to download multiple 100 MByte packages. On the other side: If I’m developing a project, that’s usually for one device, and I want to keep the SDK for it separate anyway. So while it sounds somewhat not ideal at the first sight, it indeed makes sense.
SDK Package File
What I really like is that the SDK is now a plain zip file: no setup executable, no installer, nothing setting up or changing environment variables. I really like that! So I can unpack the files where I want to have them, the way I want it.
From the file and folder structures it look like I even could combine two SDK v2.0 downloads (e.g K65 with K22) if needed. I think I would have to rename or merge the manifest file in the root folder as this is used by the Eclipse wizard (more about this later)). But probably I won’t need such a merge anyway.
Very positive news for all FreeRTOS lovers: finally the SDK is now using the latest FreeRTOS V8.2.3 (see “McuOnEclipse Components: 08-Nov-2015 Release“) :-). On the downside it does not include all the necessary changes to use the Segger System View on a Cortex-M4, so I have to patch it or directly use the Processor Expert port as it is has more functionality. The other downside is that the SDK v2.0 packages do not include Processor Expert support files: so using SDK v2.0 means I have to use the bare SDK, and there is no Processor Expert for it. That would mean rewrite a lot of the course content.
Importing Projects to Kinetis Design Studio
Next I wanted to use the SDK v2.0 with Eclipse. I’m using Kinetis Design Studio, but I’m confident it works the same for any Eclipse with the GNU ARM Eclipse plugins and the GNU for ARM Embedded (launchpad) tools. The package comes with example projects configured for the IDE I have selected for the package creation. I can import one or more into my Eclipse workspace with the menu File > Import > Existing Projects and point to the SDK folder:
It looks a bit odd to have the .launch files and linker (.ld) file in the root of the project folder. But it builds and debugs out-of-the-box:
It is very positive that the SDK v2.0 does not libraries with prepackaged drivers as in v1.x: building the project is now much easier and simpler.
Another very positive thing is that finally the directory structure has been greatly simplified: before there were directories needed for each driver. Now most of the sources and headers are in the
folder which makes things much simpler:
‘New Project Wizard’ with SDK v2.0 and Kinetis Design Studio
💡 The Kinetis Design Studio V3.2.0 already comes with that wizard integrated, see “NXP Kinetis Design Studio v3.2.0“
With the example projects inside the SDK the Kinetis Design Studio is well supported. But what if I want to create a SDK project for my special board, or start with a ’empty’ SDK project?
In the SDK v1.x it was necessary to do an Eclipse update from the
folder. Now there is in my view a better approach: an eclipse wizard which reads the SDK v2.x manifest file (<sdk2>\ksdk_manifest.xml). That way I don’t have to tell Eclipse about the SDK, Eclipse knows about the SDK :-).
For this the project wizard for Kinetis SDK v2.0 to be installed with the ‘Install New Software‘ menu in Eclipse:
Then I use the following update site:
With this I get the ‘New Kinetis SDK 2.x Project Wizard’:
Alternatively, the update is available for offline installation from the download section on http://www.nxp.com/kds (registration required):
After restarting Eclipse, it replaces it adds a new Wizard to Eclipse:
In the first dialog I have to select the SDK (that way it can support multiple SDK installations):
Then I can select the processor or board I want to use. It offers on the side options to include SDK drivers and/or RTOS to be included:
Very positive for me is that unlike the example projects of the SDK, this new project is using the files (copied) and not links to files (compare to the example screenshot earlier). That way it is much easier to understand where the files are, and are standalone: I could have the SDK folder removed, and my project is still able to build :-).
What is cool is now that this wizard works with the usual C and C++ Eclipse project wizards: That way if I use the ‘normal’ way to create an Eclipse project, I’m offered with the choice to create Kinetis project too.
That way I can create a C project or a project with C++ ‘nature’/settings (see “Processor Expert, gcc C++ and Kinetis-L with MQXLite“). File > New > Kinetis SDK v2.x Project creates already a project for C and C++. The example projects in the SDK are C only projects.
No Target Compiler Selection
Using that new wizard, the last page is something like this:
However, using the previous wizards I had a dialog where I was able to select the compiler I want to use:
I was wondering why does this selection not exist any more in the SDK V2.0?
There are two reasons I can think of:
- The compiler selection only makes sense if using Processor Expert, as with that option a Processor Expert (“Driver Suite”) project is generated (see “Tutorial: Using Kinetis Design Studio V3.0.0 with IAR and Keil IDE’s“).
- Because there is no Processor Expert for Kinetis SDK V2.0 any more, that dialog is not present neither.
So that would make sense now. If I would like to use the Kinetis SDK with IAR or Keil, then I would have to generate the SDK with the corresponding IDE’s selected (or all tool chains) and then use Keil MDK or IAR Embedded Workbench with it:
That Kinetis SDK v2.0 is a good evolution in most aspects to me: I can get a customized configuration for the board I need, and don’t have to dig through all the other available Kinetis devices. It is not a *complete* adoption of the SDK to my settings: the SDK sources are still ‘multi-tool-chain-multi-device’ ones. The generator basically filters out all the not-used-RTOS-drivers-and-IDE’s. So with using the SDK for one or two devices this is for sure a plus, and only few (except FAE’s?) would like to use a ‘full-blown-all-devices-with-every-compiler-and-IDE’ package. To me less is more and smaller is easier to use. The SDK directory structure is now much better: more the simple structure embedded developers are used to.
On the downside there is no MQX included in the SDK for anyone who is used to that RTOS. Bare-Metal, FreeRTOS and µC-OS are supported out of the box. I think it would be possible to continue to use the MQX from the SDK v1.3 with v2.0, it only would require some tweaking if necessary, at least for the ones who really need it? There are no Processor Expert components included in the SDK v2.0 which is a problem for my university course: I would have to rewrite most of the content of my course. I was hoping I could use the SDK v2.0 for the FRDM-KL25Z which is very popular and which I use in my course. With this I’m afraid that I cannot use the SDK 2.0 in my class, it is simply too much of a change. Maybe there will be an update for the FRDM-KL25Z and more of a continuation? On the Plus side: This new Eclipse wizard creates very good standalone projects as a starting point. The SDK directory and file structure are much cleaner and easier to use now. So I think the Kinetis SDK with these improvements is on the right track. Not for the semester course, but for other smaller or larger projects :-).