CPSC3300:

Steps for using ST Microelectronics STM32F411 Discovery board and  Keil MDK-ARM tools on Mac or Linux machines

 

The Keil MDK-ARM tools require Windows to run, but they can be successfully used on a virtual machine on either a Mac or PC.  For this document, I use Virtual Box, which is a free download, but a similar process should work for VMWare. You are on your own configuring the VMWare virtual machine if you choose to do it.

 

(Note: version numbers of everything may change from the time this was written. The instructions may or may not work with the new versions)

 

1.     Install Virtual Box (https://www.virtualbox.org ) . As of this writing, version 6.1 is the current version.

 

2.     Obtain a Windows 10 iso. All Auburn students are entitled to download Microsoft tools and operating systems by virtue of our membership in Azure Development tools for Teaching. (https://azureforeducation.microsoft.com/devtools). Use your Auburn student credentials to log in. The file you are looking for is

 

en-us_windows_10_consumer_editions_version_21h2_x64_dvd_6cfdb144.iso

 

which is 5.88GB in size. If you search for Windows 10 it wil turn up.

 

3.     Create a new virtual machine in virtual box and install windows on it.  In virtual box

a.     Click New

b.    Give it a name, select a location for the machine, select Windows 10 (64bit) as the operating system. Accept all the defaults regarding memory and disk.

c.     Select the new virtual machine in the virtual box main screen, and click settings from the top. Click the storage tab. You should see two volumes, one for the hard drive and one for an optical drive, labelled empty. Select the icon to the right of “Optical Drive: SATA Port 1” that looks like a CD. Select “Choose a disk file….”. Enter the location and name of the .iso file you downloaded in step 3.

d.    Check the boot order for the virtual machine in the Settings. It should include the optical drive.

e.     Start up the virtual machine. It should boot from the optical drive. Follow the directions and install windows.

 

4.     Install the Keil tools and device driver on the virtual machine.

a.     Download the install file MDK536.EXE from https://www2.keil.com/mdk5 by clicking the “Download MDK” link. You have to register and validate your email.

b.    Download the ST-link device driver from https://www.st.com/en/development-tools/stsw-link009.html . You will have to register and then you will be emailed a message from ST with the link for the download. The file is en.stsw-link009_v2.0.2.zip.

 

5.     Make a directory to share between your desktop and the virtual machine. 

a.     Create the directory on your Mac or Linux machine

b.    Copy the files from steps 5a and 5b into that directory.

c.     In the virtual box settings for the virtual machine you created in step 4, click on Shared Folders. Click the add symbol (file with a +) on the right-hand side. Enter the path and name of the directory from step 6a.  Check “read only” and “auto mount”. Do not fill in the mount point. Click OK.

d.    In Windows Explorer (file manager) on the Virtual machine (which should be running from step 4e) go to This PC and verify that the directory you chose to share is present as a Network directory.

 

6.     Copy the two files in the shared directory onto the desktop of the virtual machine

 

7.     Run those two install files to install the SDK and USB device driver. You will need to unzip the driver file first.   You will need to load the appropriate packs for uVision 5 with the pack loader, which runs automatically during the install.  (See separate document)

 

     (following steps you must do every time you want to work on your STM32F411 projects)

8.     Plug your STM32F411 board into a USB port on your mac or PC. You will need a USB-mini male to USB-A male cable to connect the board. Be sure to use the USB-mini port labelled USB ST-LINK (trapezoid with angular corners) port on the ST micro board and NOT the USB-micro port labelled USB USER (smaller rounded trapezoid on opposite side of the board).  In the virtual machine, click the Devices tab, select USB, and click the ST electronics device.  At that time the device driver for the ST-LINK should install with the characteristic Windows “you inserted a usb device and the driver loaded successfully” sound. You can check it under USB Devices in the Device Manager on the virtual machine.

 

9.     Start Keil uVision 5 on the virtual machine.

 

10.  Load an existing project or create one (see separate document) and build it for this board.

 

11.  Either flash or debug the project. (see separate document)