forked from qemu/qemu
-
Notifications
You must be signed in to change notification settings - Fork 145
/
README
90 lines (68 loc) · 3.37 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
QEMU with STM32 Microcontroller Implementation
Official Homepage: http://beckus.github.io/qemu_stm32/
OVERVIEW
This is a copy of QEMU that has been modified to include an implementation
of the STM32 microcontroller. It also implements an Olimex STM32_P103
developmentvboard. This project runs the demos located in the
stm32_p103_demos project located at: https://github.com/beckus/stm32_p103_demos .
Prerequisites - On a fresh install of Ubuntu 20.04, the following command will install dependencies:
sudo apt-get install build-essential python zlib1g-dev libglib2.0-dev libpixman-1-dev libtool libfdt-dev
Commands for a typical build:
./configure --enable-debug --disable-xen --disable-werror --target-list="arm-softmmu"
make
Useful make commands when rebuilding:
make defconfig
make clean
Notes:
* We pass the following option to the "configure" command to
ignore warnings (otherwise warnings will cause the build to fail):
--disable-werror
* We disable xen support according to issue #42:
https://github.com/beckus/qemu_stm32/issues/42
The generated executable is arm-softmmu/qemu-system-arm .
Other configure options which control the STM32 implementation:
--extra-cflags=-DDEBUG_CLKTREE
Print out clock tree debug statements.
--extra-cflags=-DDEBUG_STM32_RCC
--extra-cflags=-DDEBUG_STM32_UART
--extra-cflags=-DDEBUG_STM32_TIMER
Print debug statements for specific peripherals.
--extra-cflags=-DSTM32_UART_NO_BAUD_DELAY
Disable the BAUD rate timing simulation
(i.e. the UART will transmit or receive as fast as possible, rather than
using a realistic delay).
--extra-cflags=-DSTM32_UART_ENABLE_OVERRUN
Enable setting of the overrun flag if a character is
received before the last one is processed. If this is not set, the UART
will not receive the next character until the previous one is read by
software. Although less realisitic, this is safer in case the VM is
running slow.
Other QEMU configure options which are useful for troubleshooting:
--extra-cflags=-DDEBUG_GIC
qemu-system-arm options which are useful for trobuleshooting:
-d ?
To see available log levels
-d unimp,guest
Enable logging to view warnings when an unimplemented register is
accessed or when an invalid register access is attempted. This is
especially useful since many registers are not implemented.
-d cpu,in_asm
Enable logging to view the CPU state during execution and the ARM
instructions which are being executed. I believe --enable-debug must be
used for this to work.
By default, you can find the output in /tmp/qemu.log:
UNIT TESTING
Unit test scripts are included for the STM32 implementation.
These test will be executed when running "make" with the standard
check targets (see tests/Makefile for documentation of QEMU's unit
testing features):
make check
make check-qtest-arm
DOCKER CONTAINER
A Docker container containing qemu_stm32 can be built from the Dockerfile:
docker build . -t qemu_stm32
It can run the examples in stm32_p103_demos:
docker run --rm qemu_stm32 /usr/local/bin/qemu-system-arm -M stm32-p103 -kernel /stm32_p103_demos/demos/freertos_singlethread/main.bin
The original QEMU README follows:
Read the documentation in qemu-doc.html or on http://wiki.qemu-project.org
- QEMU team