Introduction: Getting Keil and STM32CubeMX Ready

Getting started with STM32 ?

In this tutorial, we will be Getting, Installing and Setting up all tools required for setting up STM32 development using STM32CubeMX, Keil for ARM and ST-Link Drivers.

Step 1: Getting, Installing and Setting Up STM32CubeMX

Getting STM32CubeMX:

  1. Open this STM32Cube page in new Tab.
  2. Click on "Get Software" button, the light blue one, last of three inline. This will take you to the bottom of the page.
  3. Again click on "Get Software" button in row of STM32CubeMX.
  4. This will take you to the Login page. If you have already signed up then please Login and if not then Register. This Registration step is very easy you just have to fill the form and verify the email later on.
  5. Once Registration is done, downloading of software will start automatically. If not then click on "Get Software" again (while logged in).

Installing STM32CubeMX and downloading all required packages:

  1. Extract the downloaded .zip file.
  2. Open extracted folder. Start the .exe file.
  3. If asked, Click "Run" or "Yes" or both.
  4. This will start STM32CubeMX installation. Click Next.
  5. Accept licence Aggrement and "Click Next".
  6. Select where to install and "Click Next". If asked that directory will be created, click "OK".
  7. Select from these option and "Click Next".
  8. This will start installation. Wait for it.
  9. When done, "Click Next".
  10. "Click Done".

Installing required Packages:

  1. Start STM32CubeMX
  2. Click "Help > Install New Libraries" [Alt+U]
  3. Based on which Board you are using you need to update the firmware.
  4. Let's say you are working STM32F103 then select latest version of "Firmware Package for Family STM32F1" under "STM32CubeF1 Releases" .
  5. Click "Install Now".
  6. This will start downloading and installing.
  7. It will install the packages and then close STM32CubeMX.

Step 2: Getting, Installing and Setting Up Keil for ARM

Keil (uVision5):

  1. Open this MDK-ARM Keil in new Tab.
  2. Fill out the form with your details and click submit. This will take you to the keil arm download page.
  3. Click on MDKxxx.exe. This will start downloading the program.

Installing keil uVision 5 (Keil for ARM):

  1. Start the downloaded Setup.
  2. Click Next.
  3. Click on check box next to "I agree to all...". and Click Next.
  4. Select where to install. When selected, click Next.
  5. Enter your details and click Next.
  6. Now, installation will start, wait for it.
  7. After some time, it will complete installation. Un-check the "show release notes" checkbox and click "Finish".

Installing Packages:

  1. Start Keil as administator.
  2. Click on Pack Installer in the main window and new windows will open.
  3. Click on the Pack >> Check for the Updates. This will check for the updates from the internet.
  4. Select the STMicroelectronics in the Devices Tab.
  5. Install/Update following components. (In case of STMF1, chose for your board accordingly)
    1. Device Specific:
      • Keil::STM32F1xx_DFP
      • Keil::STM32NUCLEO_BSP
    2. Generic:
      • ARM::CMSIS
      • ARM::CMSIS-Driver_Validation
      • ARM::CMSIS-RTOS_Validation
      • Keil::ARM_Compiler
      • Keil::MDK-Middleware
  6. Close the Pack Installer and Exit Keil.

Step 3: Getting and Installing ST-Link Drivers

STM32 Eval Board come with on-board ST-LINK Debugger. But, in order to establish that link between Board and PC\Keil we need to install drivers. To install these drivers follow the following steps:

ST-Link Drivers:

  1. Open this driver download page in new Tab.
  2. Click on "Get Software" button.
  3. This will take you to the bottom of the page.
  4. Click on "Get Software" button again.Login \ Register.
  5. Download. (If doesn't start automatically, click on bottom "Get Software" button, again.)

Installing ST-Link Drivers:

  1. Extract the downloaded folder. (Maybe "en.stsw-link009").
  2. Now, if your system is 32-bit start "dpinst_x86.exe" if 64-bit start "dpinst_amd64.exe".
  3. Select "Run" or "Next" or both. This will bring you to the device driver installation wizard.
  4. "Click Next".
  5. If asked, "Click Install".
  6. When installation is finished, "Click Finish".