qemu-arm
[Top][All Lists]
Advanced

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

Re: Arm Cortex M4 floating point


From: Mircea Cociuba
Subject: Re: Arm Cortex M4 floating point
Date: Tue, 18 Aug 2020 14:48:15 +0000 (UTC)

Thank you very much Peter,
I will try this first thing in the morning,

But before I try this, if the register is memory mapped, the stelaris memory map has no FPU.
Is the FPU always at core level at the same address?

Br, Mircea


Mircea Cociuba
"To be or not to be, that is not a question, it's FF".


On Tuesday, August 18, 2020, 05:16:39 PM GMT+3, Peter Maydell <peter.maydell@linaro.org> wrote:


On Tue, 18 Aug 2020 at 15:02, Mircea Cociuba <cociuba_mircea@yahoo.com> wrote:
> gcc params: -Wall -Werror -O2 -nostdlib -nostartfiles -ffreestanding  -mcpu=cortex-m4 -mhard-float -mfpu=vfpv4-d16 (to make sure I have FPU instructions)
>
> the source code:
>
> void PUT32 ( unsigned int, unsigned int );
> #define UART0BASE 0x4000C000
>
> int notmain ( void )
> {
>    unsigned int rx;
>
>
>    unsigned char s[]="QEMU is not that interesting";
>
>    //dummy FPU command
>    asm("vmov s15, r3"); // If you are to remove this, the qemu would print after I type the command continue in gdb, with this line, it shows nothing

This looks like you're trying to use the FPU, but you haven't
enabled it. If you're writing bare metal code then it is
the job of your guest code to make sure it enables the FPU
first, exactly as it has to do on real hardware. Check
the Arm architecture reference manual for the details of
how to do this (I think the main thing is writing to the
CPACR to enable the FPU).

Otherwise QEMU will correctly emulate the behaviour you
get on real h/w if you try to use the FPU when it is disabled:
the CPU takes an exception.


thanks
-- PMM

reply via email to

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