qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-arm] QEMU user mode for cortex M


From: Massimiliano Cialdi
Subject: Re: [Qemu-arm] QEMU user mode for cortex M
Date: Fri, 15 Mar 2019 23:12:37 +0100


I have my exetutable compiled with
/opt/gcc-arm-none-eabi-8-2018-q4-major/bin/arm-none-eabi-gcc -std=gnu11 -mcpu=cortex-m7 -mthumb -mfloat-abi=hard -mfpu=fpv5-d16 -fno-common -specs=rdimon.specs -Wl,--cref,-Map=main.map main.c -o main.elf

then I try to execute qemu:
~/Downloads/qemu/qemu-3.1.0/arm-softmmu/qemu-system-arm -d unimp,guest_errors -machine virt -monitor null -serial null  -semihosting -nographic -semihosting-config enable=on,target=native -kernel main.elf
pflash_write: Unimplemented flash cmd sequence (offset 0000000003fffffc, wcycle 0x0 cmd 0x0 value 0x80f7)
pflash_write: Unimplemented flash cmd sequence (offset 0000000003ffffcc, wcycle 0x0 cmd 0x0 value 0xa984)
pflash_write: Unimplemented flash cmd sequence (offset 0000000003ffffd4, wcycle 0x0 cmd 0x0 value 0x3)
pflash_write: Unimplemented flash cmd sequence (offset 0000000003ffffbc, wcycle 0x0 cmd 0x0 value 0x1b368)
pflash_write: Unimplemented flash cmd sequence (offset 0000000003ffffc0, wcycle 0x0 cmd 0x0 value 0x1b304)
pflash_write: Unimplemented flash cmd sequence (offset 0000000003ffffc4, wcycle 0x0 cmd 0x0 value 0xa6cb)
pflash_write: Unimplemented flash cmd sequence (offset 000000000001b304, wcycle 0x0 cmd 0x0 value 0x1)
pflash_write: Unimplemented flash cmd sequence (offset 0000000003ffff94, wcycle 0x0 cmd 0x0 value 0x1b304)
pflash_write: Unimplemented flash cmd sequence (offset 0000000003ffffa4, wcycle 0x0 cmd 0x0 value 0xa984)
pflash_write: Unimplemented flash cmd sequence (offset 0000000003ffffac, wcycle 0x0 cmd 0x0 value 0xa617)
pflash_write: Unimplemented flash cmd sequence (offset 0000000003ffff6c, wcycle 0x0 cmd 0x0 value 0x1b304)
pflash_write: Unimplemented flash cmd sequence (offset 0000000003ffff74, wcycle 0x0 cmd 0x0 value 0x1)
pflash_write: Unimplemented flash cmd sequence (offset 0000000003ffff78, wcycle 0x0 cmd 0x0 value 0x7ffffb4)
pflash_write: Unimplemented flash cmd sequence (offset 0000000003ffff84, wcycle 0x0 cmd 0x0 value 0xa545)
pflash_write: Unimplemented flash cmd sequence (offset 000000000001aac0, wcycle 0x0 cmd 0x0 value 0x18)
write access to unsupported AArch32 64 bit system register cp:12 opc1: 15 crm:8 (non-secure)


and nothing happend. Where am I wrong? I'm wrong at the compilation stage, at the execution stage or both? Is there something wrong with the command line parameters? Which one? How do I force a cortex-m4? How can I force the Cpu without having to choose any machine?

best regards
Max

On Fri, Mar 15, 2019 at 11:05 AM Peter Maydell <address@hidden> wrote:
On Thu, 14 Mar 2019 at 22:30, Massimiliano Cialdi <address@hidden> wrote:
>
> hello,
> I would like to try some algorithms on cortex M (especially cortex M4). I don't need to emulate the whole machine, I just need the user mode.
> To test the feasibility, I wrote the trivial "hello world".
>
> I can compile it with arm-none-eabi-gcc, but the newlib associated with it does not implement any syscall.
> So I tried, on ubuntu, with the cross compiler arm-linux-gnueabihf-gcc and its libc6, but the latter is only distributed for cortex A.
>
> What do you suggest? Should I recompile the libc6 for cortex M (or do I find it pre-compiled)? Should I implement (and how?) syscalls on newlib?
>
> In summary, I would need a step-by-step guide to running Cortex M code on QEMU arm user mode.

User-mode in Cortex-M is a weird thing to do, because what QEMU
gives you is the A-profile Linux syscalls. It's a hybrid that
we only continue to provide because it happens to be used and
useful to the gcc folks doing compiler testing. I would
recommend against using it, personally.

System emulation mode will get you something that actually
works the way the real hardware does. You can then do
output either via the UART or via semihosting (you need to
enable the latter on the commandline).

thanks
-- PMM


--
Et nunc, auxilium solis, vincam!
Oppugnatio solaris!
VIS!

Massimiliano Cialdi
address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]