In this exercise, you will execute assembly code on the Nucleo-F401RE board using the Keil MDK Debugger to examine its execution at the processor level.

This exercise is from the Efficient Embedded Systems Education Kit .

Please make sure to read and go through the Getting Started with MDK documentation or Learning Path if you are unfamiliar with its usage.

Set up project


Open the CMSIS Pack Installer and install the necessary CMSIS Packs for the STM32F401 and Nucleo boards.

Image Alt Text: CMSIS-Pack

Close the Pack installer and return to the uVision IDE.

Create project

Go to ‘Project’ > ‘New uVision Project’, and create a project.

Image Alt Text: New Project

A window will show up requesting you to select the target device for the project. select STM32F401RE, as shown in this image:

Image Alt Text: TargetBoard

Configure project

Next, you will be required to select software components/packages that you wish to include in your project.

Add CMSIS > Core and Device > Startup.

Image Alt Text: SoftwareComponents

Your project should now look like this:

Image Alt Text: ProjectExplorer

Next you need to configure some options for the target. Select the Options for target icon shown below.

Image Alt Text: TargetOptions

Then under the C/C++ tab set the Language C option to c99 and the Optimization level to -O1.

Image Alt Text: TargetOptions

Also, under the Debug tab, make sure to set the debugger to ST-Link Debugger.

Image Alt Text: TargetOptions

You are ready to start writing the program.