Skip to content

Wiki

Windows Environment Setup (Legacy)

About 11 min read

Existing English translations were reused. 1 current source blocks remain in Simplified Chinese, without triggering paid translation.

(本教程为2024年1月创建的,可能与以后的版本有些出入)

1.Software to prepare

  1. Keil MDK5.3x and above

  2. Latest version of VScode

  3. Latest version of CubeMX

2.vcpkg installation and environment configuration

  1. Clone the vcpkg repository

https://github.com/microsoft/vcpkg/tree/master

git clone https://github.com/microsoft/vcpkg.git

  1. Generate vcpkg program

  1. Configure the environment

Click Advanced system settings

Configure both user environment variables and system environment variables.

  1. Test
vcpkg --version

If the display appears as shown in the figure below, the installation is successful.

3.Generate engineering file

  1. Open CubeMX and log in to your ST account

  1. Install Pack

  1. Configure Project

4.Open the project and configure the default compiler

  1. Configure the default compiler as ARMCLANG(AC6)

  1. Compilation Verification

5.Download and activate the Keil MDK6 plugin

  1. Open VSCode

  1. Install the Keil Studio Pack plugin

  1. After the installation is complete, restart VScode.

  2. Then two windows will pop up in the lower right corner. Click to activate MDK6Community.

Displaying this notification indicates successful activation.

6.Converting an MDK5 project to an MDK6 project

Click Convert to perform the conversion

In the bottom right corner, install all these packs that need to be installed; if any prompts appear asking for permission, allow them all.

When installing packs, it is necessary to ensure a good network environment (a network environment with magic is required),

This phase lasts 5–20 minutes, so please wait patiently. (It depends on your airport speed.)

(These operations are required only on the first run.)

You can open Task Manager to check cmsis.exe is downloading normally. If there is a network speed shown after it, it means the download is proceeding normally; just wait.

This investigation can be skipped.

As shown in the figure, this indicates a successful installation.

If the environment is not activated here, you need to activate the environment. (The image shows deactivating the environment.)

Click to convert the MDK5 project

In this way, it is displayed as a successful conversion to an MDK6 project.

7.Compile

It can be seen that the size after compilation with KEIL MDK6 is exactly the same as the size after compilation with KEIL MDK5.

8.How do I configure debuggers such as ST-Link on Windows?

Windows is even simpler—there is no need to download anything else at all. As long as it works on MDK5, it will basically also work on MDK6.