[Top][All Lists]

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

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

From: Peter Maydell
Subject: Re: [Qemu-arm] QEMU user mode for cortex M
Date: Fri, 15 Mar 2019 10:04:55 +0000

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).

-- PMM

reply via email to

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