File: target-avr.rst

package info (click to toggle)
qemu 1%3A10.0.3%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 413,648 kB
  • sloc: ansic: 4,733,433; pascal: 114,769; python: 105,506; asm: 68,406; sh: 52,878; makefile: 27,469; perl: 18,778; cpp: 11,435; xml: 3,404; objc: 2,877; yacc: 2,505; php: 1,299; tcl: 1,296; lex: 1,110; sql: 71; awk: 43; sed: 35; javascript: 7
file content (48 lines) | stat: -rw-r--r-- 1,426 bytes parent folder | download | duplicates (7)
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
.. _AVR-System-emulator:

AVR System emulator
-------------------

Use the executable ``qemu-system-avr`` to emulate a AVR 8 bit based machine.
These can have one of the following cores: avr1, avr2, avr25, avr3, avr31,
avr35, avr4, avr5, avr51, avr6, avrtiny, xmega2, xmega3, xmega4, xmega5,
xmega6 and xmega7.

As for now it supports few Arduino boards for educational and testing purposes.
These boards use a ATmega controller, which model is limited to USART & 16-bit
timer devices, enough to run FreeRTOS based applications (like
https://github.com/seharris/qemu-avr-tests/blob/master/free-rtos/Demo/AVR_ATMega2560_GCC/demo.elf
).

Following are examples of possible usages, assuming demo.elf is compiled for
AVR cpu

- Continuous non interrupted execution::

   qemu-system-avr -machine mega2560 -bios demo.elf

- Continuous non interrupted execution with serial output into telnet window::

   qemu-system-avr -M mega2560 -bios demo.elf -nographic \
                   -serial tcp::5678,server=on,wait=off

  and then in another shell::

   telnet localhost 5678

- Debugging with GDB debugger::

   qemu-system-avr -machine mega2560 -bios demo.elf -s -S

  and then in another shell::

   avr-gdb demo.elf

  and then within GDB shell::

   target remote :1234

- Print out executed instructions (that have not been translated by the JIT
  compiler yet)::

   qemu-system-avr -machine mega2560 -bios demo.elf -d in_asm