Skip to content

Commit c0a659f

Browse files
huthphilmd
authored andcommitted
target/avr: Add section into QEMU documentation
The new section explains basic ways of using AVR target in QEMU. Signed-off-by: Michael Rolnik <[email protected]> [thuth: Converted doc from texi to Sphinx syntax] Signed-off-by: Thomas Huth <[email protected]> Message-Id: <[email protected]> Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
1 parent f5d31d6 commit c0a659f

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

docs/system/target-avr.rst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
.. _AVR-System-emulator:
2+
3+
AVR System emulator
4+
-------------------
5+
6+
Use the executable ``qemu-system-avr`` to emulate a AVR 8 bit based machine.
7+
These can have one of the following cores: avr1, avr2, avr25, avr3, avr31,
8+
avr35, avr4, avr5, avr51, avr6, avrtiny, xmega2, xmega3, xmega4, xmega5,
9+
xmega6 and xmega7.
10+
11+
As for now it supports few Arduino boards for educational and testing purposes.
12+
These boards use a ATmega controller, which model is limited to USART & 16-bit
13+
timer devices, enought to run FreeRTOS based applications (like
14+
https://github.com/seharris/qemu-avr-tests/blob/master/free-rtos/Demo/AVR_ATMega2560_GCC/demo.elf
15+
).
16+
17+
Following are examples of possible usages, assuming demo.elf is compiled for
18+
AVR cpu
19+
20+
- Continuous non interrupted execution:
21+
``qemu-system-avr -machine mega2560 -bios demo.elf``
22+
23+
- Continuous non interrupted execution with serial output into telnet window:
24+
``qemu-system-avr -machine mega2560 -bios demo.elf -serial
25+
tcp::5678,server,nowait -nographic``
26+
and then in another shell
27+
``telnet localhost 5678``
28+
29+
- Debugging wit GDB debugger:
30+
``qemu-system-avr -machine mega2560 -bios demo.elf -s -S``
31+
and then in another shell
32+
``avr-gdb demo.elf``
33+
and then within GDB shell
34+
``target remote :1234``
35+
36+
- Print out executed instructions:
37+
``qemu-system-avr -machine mega2560 -bios demo.elf -d in_asm``

docs/system/targets.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ Contents:
1919
target-xtensa
2020
target-s390x
2121
target-rx
22+
target-avr

0 commit comments

Comments
 (0)