From ce9de0e942f67c839a934fc23e9897479c5a0ea8 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Sat, 25 May 2019 22:52:30 +0200 Subject: [PATCH 1/2] boards/microbit: add EMULATOR setting for QEMU 4.0 --- boards/microbit/Makefile.include | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/boards/microbit/Makefile.include b/boards/microbit/Makefile.include index 1ecc745974..3371ba06c5 100644 --- a/boards/microbit/Makefile.include +++ b/boards/microbit/Makefile.include @@ -14,5 +14,12 @@ else ifeq (pyocd,$(PROGRAMMER)) include $(RIOTMAKE)/tools/pyocd.inc.mk endif +# QEMU 4.0 added microbit system emulation. +EMULATOR = qemu-system-arm +EMULATOR_FLAGS = -M microbit -device loader,file=$(ELFFILE) \ + -serial stdio \ + -monitor telnet::45454,server,nowait \ + -nographic + # include nrf51 boards common configuration include $(RIOTBOARD)/common/nrf51/Makefile.include From f03bba8d5c2d452aa1d4790a5e9d5360532396c4 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Thu, 4 Jul 2019 16:26:19 +0200 Subject: [PATCH 2/2] boards/microbit: add docuumentation for QEMU emulation --- boards/microbit/doc.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/boards/microbit/doc.txt b/boards/microbit/doc.txt index 698e45fdc3..f09edf5c3a 100644 --- a/boards/microbit/doc.txt +++ b/boards/microbit/doc.txt @@ -77,4 +77,23 @@ With the JLink firmware, you can now also do in-circuit debugging etc. **Note: The current version of the JLink firmware (JLink_OB_BBC_microbit_16-07-29.hex) does not support any serial port over USB, so you can not use the RIOT shell with this firmware.** + + +### QEMU emulation + +The microbit can be partly emulated by QEMU. + +This requires at least QEMU 4.0 with ARM platform support enabled. + +*NOTE*: not all peripherals are emulated. See +[this](https://wiki.qemu.org/Features/MicroBit) page for an overview. +E.g., there's no emulation for the radio, thus applications using that will +fail. + +Use it like this: + + $ cd examples/hello-world + $ BOARD=microbit make clean all -j4 + $ BOARD=microbit make emulate + */