The latest release of QEMU STM32 includes the following features. Note that only basic functionality may be provided - there will inevitably be features (especially uncommon features) that are not emulated. I have included links to the relevant commits or files.
- Built on top of QEMU version 2.1.3
- Basic STM32F1 microcontroller with the following peripherals:
- Changes to core QEMU functionality (in ARMv7 code):
- The stm32_p103_demos project contains demos that run in this emulator.
The Pebble Smartwatch also has a QEMU emulator with STM32 functionality (it was originally based on the QEMU STM32 project). It is located at: https://github.com/pebble/qemu . While I have not tried the Pebble emulator, it seems quite extensive, with more peripherals (e.g. I2C and SPI) and the ability to emulate different STM32 families.
** Latest news was lost with GitHub page migration - fix pending **
July 15, 2016
- Added IWDG peripheral implementation. Thank you to vinifr for submitting this. The peripheral is in the stm32 branch but not yet included in a release.
April 2, 2016
- Added ADC, DAC, and RTC peripheral implementations. Thank you to Hariri Yasser, Fatima Zohra Lahlou, and Jean-Michel Friedt for submitting these. The peripherals are in the stm32 branch but not yet included in a release.
- Corresponding tests were also added to the stm32_p103_demos project. The ADC demo now works (previously it only worked on real hardware).
June 6, 2015 - [Release v0.1.3] (https://github.com/beckus/qemu_stm32/releases/tag/stm32_v0.1.3)
- Added timer peripheral (thank you to [hankhank] (https://github.com/hankhank) for writing this)
- Merged in QEMU v2.1.3
- Fixed bugs in GPIO module (see [commit] (https://github.com/beckus/qemu_stm32/commit/3e846fc6272ea226cd3fa5bd255a71e30be0e9b5) for more details)
- Miscellaneous code cleanup
The STM32 implementation is kept in the “stm32” branch (the “master” branch contains the unmodified QEMU code). The “stm32” branch may contain commits that make the software unstable or perhaps even uncompilable. Therefore, I recommend that you use the latest tagged release that looks like this: “stm32_v0.x.x”. These are considered to be relatively stable, and at least minimally tested.
See the README file for more details on compilation, etc..
High level goals (in no particular order):
- Make compliant with the new QOM framework. Make use of properties as much as possible to provide visibility into the virtual machine. For example, the UARTs can have properties indicating their baud rate and configuration. Also, provide properties to be used for simulating exceptional situations. For example, the UART could provide properties used to simulate parity and framing errors. These properties provide debugging advantages over bare hardware and may even allow for automated testing.
- Provide complete unit testing of the STM32 implementation – if the unit tests pass you should be confident nothing is broken.
- When appropriate, modify core QEMU or add new generic components (e.g. The clock tree objects and unit testing framework). Submit these components to the main QEMU project if possible.
- Continue to add new STM32 peripherals (SPI, timers, etc.) and enhance existing peripherals.
- Add new development boards, for example the low cost STM32 discovery boards. Someone has also suggested supporting the CrazyFlie Nano Quadcopter. Also add support for the Cortex M4 architecture.
I have started a wiki page with a to-do list, much of which will never become reality.
With a few exceptions, I am not actively developing new functionality. But I do perform maintenance as I have time, including:
- Merging in patches from contributors.
- Merging in new releases of QEMU.
- Fixing defects.
- Making occasional limited changes.
- Responding to questions.
I have not yet submitted any patches to QEMU mainstream for a couple of reasons:
- This project is still in a state of flux, and I would like the flexibility to change it without going through a patch process.
- I suspect it will take some time and effort to go through the submission process - time I would rather put into the project itself. I have also made changes to the core framework, which may not be acceptable in the main QEMU branch or which will need to be modified. I don’t see much disadvantage to leaving this as a fork. That being said, there are core components that could benefit other parts of QEMU (i.e. The clock tree objects and unit testing framework) that should be submitted.
I welcome and encourage any source code contributions.
Thank you to the following people for submitting patches: