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.
The default Kinetis SDK web page is on http://nxp.com/ksdk, but there is an online site http://kex.nxp.com/ named ‘Kinetis Expert’ which is interesting. It allows me to build my SDK:
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 :-).
We wanted the best, but it turned out as always ;-))
Konstantin, it’s not hte international “wisdom”))). Are you succeed to download it?
Do i need separate download for each kinetis part?
By now I got : “Pending download approval” message after I’ve fulfilled the form. So i even cant dowanload that miracle))).
NXP…i missed Freescale a lot.
Not, Red LabelS ..“Pending download approval”…48 hours )))
Wow! Not nice…
Erich have you got the same issue before download? Or is it only for Russians?
no, I had no issues with downloading it. But I know that some devices (with encryption) are subject of export regulation. I had no issues to download the SDK for K64F, K22F and KL25Z.
yes, as I wrote, unfortunately I had to download the package for each board or device separately.
Thanks for response!
I should wait for new working weak. In the second part (wensday or thursday) if nothing will cahnge i will write to NXP service for details.
Anyway if somthing will change I’ll post a coment 🙂
P.S.: By now it soudns for me like they decided to go ST-way:(
May be even worse since ST has stmqubemx as initialiser tool and if ksdk not support pex anymore so there are no Init components too?
under the ‘Tools’ menu there are other tools, just not enabled yet. I think this is what you are looking for.
I had updated my Freescale Account to the NXP version last week already. From what I have seen in the system the accounts get migraged to NXP, so maybe this is the blocking thing on your side. Or maybe that ‘wrong country’ kind of thing 😦
You could give a try, go to the Preferences setting and change your location to China.
I can download all of the packages successfully with this setting.
I had a pop-up message asking to fill in additional user information/data. Have you completed that in your profile? It could be that without this data completed download will not be possible.
Yeah, i have fullfilled that additional info. And after thta i got the ” Pending download approval ” message on that place.
I’ve leved a feedback with the question on that site(left bottom corner) and waitting for answer from nxp. After i got it i’ll post here their response.
Thanks for your attention guys! Have a good day!
Finaly I’ve got that massege gone. We are discussing in the community thread.
By far there is no certain info about future politics vs “unwelcome” countries.
No MQX on new ksdk 2.0!!!?
It means that nxp abandons MQX?
MQX Software is still a supported software suite from NXP that is available in the MQX RTOS (Classic) and MQX for KSDK v1.3 products. New ports of MQX following the “Classic” architecture (i.e. similar style to MQX v4.x) will soon be available for newer Kinetis devices.
The Kinetis SDK v2 will focus on open-source RTOS solutions.
Really disappointed that PE support is missing, it really seems Kinetis is missing a consistent s/w strategy.
If you not read in the community by far-they will replace PEx by another tool that will be released soon.
FRDM-KL25Z will be added in late March release. See Community Post here for release schedule: freescale community docs/DOC-329783
I checked the current version SDK_2.0_MK22FX512xxx12 and SDK_2.0_MK22FX512Axxx12, do not work.
Pingback: Are ARM CMSIS-Pack the Future of Software Components? | MCU on Eclipse
I’m not using KDS, I’m using ARM toolchain in eclipse Kepler. Can I install the SDK 2.x project wizard in eclipse kepler?
I’m using it in Eclipse MARS.1, so it should work on Eclipse Kepler (or Juno) too.
Thanks for the answer but giving it a second thought I’m upgrading to MARS and just have one question. I was looking at the post on September 4, 2015 (https://mcuoneclipse.com/2015/09/04/going-to-mars-building-a-diy-eclipse-ide-for-arm-embedded-microcontrollers/) and I was wondering if I can substitute the part where you explain how to get the KSDK V1.3 and do the procedure in this post instead. Or do you recommend to do both?
that depends: if the device you are interested is supported in Kinetis SDK v2.0, then you only need that. Otherwise you have to (or should) install as well the SDK v1.3 plugin.
I’m trying to create a Kinetis SDK 2.x project with the wizard and after selecting the folder where I have the SDK 2.x (downloaded from the SDK creator website) the dialog gives me the error “Selected directory does not contain Kinetis SDK 2.x for KDS”. The path name does not have any spaces.
What could be happening?
I believe you have selected ‘GCC’ for your configuration on the Kinetis Expert web site, and not ‘KDS’. If you select GCC, it will not include KDS projects and KDS information, only bare gcc make files. Make sure you select KDS as IDE/Toolchain when you create your download.
I hope this helps,
You are absolutely right!! that was the problem.
🙂 🙂 🙂
Do you know what is the difference between “All Drivers”, “Minimal Set”, and “Empty” in the Select Drivers from the SDK 2.x Project Wizard?
with ’empty’ it only adds the startup code and no drivers. In ‘minimal’ it ads some drivers for at least a “hello world” style of project (clock, GPIO, and UART drivers). In ‘all’ it adds all SDK drivers to the project.
Pingback: Dealing with Code Size in Kinetis SDK v2.x Projects | MCU on Eclipse
Pingback: Solving “Launching: Configuring GDB Aborting Configuring GDB” | MCU on Eclipse
Pingback: Tutorial: Blinky with the FRDM-KL27Z and Kinetis SDK v2 | MCU on Eclipse
Pingback: NXP Kinetis Design Studio v3.2.0 | MCU on Eclipse
Pingback: McuOnEclipse Components: 3-Apr-2016 Release | MCU on Eclipse
Pingback: First steps: ARM Cortex-M7 and FreeRTOS on NXP TWR-KV58F220M | MCU on Eclipse
I tryed to create a new project with KSDK2.0 and KDS3.2.0. After creating a project with or withouth RTOS, I can open the components library and view the contents, however, I cannot add any items to my project. Am I misunderstanding something? Is the library not the SDK contents anymore? I used Processor Expert with Freescale CodeWarrior 10 about 1 year ago. Many things changed since then…
Thanks in advance for any hints…
not sure what you mean here with ‘library’? The archive file? As for adding files to the project: simply add them to the project with drag&drop.
As for the libary: for SDK V1.x you need to build parts of the SDK as library before you can use it. With the SDK V2.0 this is not necessary any more.
reading your comment again, I think I understand now what you mean: if you create a project for the SDK V2.0, then you cannot add Processor Expert components from the Processor Expert components library to the project.
Yes, if you create a project for the SDK V2.0, then you cannot use/add Processor Expert (mostly, at least, see https://mcuoneclipse.com/2016/01/29/first-nxp-kinetis-sdk-release-sdk-v2-0-with-on-demand-package-builder/). Depending on what you use (see https://mcuoneclipse.com/2015/10/18/overview-processor-expert/), you can use Processor Expert for non-SDK and for SDK V1.x projects. There is a trick (see https://mcuoneclipse.com/2016/05/15/mother-of-components-processor-expert-with-nxp-kinetis-sdk-v2-0-projects/) at least how I can re-use most of the components (as long as they do not depend on the hardware).
I hope this helps, and sorry for the confusion with my first answer,
HI Erich, thanks for your extensive reply. I also checked more of your tutorials with SDK2 and other resources. Is it really true, there is no graphical configuration tool for the “SDK items” or “components”? Using PEx made working so fast and easy. Overview, Configuration, Dependencies… missing this for the future will be a pain… but if PEx is not mainained anymore, over time it does not make much sense using it. 😦
my understanding is that Processor Expert will be still maintained for some period of time. But there won’t be any new features or new device support added.
Pingback: Tutorial: Blinky with Kinetis SDK V1.3 and Processor Expert | MCU on Eclipse
Pingback: Tutorial: RFID Tags with the NXP NFC Controller PN7120 and Eclipse | MCU on Eclipse
Pingback: NXP MCUXpresso Software and Tools with Clocks Tool | MCU on Eclipse
I’ve been using SDK for KL27Z256 for several days now. The project is based upon two previous versions that used the Processor Expert to initialize the peripherals and wrote my own drivers for the K22F and KL25.
My opinion? SDK is really bad. The documentation is terse. The examples are simplistic. The data types defined in the header do not follow the register naming convention that PE used that strictly followed the names in the reference manual. The TPM and other peripherals are not DMA supported–you have to manually set bits in registers. And once you’ve defined the register macros, why bother using the SDK? The drivers are bloated and simple things take up memory and stack space. After much struggle, I finally got DMA from SRAM to DAC working, but as soon as I try to enable another TPM, it falls apart. I don’t use any RTOS (I don’t like them) so I rely on managing interrupt vectors and priorities. SDK doesn’t make this easy. All in all, what would have taken a couple of hours with PE took me far longer, and without a successful result.
Perhaps the promised peripheral tool might help. But for me, it’s too late. I’m going to reconsider using NXP devices in my next design because of this crappy SDK.
Conclusion: ADD PE SUPPORT FOR KL27 AND ALL KINETIS PROCESSORS
Yes, I’m facing the same problem. That’s why I have started to have some wrapper around things like GPIO/etc. It will be probably a dead end, as I don’t think NXP will come back and add PE again. And that’s why I try to stick with PE supported devices.
At a minimum, it would be great if a header file such as IO_Map.h were provided as well. At least it would be easier to access registers.
the SDK 2.2 has this. For example all the KL25Z device registers are in \CMSIS\MKL25Z4.h.
Perhaps. But I’m using a KL27.
With the KL25 and PE, I was able to modify a register this way,
DMA_DSR_BCR0 |= 1u <DMA.DCR |= 1u << 30u;
To figure this out how took me a lot of time searching through cryptic header files. Not user-friendly.