This short post is deigned to help you get started with Keil and the STM32F4 Discovery board. By the end of this post you should be able to download the pre-reqs, install the software, open up the demo program and debug it using the Keil IDE. The key things to note are:
- You must install the ST-LINK driver.
- By default Keil is naturally setup for ULink rather than ST-Link so that has to be changed
- The default device will be incorrect and must be changed
Here's the steps:
- Download user manual
- Download board support package
- Install Keil
- Install ST-LINK Driver
- Plug in Discovery board using a mini-USB cable
- ST-Link driver completes install and demo program should be flashing lights
- Open up the demo project from the board support package:
- STM32F4-Discovery_FW_V1.1.0\Project\Demonstration\MDK-ARM\STM32F4-Discovery_Demo.uvproj
- Configure Keil for ST-Link and Discovery - Project Options (ALT-F7)
- Device: STM32F407VG
- Debug: use ST-Link Debugger (NOT the deprecated one)
- Debug settings: add STM32F4xx Flash
- Utilities: select ST-Link Debugger
- Utilities settings: add STM32F4xx Flash
- Utilities: Update target before debugging
·
Build the project from the Project menu – Build
target (F7)
·
You should now be able to debug the demo program
from the debug menu (Ctrl-F5)
Thanks for the post.
ReplyDeleteA quick addition, while on step 3, change JTAG to the SWD as that's what the disco board implements.