Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

VFP register arguments error

Hello,

I am working with custom board nrf52840 and SDK 17. I am doing some changes to the project and I am getting an error that the SDK is using VFP register arguments but my project isn't.
My project can't use VFP registers anymore due to an external library I must use.
I know that this is related to the ABI type and my project needs to support only arm_fp_abi="SoftFP" instead of "Hard".

How can I modify the SDK that will solve the VFP register argument error?
 

thanks 

  • Hi,

    There are a few changes that needs to be made, depending on which other libraries you use. I suggest you compare with an example project for a device without FPU (for instance project for pca10040e, which is for nRF52810 emulation on nRF52832 DK). In addition to selecting the correct libraries you also need to adjust the compiler setting. This is toolchain dependent, but if you for instance use SES you can edit the project file (.emProject) in an editor and change the following section:

          arm_fp_abi="Hard"
          arm_fpu_type="FPv4-SP-D16"

    to:

          arm_fp_abi="Soft"
          arm_fpu_type="Soft"

  • Hi Einar,

    Thank you for your response. I have a few follow up questions:

    1. I studied the FPU and found out that there are three types of fp_abi: soft, softFP and hard.  I think the best type for my project is softFP, so changed the setting: 

    arm_fp_abi="SoftFP"
    arm_fpu_type="FPv4-SP-D16"

    Will these changes work as well?

    2. After changing this project file, I received the error that the SDK (I'm using SDK17 ) libraries(for example  libnrf_cc310_0.9.13.a,nfc_t2t_lib_gcc, libarm_cortexM4lf_math.a) are using the VFP registers but my project is not.
    Is there a guide for modifying the SDK to use arm_fp_abi=SoftFP?

  • Hi,

    1. We don't use SoftFP but it should work combined with libraries built for soft float.

    2. You need to replace all prebuilt libraries with libraries that is not using hard float. For libnrf_cc310_0.9.13 you can find a soft float variant under <SDK>external\nrf_cc310\lib\cortex-m4\soft-float\. And for libarm_cortexM4lf_math there is a libarm_cortexM4l_math (no "f") which I think should work.

  • Hi,
    Thank you very much, my project was built successfully!

    Do you know how changing the FPU settings will affect the performance?

  • Hi,

    I am glad to hear you got it working. The impacts on performance depends on the usage. If your code does not rely on floating point operations it will not have any impart, and if it does a lot of floating point operations it will have a significant impact. Most nRF based projects do not use floating point operations, and in that case there will not be any difference in performance. 

Related