Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QEMU as an Embedded Simulator for Firmware Testing

I've been looking at QEMU for a while now and I've been trying to find out if I can use it to simulate a device that we are developing.

The device will be powered by an ARM Cortex M3 and QEMU is well suited for emulation of its software.

What I want to know is if anyone has used QEMU in the past as a simulator?

The intent is to use QEMU to do black-box testing of the software before rolling it out to the devices in the field.

This would involve being able to monitor and modify the memory location in which your Parallel Input/Output (PIO) pins are configured and set and the memory locations of all other peripherals externally.

Now, considering that some of the peripherals would be PWM and UART, it is clear that there will be a need to resolve synchronization issues. However, I would like to avoid this topic for the time being and stick only to simple PIO.

The QEMU Monitor gets close but is not quite there yet.

So to summarize:

I need to know if there is a way to interrupt QEMU after each CPU clock cycle and read/write to a small number of memory locations in the code memory.

like image 241
nonsensickle Avatar asked Apr 29 '13 22:04

nonsensickle


1 Answers

Did you try to use GDB stub ? You can use -s -S and connect through gdb by target remote :1234. This will give you control over program executed inside vm and access to registers and memory.

like image 86
Piotr Król Avatar answered Sep 18 '22 19:09

Piotr Król