RTEMS on QEMU emulated RPi and RPi2
Pavel Pisa
ppisa4lists at pikron.com
Thu May 26 20:05:48 UTC 2016
Hello Mudit and others,
On Thursday 26 of May 2016 17:57:21 Pavel Pisa wrote:
>
> ~/repo/qemu/qemu-build/arm-softmmu/qemu-system-arm \
> -M raspi2 \
> -serial stdio \
> -s -S
>
> The last two options enable GDB support and stop QEMU
> after initialization. I redirect serial line I/O
> to console to ease capture and copy pasting.
Running application image without GDB
It seems that QEMU -kernel parameter does not cope with plain binary
image but it accepts on only zImage but even U-boot memory images.
So running RTEMS RPi2 application directly on QEMU is easy when
you have installed u-boot-tools or equivalent package
--------------------------------------------------------------------------------
EXE_NAME=rtems/arm-rtems4.12/c/raspberrypi2/testsuites/samples/ticker/ticker.exe
arm-rtems4.12-objcopy -R -S --strip-debug -O binary "$EXE_NAME" "$EXE_NAME.bin" || exit 1
cat "$EXE_NAME.bin" | gzip -9 >"$EXE_NAME.gz"
mkimage \
-A arm -O rtems -T kernel -a $START_ADDR -e $START_ADDR -n "RTEMS" \
-d "$EXE_NAME.gz" "$EXE_NAME.img"
qemu-system-arm -M raspi2 \
-serial stdio \
-kernel "$EXE_NAME.img"
--------------------------------------------------------------------------------
I have found what has been cause of memory access fault
when I force graphic console output in RTEMS ticker RPi2 image when I attempt
to run it under QEMU.
I set memory mapping for framebuffer in rpi_fb_init() according
to the value returned by VideoCore
arm_cp15_set_translation_table_entries( (void *) fb_fix_info.smem_start,
(void *) fb_fix_info.smem_start +
fb_fix_info.smem_len,
ARMV7_MMU_DATA_READ_WRITE_CACHED );
due to QEMU bug, bcm2835_mailbox_init_frame_buffer reports memory region
size of framebuffer for old configuration and not new one after initialization.
This QEMU mainline commit solves the problem
commit 27a5dc7be6a55b60039e39206eed2734ea166a47
Author: Sylvain Garrigues <sylvain at sylvaingarrigues.com>
Date: Thu May 12 13:22:25 2016 +0100
So I have RTEMS applications to start and print well to serial port
console and framebuffer under QEMU now. There is problem with timer
(I expect on QEMU side) still.
This should be put to some BSP related Wiki page.
Because that TBR on RTEMS Wiki list disqualifies these pages
as the best place to store valuable information in,
I have added this information to our university group RPi
related pages for now.
https://rtime.felk.cvut.cz/hw/index.php/Raspberry_Pi#Running_RTEMS_Under_RPi2_QEMU
Best wishes,
Pavel
More information about the devel
mailing list