Math lib inclusion in BSP

sudarshan.rajagopalan sudarshan.rajagopalan at vecna.com
Fri Sep 25 17:13:53 UTC 2015


On 2015-09-25 12:21, Daniel Gutson wrote:
> El 25/9/2015 13:17, "sudarshan.rajagopalan"
> <sudarshan.rajagopalan at vecna.com> escribió:
>  >
>  > On 2015-09-25 11:06, Daniel Gutson wrote:
>  >>
>  >> On Thu, Sep 24, 2015 at 4:49 PM, sudarshan.rajagopalan
>  >> <sudarshan.rajagopalan at vecna.com> wrote:
>  >>>
>  >>> Hey all,
>  >>>
>  >>> We are developing a new BSP that uses math.h in few of the BSP
> files. I do
>  >>
>  >>
>  >> May I ask why do you need floating point operations in a kernel?
> At
>  >> least, what sort of operations and why not move them upwards.
>  >
>  >
>  > We are doing floating point operations in one of the device drivers
> as part of the BSP - to perform buadrate calculation, to be specific,
> which involes inverse operations and using roundf().
> 
> How will you handle fp exceptions?
>  Did you consider using fixed point?

We haven't implemented any error handling yet. We will do so in our next 
phase. And I think we decided to use floating-point due to the available 
FPU hardware support in the processor( ARM Cortex-M4 and M7) to make 
these operations faster. Are there any concerns that we should be aware 
of while using floating-point operations in the BSP?

>  >
>  >
>  >>
>  >>> understand that the math library functions are not part of
> standard C
>  >>> library and has to be linked using "-lm". So I include "LD_LIBS
> += -lm" in
>  >>> the custom .cgf config file but this doesn't seem to work. I
> think this has
>  >>> to be linked in a proper order. Could someone help with this?
>  >>>
>  >>> Heres the custom config file:
>  >>>
>  >>> include $(RTEMS_ROOT)/make/custom/default.cfg
>  >>>
>  >>> RTEMS_CPU = arm
>  >>>
>  >>> LD_LIBS += -lm
>  >>>
>  >>> CPU_CFLAGS = -march=armv7-m -mthumb
>  >>>
>  >>> CFLAGS_OPTIMIZE_V = -O0 -g -mfloat-abi=hard -mfpu=fpv4-sp-d16
>  >>>
>  >>> Thanks and Regards,
>  >>> Sudarshan
>  >>> _______________________________________________
>  >>> devel mailing list
>  >>> devel at rtems.org
>  >>> http://lists.rtems.org/mailman/listinfo/devel [1]
>  >
>  >
> 
> 
> Links:
> ------
> [1] http://lists.rtems.org/mailman/listinfo/devel




More information about the devel mailing list