How to Use KEIL MDK to Download Programs

1. Introduction to KEIL MDK

RealView MDK development suite originates from Keil, Germany, and has been validated and used by over 100,000 embedded development engineers worldwide. It is the latest software development tool released by ARM for various embedded processors. RealView MDK integrates the most advanced technologies in the industry, combining the features and functions required by most software development engineers in China. The latest version includes the μVision4 integrated development environment and the RealView compiler, supporting ARM7, ARM9, and the latest Cortex-M3 core processors. It automatically configures startup code, integrates Flash programming modules, and offers powerful simulation devices and performance analysis features. Compared to ARM’s previous toolkits like ADS, the latest version of the RealView compiler can improve performance by over 20%. KEIL MDK has added support for the Cortex-M3 core, allowing us to use it for developing applications based on the ARM Cortex-M3 STM32 microprocessor.

2. Installing KEIL MDK Software

Open the accompanying CD – “Software Resources” – “Development Environment” – and find the installation file MDK400_mcu123.exe in the “KEIL MDK” folder. Double-click to open and enter the welcome screen.

How to Use KEIL MDK to Download Programs

Click Next.

How to Use KEIL MDK to Download Programs

Check the installation agreement and click Next.

Select the installation path. Here, F drive is chosen; if the reader has enough hard drive resources, it is recommended to install it on the C drive for faster performance. One thing to note: if you have previously installed the Keil C51 environment, you can install the Keil MDK in the same folder, allowing KEIL V4.0 to support 51 chips simultaneously. After selecting the installation path, continue clicking Next.

How to Use KEIL MDK to Download Programs

Fill in user information; personal users can fill in arbitrarily, then click Next.

How to Use KEIL MDK to Download Programs

Enter the installation steps, which will take a few minutes; please be patient while the installation completes automatically.

How to Use KEIL MDK to Download Programs

After installation, you will see three options:

1) Display release notes.

2) Keep current uVision settings.

3) Load the selected project examples, default is fine.

Click Finish to complete the installation.

How to Use KEIL MDK to Download Programs

The desktop shortcut is as follows:

How to Use KEIL MDK to Download Programs

3. Cracking KEIL MDK

The uncracked KEIL MDK has a limitation of 32K program codes. When the code is not large, it does not have an impact, but when porting large codes like UC/OS, the situation changes, and each compilation will prompt a code limitation: “*****size of this image (41532 bytes) exceeds the maxim*****”. Therefore, the software also needs to be cracked. Open the registration machine “keil 4.0注册机.exe” in the CD, as shown in the figure.

How to Use KEIL MDK to Download Programs

First, you need to obtain the CID number of the software. Open the installed KEIL MDK software,

(Note: run it as administrator on Windows 7; otherwise, it cannot be cracked successfully)

Click File – License Management, as shown in the figure.

How to Use KEIL MDK to Download Programs

Enter the account management interface, copy the CID number, as shown in the figure.

How to Use KEIL MDK to Download Programs

Copy the CID number into the registration machine’s CID, as shown in figure 1. Select “Target” as ARM.

How to Use KEIL MDK to Download Programs

Click the “Generate” button to generate the LIC code as shown in the figure, then copy the LIC code.

How to Use KEIL MDK to Download Programs

Paste the copied LIC code “JL2UH-WMFSE-M9WGG-VBTL0-W0ZQ7-6QNR3” into the Keil 4 license management interface at the indicated position in the figure. Click Add LIC.

How to Use KEIL MDK to Download Programs

After clicking Add LID, a prompt indicating successful addition will appear, as shown in the figure. Now the crack is successful.

How to Use KEIL MDK to Download Programs

4. Using KEIL MDK to Download and Simulate Debugging

After opening, the interface is as shown:

How to Use KEIL MDK to Download Programs

1) JLINK Simulation Setup Process

Click the project settings button in the toolbar, as shown in the figure.

How to Use KEIL MDK to Download Programs

Select the Debug tab and set it as shown in the figure.

1) Select the Debug tab

2) Check the use of the selected box, model select Cortex-M3-JLINK.

3) Check the two items as shown in the figure

4) Check the four options as shown in the figure.

5) After setting, click settings.

How to Use KEIL MDK to Download Programs

Select the chip model as STM32F103CB.

How to Use KEIL MDK to Download Programs

Target – Crystal selection 8MHZ.

How to Use KEIL MDK to Download Programs

Click Debug-settings.

How to Use KEIL MDK to Download Programs

If JLINK is properly connected to the motherboard, an information box will appear as shown, displaying JLINK and the corresponding information of the target board. The left half shows the JLINK connection status; if JLINK is connected properly, it can normally read the version number and other information of JLINK. If there is a connection error, this part will be gray. The right half shows the target board information; if the connection is normal, relevant information will be displayed, for example, the STM32 development board is connected, and the Device Name is correctly read as an ARM core chip. We choose SW mode for downloading, with a download speed of 100KHZ. Click OK to exit settings. Return to the project settings page and click OK to exit project settings.

Select Download from the Flash menu or the Load button in the toolbar to directly download the program.

How to Use KEIL MDK to Download Programs

After a successful download, the compilation information bar displays a success prompt, as shown in the figure.

How to Use KEIL MDK to Download Programs

You can also use KEIL MDK for program simulation and online debugging. The programs provided on the CD are already compiled, so users can directly enter the debugging steps. Select Start/Stop Debug Session from the Debug menu or the debug button in the toolbar to enter the simulation page.

2) ULINK2 Simulation Process

Click the project settings button in the toolbar, as shown in the figure.

How to Use KEIL MDK to Download Programs

Select the Debug tab and set it as shown in the figure.

1) Select the Debug tab

2) Check the use of the selected box, model select ULINK2/ME Cortex Debugger.

3) Check the two items as shown in the figure.

4) Check the four options as shown in the figure.

5) After setting, click settings.

How to Use KEIL MDK to Download Programs

Click the settings button, and the following dialog box will appear. For the STM32 microcontroller, select “swj” port as SW, then click OK.

How to Use KEIL MDK to Download Programs

Next, select Utilities, and remember to also select ULINK2/ME Cortex Debugger. After completing the selection, click the settings button.

How to Use KEIL MDK to Download Programs

As shown in the figure, add the chip type in the lower part by clicking add, then click OK.

How to Use KEIL MDK to Download Programs

Finally, do not forget to select the chip.

How to Use KEIL MDK to Download Programs

Click debugger, and the following page will appear, indicating that the simulation is successful.

How to Use KEIL MDK to Download Programs

How to Use KEIL MDK to Download Programs

Tags:

ULINK, JLINK, MDK

Leave a Comment