Introduction
The Microcontroller Development Kit (MDK) provides basic device support such as register header files, startup files and errata workarounds. Every release of the nRF5 SDK contains the latest version of the MDK at the time of release, but what happens if a new errata is discovered or if you need support for a new SoC revision? You should then upgrade your projects to use a newer MDK release. This guide explains how to do so for Keil µVision 5.
Getting the new MDK
For Keil µVision 5 you find the MDK in the Pack Installer, under the name nRF_DeviceFamilyPack.
Alternatively you can download MDK releases from the nRF MDK download page, as for other toolchains supported by the nRF5 SDK. First select the wanted toolchain/license combination from the dropdown. For Keil uVision 5 use "Pack". By default you are offered the latest MDK release (which is recommended,) but if for some reason you need a specific version you can select it from the radio buttons further down on the page.
Installing the MDK
- Install the pack,
- Either directly through the Pack Installer
- Or by running the .pack file downloaded from the nRF MDK download page.
- Either directly through the Pack Installer
Upgrading a project
- From the Build Toolbar, open the "Select Software Packs..." window.
Select the new version of the nRF_DeviceFamilyPack component.
Click "OK" to confirm and close the window. - From the Project pane, right click the "Device" component and open the "Options for Component Class 'Device'" window.
Select the new version of the component from the "Version" drop down list. (If it is already selected, do nothing.)
Click "OK" to confirm and close the window. - From the Project pane, right click the target folder (e.g. nrf52840_xxaa) and open the "Options for Target 'target name'..." window.
Go to the "C/C++" pane, and open the Include Paths" dialog box (the "..." button to the right of the entry.)
- For nRF5 SDK 14.2.0 and older, remove the path ending in
\components\toolchain
- For nRF5 SDK 15.0.0 to 17.0.2, remove the path ending in
\modules\nrfx\mdk
- For nRF5 SDK 14.2.0 and older, remove the path ending in
- On the Project pane, if Device and some or all of the files under Device has a red circle with a white x in the icon, those files of the pack must be updated.
Right click on the files in need of an update, and select the "Update Config File" option in the pop-up menu. - Recompile the project
Please note: You may experience that the startup c file in the Device component is from the newest (highest numbered) version of the nRF_DeviceFamilyPack on the system, while the header files are from the selected version. This is a known issue. The workaround is to make sure the pack selected in the project is the same as the highest numbered pack version installed on the system.