Skip to content

Commit f5d31d6

Browse files
michaelrolnikphilmd
authored andcommitted
tests/acceptance: Test the Arduino MEGA2560 board
The test is based on https://github.com/seharris/qemu-avr-tests/tree/master/free-rtos/Demo demo which. If working correctly, prints 'ABCDEFGHIJKLMNOPQRSTUVWX' out. it also demostrates that timer and IRQ are working As the path name demonstrates, the FreeRTOS tests target a board based on a ATMega2560 MCU. We have one, the Arduino MEGA2560. Complementary documentation: https://feilipu.me/2012/01/15/ethermega-arduino-mega-2560-and-freertos/ https://feilipu.me/2015/11/24/arduino_freertos/ (see 'Compatibility') Signed-off-by: Michael Rolnik <[email protected]> Signed-off-by: Philippe Mathieu-Daudé <[email protected]> [rth: Squash multiple avocado fixups from f4bug] Signed-off-by: Richard Henderson <[email protected]> Signed-off-by: Aleksandar Markovic <[email protected]> Tested-by: Richard Henderson <[email protected]> Tested-by: Philippe Mathieu-Daudé <[email protected]> Acked-by: Thomas Huth <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
1 parent 36838e5 commit f5d31d6

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ R: Sarah Harris <[email protected]>
173173
S: Maintained
174174
F: gdb-xml/avr-cpu.xml
175175
F: target/avr/
176+
F: tests/acceptance/machine_avr6.py
176177

177178
CRIS TCG CPUs
178179
M: Edgar E. Iglesias <[email protected]>

tests/acceptance/machine_avr6.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#
2+
# QEMU AVR acceptance tests
3+
#
4+
# Copyright (c) 2019-2020 Michael Rolnik <[email protected]>
5+
#
6+
# This program is free software: you can redistribute it and/or modify
7+
# it under the terms of the GNU General Public License as published by
8+
# the Free Software Foundation, either version 2 of the License, or
9+
# (at your option) any later version.
10+
#
11+
# This program is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
# GNU General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU General Public License
17+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
18+
#
19+
20+
import time
21+
22+
from avocado_qemu import Test
23+
24+
class AVR6Machine(Test):
25+
timeout = 5
26+
27+
def test_freertos(self):
28+
"""
29+
:avocado: tags=arch:avr
30+
:avocado: tags=machine:arduino-mega-2560-v3
31+
"""
32+
"""
33+
https://github.com/seharris/qemu-avr-tests/raw/master/free-rtos/Demo/AVR_ATMega2560_GCC/demo.elf
34+
constantly prints out 'ABCDEFGHIJKLMNOPQRSTUVWXABCDEFGHIJKLMNOPQRSTUVWX'
35+
"""
36+
rom_url = ('https://github.com/seharris/qemu-avr-tests'
37+
'/raw/36c3e67b8755dcf/free-rtos/Demo'
38+
'/AVR_ATMega2560_GCC/demo.elf')
39+
rom_hash = '7eb521f511ca8f2622e0a3c5e8dd686efbb911d4'
40+
rom_path = self.fetch_asset(rom_url, asset_hash=rom_hash)
41+
42+
self.vm.add_args('-bios', rom_path)
43+
self.vm.add_args('-nographic')
44+
self.vm.launch()
45+
46+
time.sleep(2)
47+
self.vm.shutdown()
48+
49+
self.assertIn('ABCDEFGHIJKLMNOPQRSTUVWXABCDEFGHIJKLMNOPQRSTUVWX',
50+
self.vm.get_log())

0 commit comments

Comments
 (0)