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: Peter Maydell
Subject: Re: Arm Cortex M4 floating point
Date: Tue, 18 Aug 2020 15:16:27 +0100

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]