As time flies by, my projects are evolving. My lab projects get used over multiple semesters, and the MCUXpresso projects by default use the SDK version used at that time.
This is great because I do want to have control over what SDK is used. But from time to time it makes sense to upgrade a project to a newer version. In this post I’ll show how an existing project can be upgraded to use a new SDK.
First: make a backup of your project. I’m using git (which I recommend to everyone) for this. While things work pretty well for me migrating SDKs recently, it might not be the case for a particular (old) SDK.
In general it is not necessary to upgrade a project. But if I want to take advantage from latest bug fixes or features it makes sense. And in a class room environment I can be on the same latest and greatest SDK as my students are using. The other reason for upgrading is if (for whatever reason) the zip file for that old SDK is not available, but there is a newer version installed.
So here is my case: I do have an existing project on SDK v2.8.2 and I do want to upgrade it to the v2.9.0 version:
To make projects work without an SDK installed, I usually have ‘Part support’ added: that way for example the debugger has all the needed information. As a first step I remove the existing part support (if any) to have it clean:
Next I do ‘Refresh SDK Components’:
This will show a dialog about the updated/added files. Press Yes.
Now it should show that the SDK version has been upgraded:
So far so good.
The next thing would be an attempt to compile the project. This might fail because most likely the SDK could have changed files as below:
As in the case above, the names have changed for a reason. However, the ‘Refresh SDK’ action somehow has not changed them too. So I do it manually: I delete the old files and now I’m able to build the project:
Next I re-add SDK Part support:
Next I do open the Configuration tools:
This triggers a dialog informing me that new data gets loaded which is fine:
Then make sure to update the code:
Confirm to update the code and you shall be all set :-).
Well, only if there are no API changes in the SDK. Luckily, the SDK has been stabilized the past year very much, so chances are high that things will just compile by now.
Now what is new in this new SDK? If using git with Eclipse very easy to make a compare:
Upgrading to a newer SDK Version is possible and can make sense (of course depends on the needs). Migrating a project which is still in development makes sense and with the above steps it is doable at least with minimal efforts. At least I’m doing this for my many class and lab projects and this worked fine so far.
Happy Upgrading 🙂