Using Keil μVision 5 with Processor Expert

I happily used the Keil v4.71.2.0 μVision tools for a few small projects (see “Using Keil µVision (ARM-MDK) with Processor Expert Driver Suite“) with the ‘lite’ edition (32kByte code size limitation). This weekend I wanted to move to the new v5.12.05 version.

Keil uVision5

Keil uVision5

And there were indeed several things which are different. So this is post is about getting this version getting up and running as the v4.7 one.

Keil Download

The Keil (owned by ARM Inc.) μVision IDE and tool chain is available as a free ‘lite’ edition from http://www.keil.com and is limited to 32KByte code size. It requires to register before downloading it.

Add CMSIS-Packs

I made the mistake trying to use the Keil tools with Processor Expert without first installing any CMSIS-Pack. This is a special packaging format defined by ARM to distribute sources and drivers (see http://www.keil.com/pack/doc/CMSIS/Pack/html/index.html), available for anyone to use.

❗ Without the needed packs installed, the MDK tools will silently fail! So make first sure that you have all the needed packs installed first.

To install the packs, launch μVision and launch the Pack Installer:

Pack Installer in uVision

Pack Installer in uVision

This launches a separate binary, the pack installer:

Pack Installer Application

Pack Installer Application

Then use the Check for Updates menu:

Check for Pack Updates

Check for Pack Updates

Then install the updates from the Packs tab on the left side:

Installing Packs

Installing Packs

❗ Warning: I was using a very decent internet connection, but the download is very slow. Only select the devices you really need!

Alternatively, I can download packs from http://www.keil.com/dd2/Pack/ and then use the menu File > Import in the pack manager.

After installing the packs, I can quit the pack installer.

Processor Expert Add-On

To have μVision working with Processor Expert, an extra add-on is needed for V5.12. I have downloaded it from:
http://www.keil.com/download/docs/420.asp

❗ Future versions after V5.12 will have this update automatically included, so need to download and install that add-on.

This update is needed, otherwise μVision will not recognize that the device specified in the Processor Expert ProjectInfo.xml is coming  from a device pack.

Run the setup:

MDK-ARM 5.12 AddOn for Freescale PE

MDK-ARM 5.12 AddOn for Freescale PE

As I can have multiple version of the Keil tools installed, select where the update has to go to. I have my version installed in C:\Freescale\Keil_v5.12, but your installation path very likely will be different. The usual default installation path for μVision 5 is c:\keil_v5

Select Folder which version to upgrade

Select Folder which version to upgrade

Then go through the rest of the dialogs and have the update installed.

Exporting Processor Expert Project to μVision 5

I assume that you already have created a Processor Expert Project in Eclipse. Otherwise for Processor Expert Driver Suite the steps described in “Using Keil µVision 4 (ARM-MDK) with Processor Expert Driver Suite” still apply:

  1. Menu File > New > Processor Expert Project
  2. Then go through the wizard, select your device
  3. Use Keil ARM C/C++ as Compiler

Processor Expert projects create a file ProjectInfo.xml. I can import that XML file into  μVision to create a project, and it is then monitored by μVision.

ProjectInfo.xml

ProjectInfo.xml

To import the project into μVision, I create an ‘External Tool Configuration’ in Eclipse.

Select first the project for which you want to import into μVision:

Project Selected

Project Selected

Then create use the triangle menu item to get access to the External Tools Configurations:

Eclipse External Tool Configuration

Eclipse External Tool Configuration

To create a configuration:

Configuration to import into uVision5

Configuration to import into uVision5

  1. Press the ‘+’ button to create a new configuration
  2. Browse to the UV4.exe of your installation
  3. Specify the working directory. I’m using Eclipse macros to specify the currently selected project: ${workspace_loc:/${project_path}}
  4. Specify the command to import (-i option) the ProjectInfo.xml file and the μVision project file name: -i ProjectInfo.xml ${project_name}.uvprojx
  5. Press Apply button
  6. Use Run button to run the script

Note the x in ${project_name}.uvprojx: this tells μVision 5 to use CMSIS-Pack files!

You can later on re-run the script if needed, or on a different project. Just make sure that you first select the project root folder and then run the script. It is important to select the current project, as the script is using the currently selected project!

Running Script for Project

Running Script for Project

This will create the μVision 5 project files for that project:

uVision Files Created

uVision Files Created

💡 If the files do not show up, refresh that folder/project. On Windows, use the F5 key, or File > Refresh menu (with that project selected).

To avoid the manual refresh, you should set the option ‘Refresh resources upon completion’:

Refresh Option for Action

Refresh Option for Action

If the import does not work, it could be that you do not have the needed CMSIS-Packs installed for that microcontroller. Make sure that you have the needed packs installed (see earlier in this article).

Using μVision

With that .uvprojx file in the Eclipse project, I can double-click on it, and it will open μVision 5 with that project :-).

💡 If you already have a μVision instance open, it will open another instance. I recommend to close any running instance before double-clicking to create a new instance to avoid too many instances open.

I can now use Eclipse/Processor Expert and μVision as normally: adding new components, configuring them, generating code. If I have added/removed components, I need to import the project again into μVision:

Updated Project

Updated Project

The steps debug the application with μVision depend on your hardware/connection. The steps described in “Using Keil µVision 4 (ARM-MDK) with Processor Expert Driver Suite” still apply.

Summary

Using μVision 5 requires extra files installed to make it work with Processor Expert. One thing is that it needs extra CMSIS-Packs, plus a Processor Expert update from Keil. Another difference is that the project file extension is now .uvprojx. The CMSIS-Pack concept is very promising, and there are already open source efforts going on to get this into Eclipse.

Happy Keiling 🙂

Links:

39 thoughts on “Using Keil μVision 5 with Processor Expert

  1. Pingback: Using Keil µVision 4 (ARM-MDK) with Processor Expert Driver Suite | MCU on Eclipse

  2. What version of Processor Expert does this install?
    We started out with PEx v10.2 last year, and “froze” just before v10.3 appeared, so never really tested it. I’m ready to “thaw” if there is much of an update since then.

    Like

  3. I have two things 🙂
    When I try to creat uVision project with PE eclipse 10.4.2 or CodeWarrior 10.6and MDK-ARM 5 failes on two computers.
    With PE eclipse I can setup to use Keil compiler, and when I run External tool
    With CodeWarrior, I use existing project, thats not setup to use Keil compiler/ and one created with PE and Keil compiler, both times I get uVision IDE has stopped working and doesnt create project files. I tried entering commands in cmd, same fail.
    Any suggestion on this?
    The only way I could get uVision project files is to use Keil v4.

    My need was to program custom KL24Z board with FRDM-KL25Z board and it works.
    I used CMSIS-DAP bootloader in KL25Z, cut of the clk for SWI on J11 (as you described in one post), build Intel hex with CW, and in Keil in Options for Target in Utilities setup CMSIS-DAP debugger, checked Update Target before Debugging and setup init file with LOAD myCWiHex.hex.
    I wanted to share this if anyone needs cheap programmer :-).

    Like

  4. Pingback: Using Kinetis Design Studio with IAR Embedded Workbench IDE | MCU on Eclipse

  5. When I try to build the Imported Processor expert file to uVision it gives the implicit declatation error EnterCritical(); i have PE 10.4 this problem should be fix right.

    Like

      • Generated_Code\EEPROM.c(410): warning: #223-D: function “Cpu_EnterCritical” declared implicitly
        EnterCritical();
        Generated_Code\EEPROM.c(423): warning: #223-D: function “Cpu_ExitCritical” declared implicitly
        ExitCritical();
        Generated_Code\EEPROM.c(499): warning: #223-D: function “Cpu_EnterCritical” declared implicitly
        EnterCritical();
        Generated_Code\EEPROM.c(512): warning: #223-D: function “Cpu_ExitCritical” declared implicitly
        ExitCritical();
        Generated_Code\EEPROM.c: 4 warnings, 0 errors

        this is what im getting

        Like

  6. its on PE_Types.h this only happen when im using I2C_LDD or serial communication with RTOS. serial without RTOS it compiles good. and I2C with RTOS is also fine. because the EnterCritical macro on the I2C was change to an RTOS EnterCritical. which is name taskEnterCritical with a different macro.

    Like

    • Roland,
      I have not used Keil for a while, so I think I need to re-retry it on my end. I find hopefully some time tomorrow to investigate this. It could be that the recent switch to FreeRTOS v8.2.0 has broken something. Are you using v8.2.0, btw?

      Like

      • yes im using v8.2.0 btw, try it without the RTOS and only load the I2C_LDD. i have loaded all the patch on Processor expert which on there website including the patch that you made. and then compile it on Keil the then implicit declaration of EnterCritical will be an error. and the Macro is on PE_Types.h and i verified that PE_Types was included on the i2C header.

        Like

        • Hi Roland,
          I tried on my side (Driver Suite 10.4 with Keil v5.12), for the KL25Z (FRDM-KL25Z) with I2C_LDD and FreeRTOS added (v8.2.0), and I don’t see any problem. So I’m wondering what I’m missing?
          Erich

          Like

      • Generated_Code\EEPROM.c(410): warning: #223-D: function “Cpu_EnterCritical” declared implicitly
        EnterCritical();
        Generated_Code\EEPROM.c(423): warning: #223-D: function “Cpu_ExitCritical” declared implicitly
        ExitCritical();
        Generated_Code\EEPROM.c(499): warning: #223-D: function “Cpu_EnterCritical” declared implicitly
        EnterCritical();
        Generated_Code\EEPROM.c(512): warning: #223-D: function “Cpu_ExitCritical” declared implicitly
        ExitCritical();
        Generated_Code\EEPROM.c: 4 warnings, 0 errors

        this what im getting

        Like

      • /* Save status register and disable interrupts */
        #define EnterCritical() \
        do {\
        uint8_t SR_reg_local;\
        Cpu_EnterCritical(&SR_reg_local);\
        if (++SR_lock == 1u) {\
        SR_reg = SR_reg_local;\
        }\
        } while(0)

        /* Restore status register */
        #define ExitCritical() \
        do {\
        if (–SR_lock == 0u) { \
        Cpu_ExitCritical(&SR_reg);\
        }\
        } while(0)

        /* this is the macro from processor expert PE_Types.h */

        Like

      • one more thing the I2C_LDD works Fine with an RTOS. it does not work without an RTOS. if your running it with an RTOS the AsynchroSerial will give the error not the I2C_LDD

        Like

        • Can you share your project? See my email address on the About page of this blog. Could it be that you have a Kinetis SDK enabled project?

          Like

      • i already sent you the mail with the project file on it. thank you so much for taking the time look at it. i never used the SDK. just to check how would you know that it is an SDK project.

        Like

  7. i also notice that with FreeRTOS serial communication and I2C does not use the same macro in EnterCritical. but it should be the same because the purpose was to disable global interrupts. which apply’s to both communication function.

    Like

    • Hi Roland,
      they do not need to use necessarily the same macros or way to disable the interrupts. For example the RTOS might only mask some interrupts, while the I2C driver needs to disable all interrupts.

      Like

  8. In KDS 3.0 I had to use ${project_loc} as the working directory otherwise the error message: Variable references empty selection: ${project_path} is presented.

    Also the code generation sometimes did not generate (or overwrite) the files in the Generated_Code directory after pressing the button, the solution was to press it again.
    The warning see when this problem occurs is something like:
    Description Resource Path Location Type
    Generator: Warning: Error during writing to file: C:UsersCHADworkspace.kdsProject1Generated_Codeboard.h Project1
    Code Generator Processor Expert Problem

    Like

    • Hi Chad,
      I did not had issues with overwriting files. Just make sure they are not on a path (e.g. network disk drive) with high latency time.
      As for the ${project_loc} and other Eclipse build variables: yes, I have seen that issue some times too, as it seems to me that tool vendors sometimes define their own variables which can cause issues.

      Like

  9. Pingback: Tutorial: Using Kinetis Design Studio V3.0.0 with IAR and Keil IDE’s | MCU on Eclipse

  10. Hello,

    I try to use Keil ARM C/C++ Compiler in a new project with KDS. So I followed your application notes.
    All seems to be good in my configuration but the file *.uvprojx is not generated and I don”t know why.

    Can’t you help me on this subject please, I can make screenshot if needed of all config, etc…

    Best Regards,

    Like

      • Hi,

        I created a project with Keil MDK, I saved the *.uvprojx file in the directory of my KDS project. So that changes nothing except I have the uvprojx file which appears in the KDS project…

        Like

        • I’ve been out of the loop on Keil uVision updates for a while, so hence this is a catch-up question …

          Is Processor Expert still “supported” with KDS and KSDK?

          At one time I inferred the impression that PEx was being “deprecated” in favor of the newer tool features in KDS and/or KSDK, but now I’m fuzzy on that.

          Pete Klammer
          Lead Firmware Engineer

          Allegion Credentials & Readers
          500 Golden Ridge Rd
          Bldg 1, Ste 160
          Golden, CO 80401-9553
          Office: 303.640.2669
          Mobile: 303.915.2673
          Fax: 303.273.9937
          Email: Peter.Klammer@allegion.com
          http://www.allegion.com

          [ALLE_RGB_V]

          The information contained in this message is privileged and intended only for the
          recipients named. If the reader is not a representative of the intended recipient,
          any review, dissemination or copying of this message of the information it contains
          is prohibited. If you have received this message in error, please notify the sender
          and delete the original email and any attachments.

          Like

        • I have not actively used the Keil uVision actively much recently.
          >> Is Processor Expert still supported with KDS and KSDK
          Yes, it is supported. But the Kinetis SDK V2.0 does not have Processor Expert included and supported.
          You might have a read at https://mcuoneclipse.com/2016/01/29/first-nxp-kinetis-sdk-release-sdk-v2-0-with-on-demand-package-builder/ and the discussion in https://mcuoneclipse.com/2016/02/14/are-arm-cmsis-pack-the-future-of-software-components/

          Like

  11. Hey Erich,

    Hope you still get notifications on here. I was able to get my PE project exported to Keil using your method (AND it builds, which is great), but the project files show up in a weird way. My files are organized into Generated Code, Sources, etc. in PE, but when I export to Keil I’m only seeing the generated code files and they are arranged into two folders: GeneratedCs and Generated Hs. I can’t find anything in the External Tools Configurations in PE that would cause this. Any ideas?

    Like

What do you think?

This site uses Akismet to reduce spam. Learn how your comment data is processed.