Enabling Hardware Floating Point Unit in Zephyr

Hi,

I want to use FPU for nRF52832 project.

How can I enable FPU in Zephyr project?

My SDK Version is 2.5.0

Parents Reply Children
  • Hi,

     

    Do you need to print float variables? If yes, please see what  suggested: 

    Shahin97 said:
    CONFIG_CBPRINTF_FP_SUPPORT=y

    If you search around on the forum, you will see many other threads on this matter as well.

     

    Kind regards,

    Håkon

  • I'm already applied it.

    I want to use FPU features.

    I'm developing Attitude & Heading Reference System.

    When I applied my algorithm using Eclipse + nRF52 SDK, update rate is over 250Hz.

    But in zephyr environment, I can get only 82Hz with same code.

    I think this difference is caused from FPU activation.

  • CONFIG_CBPRINTF_FP_SUPPORT=y will only help for print functions to handle 

    That does indeed sound like FPU is not activated, or that something else in your system is running with the same priority (logging for instance).

    Can you try to set both CONFIG_FPU=y and CONFIG_FPU_SHARING=y?

     

    Is floating point ABI selected to be "CONFIG_FP_HARDABI"? This should be default selected.

    To emit warnings on double promotion, I would recommend that you also add this:

    CONFIG_COMPILER_OPT="-Wdouble-promotion"

     

    If you log/print in the algorithm routines, please ensure that you set CONFIG_LOG=y and have selected deferred mode (CONFIG_LOG_MODE_DEFERRED)

     

    Kind regards,

    Håkon

Related