Reputation: 51
I'm trying to start emulation of ARM Cortex-M7 device (the only machine with this mcu is mps2-an500). While STM43F4-Discovery emulation works ok on legacy QEMU xpack binary (qemu-system-gnuarmeclipse.exe), I cannot start emulation of Cortex-M7 type of machine.
I also couldn't find any examples on how to call xPack QEMU properly from command line.
I'm getting this and process ends after few seconds:
xPacks\@xpack-dev-tools\qemu-arm\7.0.0-1.1\.content\bin>qemu-system-arm.exe -s -machine mps2-an500 -cpu cortex-m7 -d unimp,guest_errors
Invalid write at addr 0xFFFFFFE0, size 4, region '(null)', reason: rejected
qemu: fatal: Lockup: can't escalate 3 to HardFault (current priority -1)
R00=00000000 R01=00000000 R02=00000000 R03=00000000
R04=00000000 R05=00000000 R06=00000000 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=ffffffe0 R14=fffffff9 R15=00000000
XPSR=40000003 -Z-- A handler
s00=00000000 s01=00000000 d00=0000000000000000
s02=00000000 s03=00000000 d01=0000000000000000
s04=00000000 s05=00000000 d02=0000000000000000
s06=00000000 s07=00000000 d03=0000000000000000
s08=00000000 s09=00000000 d04=0000000000000000
s10=00000000 s11=00000000 d05=0000000000000000
s12=00000000 s13=00000000 d06=0000000000000000
s14=00000000 s15=00000000 d07=0000000000000000
s16=00000000 s17=00000000 d08=0000000000000000
s18=00000000 s19=00000000 d09=0000000000000000
s20=00000000 s21=00000000 d10=0000000000000000
s22=00000000 s23=00000000 d11=0000000000000000
s24=00000000 s25=00000000 d12=0000000000000000
s26=00000000 s27=00000000 d13=0000000000000000
s28=00000000 s29=00000000 d14=0000000000000000
s30=00000000 s31=00000000 d15=0000000000000000
FPSCR: 00000000
What is the proper command line to do this ?
Thanks in advance, regards
Upvotes: 0
Views: 367
Reputation: 11383
You haven't provided any kind of guest image to execute. QEMU is therefore correctly emulating the behaviour of an M-profile CPU when you start it on totally empty all-zeroes memory, which is to say that it will end up taking a sequence of exceptions that culminate in it going into the architectural "Lockup" state, which is the CPU saying "the software is completely broken and I cannot continue trying to do anything more with it".
You need to provide a guest image, using one of QEMU's several mechanisms for that (eg the -kernel option or the 'generic loader' device), and that image needs to have been built correctly to run on the machine type you ask QEMU to emulate (mps2-an500, in this case.)
Upvotes: 1