In the previous section, we have NOT run/test/debug the program yet. How to do that? Normally, there are 2 ways to test your code before flashing your code down to a chip.
Way 1: Test in a simulator, which simulates the STM32 chip
Way 2: Test on a real STM32 development board
In this section, we are going to talk about how to run/test/debug the program in the popular simulator QEMU.
2.4.1 QEMU Installation
Option 1: Official Installation
You can directly download QEMU's NEWEST release from its official website https://www.qemu.org.
Maple - LeafLab Arduino-style STM32 microcontroller board
NUCLEO-F103RB - ST Nucleo Development Board for STM32 F1 series
NetduinoGo - Netduino GoBus Development Board with STM32F4
NetduinoPlus2 - Netduino Development Board with STM32F4
STM32-E407 - Olimex Development Board for STM32F407ZGT6
STM32-H103 - Olimex Header Board for STM32F103RBT6
STM32-P103 - Olimex Prototype Board for STM32F103RBT6
STM32-P107 - Olimex Prototype Board for STM32F107VCT6
STM32F4-Discovery - ST Discovery kit for STM32F407/417 lines
STM32F429I-Discovery - ST Discovery kit for STM32F429/439 lines
Supported MCUs:
STM32F103RB
STM32F107VC
STM32F405RG
STM32F407VG
STM32F407ZG
STM32F429ZI
STM32L152RE
2.4.2 Test QEMU
Step 1: Create and Build Project
As mentioned above, since current GNU MCU Eclipse QEMU does NOT support STM32F767ZI yet, we have to carry our QEMU test with another board. Here, we pick up board STM32F429I-Discovery with MCU STM32F429ZI to carry out QEMU test.
Similar to previous section, let's first create a Blinky C/C++ project with board configuration STM32F4xx with Chip family STM32F429xx, as follows:
As you can see, a file named F429ZI_Blinky.elf is produced under folder Debug or Release, depending on what kind of target/configuration you specified to build.
Step 2: Run Project with QEMU
Finally, we need to run the project by emulating STM32F429I-Discovery with chip STM32F429ZI via QEMU. Right click on the built file HelloWorld.elf -> Run As -> Run Configurations -> GDB QEMU Debugging -> New. We creat a new configuration named F429ZI_Blinky QEMU, and make the Run Configurations as in the following two images:
Run Configurations QEMU - Main Tab
Run Configurations QEMU - Debugger Tab
And the project Blinky successfully run with the following output:
And GNU MCU Eclipse QEMU emulates STM32F429I-Discovery board on the screen as follows: