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.
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:
This launches a separate binary, the pack installer:
Then use the Check for Updates menu:
Then install the updates from the Packs tab on the left side:
❗ 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:
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
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:
- Menu File > New > Processor Expert Project
- Then go through the wizard, select your device
- 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.
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:
Then create use the triangle menu item to get access to the External Tools Configurations:
To create a configuration:
- Press the ‘+’ button to create a new configuration
- Browse to the UV4.exe of your installation
- Specify the working directory. I’m using Eclipse macros to specify the currently selected project: ${workspace_loc:/${project_path}}
- Specify the command to import (-i option) the ProjectInfo.xml file and the μVision project file name: -i ProjectInfo.xml ${project_name}.uvprojx
- Press Apply button
- 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!
This will create the μVision 5 project files for that project:
💡 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’:
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:
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:
- How to use Processor Expert with Keil μVision 4: “Using Keil µVision 4 (ARM-MDK) with Processor Expert Driver Suite“
- Keil Application note (μVision 4): Keil Application Note 235
Pingback: Using Keil µVision 4 (ARM-MDK) with Processor Expert Driver Suite | MCU on Eclipse
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.
LikeLike
It is using Processor Expert Driver Suite 10.4 with the 10.4.2 update.
LikeLike
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 :-).
LikeLike
Hi Zoran,
are you using Keil v5.12.05?
I had originally issues with creating the Keil projects too: have you loaded all the needed CMSIS-PACK files? Without the packs, the Keil IDE won’t create the projects.
Erich
Erich
LikeLike
Hi Erich,
I have Keil v5.12.0.0, packages: ARM::CMSIS, Kinetis_KLxx_DFP and MDK-Middleware on my current computer, I had more packages installed on my notebook.But still even if something is missing Keil should not just died, right?
LikeLike
No, it should not die. In my case (without the packages), it simply did not do anything. Maybe you should contact Keil support?
LikeLike
Ok, I will, it will be useful for debugging.
Thank,
BR,
Zoran
LikeLike
Well, its fixed in new release, coming next week.
BR,
Zoran
LikeLike
Have you installed that Keil update:
http://www.keil.com/download/docs/420.asp
? I was told that this one will be included in the next release, so maybe you have not installed it in your current version.
LikeLike
I guess I should read your posts more carefully 🙂
LikeLike
always 😉
LikeLike
Pingback: Using Kinetis Design Studio with IAR Embedded Workbench IDE | MCU on Eclipse
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.
LikeLike
In which file is that warning? It looks like Cpu.h is not included (here usually EnterCritical() and ExitCritical() is defined as macros).
LikeLike
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
LikeLike
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.
LikeLike
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?
LikeLike
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.
LikeLike
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
LikeLike
i have a FRDM-k22. thats werid why does it showing an error when i compile it.
LikeLike
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
LikeLike
/* 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 */
LikeLike
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
LikeLike
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?
LikeLike
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.
LikeLike
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.
LikeLike
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.
LikeLike
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
LikeLike
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.
LikeLike
Pingback: Tutorial: Using Kinetis Design Studio V3.0.0 with IAR and Keil IDE’s | MCU on Eclipse
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,
LikeLike
You need first to create a project with Keil MDK: this will create the *.uvprojx file for you (or at least it should).
I hope this helps,
Erich
LikeLike
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…
LikeLike
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.
LikeLike
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/
LikeLike
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?
LikeLike
Yes, I’m getting notifications for every post here :-).
I have not used Keil for a long time, but to my understanding it is the Keil tool which separates the .h and .c files that way. And only the Keil tool would be able to change this.
I hope this helps,
Erich
LikeLike
Awesome. Thanks Erich!
LikeLike