Trying out Cortex-M IDE from Keil

A few days ago I – and some good colleagues – participated in a seminar/workshop arranged by Nohau Denmark. The main subject was MDK – Microcontroller Development Kit – from Keil. This is mainly a Keil-created IDE – Integrated Development Environment – running on Windows known as “µVision”.

ARM-Keil MDK for Cortex-M
ARM-Keil MDK for Cortex-M

 

The embedded world is increasingly being dominated by Linux solutions when it comes to the more advanced systems like e.g. ARM Cortex-A, but there’s a lot of smaller CPU’s that cannot run Linux. In this end ARM Cortex-M processors are among the favorites. See also https://klauselk.com/2017/09/17/2017-embedded-markets-study/

One of the major challenges with Linux as an embedded system is that it typically forces you to develop on a Linux Host – or at least a virtual machine. Thus, using Linux in an embedded system is not just about the kernel or the debugger, but the entire development environment. If you are the single Embedded Software developer in a small project, used to working with Windows – e.g. Visual Studio – the Linux world is extremely confusing. Here Keil MDK might be an interesting alternative. And when I say alternative, it’s because the MDK environment is growing and seems to be challenging what I just said. Keil also offers an IDE that can handle Linux solutions. This is called DS-MDK and is built around the well-known Eclipse environment. The main target for this is what Keil call “heterogeneous” solutions – chips with multiple cores, of which some run Linux and some run a smaller RTOS like Keils own RTX. But I don’t see why DS-MDK shouldn’t be used on some pure Linux projects.

Developing with open-source tools, of which some are described in “Embedded Software for the IoT”, probably gives you the best flexibility and freedom. This may be preferred if you do a lot of custom HW, requiring you to pick and choose various drivers and libraries. It is definitely a good solution if the Open Source environment is where you come from. On the other hand, if you come from the Windows world with a small team, you could start the next embedded project by taking a look at Keil’s MDK. If e.g. you plan to use a 3’rd party board, you can select one that is supported by this environment. The list is long. If you want to create a custom board, you may base it on one of the supported CPU’s. Naturally there is more work here, but it can be done. There are more parameters in this choice that we do not have time and place for here.

In the rest of this blog I will try to pass on the impressions I got from this simple workshop. I did a repeat on another PC afterwards to make sure I didn’t miss anything – and to get some good screenshots.

The build environment

Keil uses a “packet installer” to pick and choose among the many boards, CPU’s and libraries. It should be run with an internet connection, as it’s updated with new components and versions all the time. It is OK to install multiple versions of the same thing.

Packet Installer for MDK

Similar to the “Packet Installer” there is a “Run-time Manager” in which you perform a basic configuration & selection of whatever was installed with the Packet Installer. I really like that you can choose to run with the “latest & greatest” – or use fixed versions. Also, I like the “resolver” that helps you avoid conflicts (marked orange), and fetches components that are needed for the components you pick.

Run-Time-Environment Manager

When this is done you can do an even finer configuration via standard h-files. These can be edited in the usual way, but you may also prefer to see them in a “Configuration Wizard”. With my short experience it seems like you can go back and forth between the two without problems, although it seems too good to be true. The nice thing about the Configuration Wizard view is that you are not only led to the important parameters, but also shown the various legal values as drop-down lists. The downside is that it is very easy to change something by mistake. In this case it is nice that the helping text at the bottom of the screen tells the default values.

h-file and Config Wizard of the same

The Editor & Debugger

The editor seemed to understand the usual windows shortcuts, cut & paste etc. It also supports “intellisense” – giving you suggestions of the remaining part of a name. Just like in Visual Studio this can be provoked with CTRL-Space if it doesn’t happen by itself. Also like in Visual Studio (and Eclipse) the Editor doubles as a debugger where breakpoints can be set by clicking in the left margin. The icons are also familiar if you are used to debugging in Visual Studio.

On top of all this, the debugger also has some nice Watch-facilities, Tracing, a “Logic-Analyzer”, Register-view, Assembler-view and ways to view threads. The printf-output can be configured to show printouts from specific areas – e.g. TCP or HTTP. There are several more specialized views – like “Network” that shows pretty much the same as a “netstat” command – plus socket options. This environment is clearly created for networking.

Watch and Logic Analyzer
Debugging Web-Server with selected pre-cooked printf’s and ‘netstat’

Much of the debugging requires external hardware as can be seen on the photo. We got Keils “Ulink2” with us from the workshop. It does require some setup – some of the dialogs here go as deep as they do on Visual Studio!

In the photo below, the black cable supplies power to the NXP FDRM-K64F-board via a USB-connector. The Ulink2 debugger connects to the PC via USB and to the target via the grey serial (SWD) cable. The Ethernet is used in the application.

The Hardware

Pricing & Editions

See http://www2.keil.com/mdk5/

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *