Intro: 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
- Open this STM32Cube page in new Tab.
- Click on "Get Software" button, the light blue one, last of three inline. This will take you to the bottom of the page.
- Again click on "Get Software" button in row of STM32CubeMX.
- 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.
- 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:
- Extract the downloaded .zip file.
- Open extracted folder. Start the .exe file.
- If asked, Click "Run" or "Yes" or both.
- This will start STM32CubeMX installation. Click Next.
- Accept licence Aggrement and "Click Next".
- Select where to install and "Click Next". If asked that directory will be created, click "OK".
- Select from these option and "Click Next".
- This will start installation. Wait for it.
- When done, "Click Next".
- "Click Done".
Installing required Packages:
- Start STM32CubeMX
- Click "Help > Install New Libraries" [Alt+U]
- Based on which Board you are using you need to update the firmware.
- Let's say you are working STM32F103 then select latest version of "Firmware Package for Family STM32F1" under "STM32CubeF1 Releases" .
- Click "Install Now".
- This will start downloading and installing.
- It will install the packages and then close STM32CubeMX.
Step 2: Getting, Installing and Setting Up Keil for ARM
- Open this MDK-ARM Keil in new Tab.
- Fill out the form with your details and click submit. This will take you to the keil arm download page.
- Click on MDKxxx.exe. This will start downloading the program.
Installing keil uVision 5 (Keil for ARM):
- Start the downloaded Setup.
- Click Next.
- Click on check box next to "I agree to all...". and Click Next.
- Select where to install. When selected, click Next.
- Enter your details and click Next.
- Now, installation will start, wait for it.
- After some time, it will complete installation. Un-check the "show release notes" checkbox and click "Finish".
- Start Keil as administator.
- Click on Pack Installer in the main window and new windows will open.
- Click on the Pack >> Check for the Updates. This will check for the updates from the internet.
- Select the STMicroelectronics in the Devices Tab.
- Install/Update following components. (In case of STMF1, chose for your board accordingly)
- Device Specific:
- Device Specific:
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:
- Open this driver download page in new Tab.
- Click on "Get Software" button.
- This will take you to the bottom of the page.
- Click on "Get Software" button again.Login \ Register.
- Download. (If doesn't start automatically, click on bottom "Get Software" button, again.)
Installing ST-Link Drivers:
- Extract the downloaded folder. (Maybe "en.stsw-link009").
- Now, if your system is 32-bit start "dpinst_x86.exe" if 64-bit start "dpinst_amd64.exe".
- Select "Run" or "Next" or both. This will bring you to the device driver installation wizard.
- "Click Next".
- If asked, "Click Install".
- When installation is finished, "Click Finish".