45
CHAPTER 8
Vector Floating Point support
8.1 Vector Floating Point support
Some Cortex-M4, Cortex-M7 and Cortex-M33 MCUs come with an integrated vectored float-
ing point unit.
When selecting the CPU and activating the VFP support in the project options, the compiler
and linker will add efficient code which uses the VFP when floating point operations are used
in the application. With embOS, the VFP registers are automatically saved and restored
when preemptive or cooperative task switches are performed. For efficiency reasons, em-
bOS does not save and restore the VFP registers for tasks which do not use the VFP unit.
8.1.1 Using embOS libraries with VFP support
When VFP support is selected as project option, one of the embOS libraries with VFP support
have to be used in the project. The embOS libraries for VFP support require that the VFP
is switched on during startup and remains switched on during program execution. Using
your own startup code, ensure that the VFP is switched on during startup. When the VFP
unit is not switched on, the embOS scheduler will fail. The debug version of embOS checks
whether the VFP is switched on when embOS is initialized by calling
OS_Init()
. When the
VFP unit is not detected or not switched on, the embOS error handler
OS_Error()
is called
with error code
OS_ERR_CPU_STATE_ILLEGAL
.
8.1.2 Using the VFP in interrupt service routines
Using the VFP in interrupt service routines does not require any additional functions to save
and restore the VFP registers. The VFP registers are automatically saved and restored by
the hardware.
embOS-MPU for Cortex-M and IAR
© 2010-2020 SEGGER Microcontroller GmbH
Содержание embOS-MPU
Страница 4: ...4 embOS MPU for Cortex M and IAR 2010 2020 SEGGER Microcontroller GmbH ...
Страница 6: ...6 embOS MPU for Cortex M and IAR 2010 2020 SEGGER Microcontroller GmbH ...
Страница 21: ...Chapter 4 CPU and compiler specifics embOS MPU for Cortex M and IAR 2010 2020 SEGGER Microcontroller GmbH ...
Страница 44: ...Chapter 8 VFP support embOS MPU for Cortex M and IAR 2010 2020 SEGGER Microcontroller GmbH ...