This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Adding ARM math library to Segger's nRF52 BLE projects - check __FPU_PRESENT compile error

Hi there~. I tried Nordic's FFT example (SDK 14.2) with a PCA10040 board. So I tried to add that FFT related codes in the heart rate peripheral example. I use the Segger's Embedded Studio 3.30 (SES) on Windows 10 PC.

FFTPre

I compared the preprocessors listed.

PRE00

The heart rate example didn't had the ARM_MATH_CM4 preprocessor, so I added it manually. However, SES threw a compiler error.

SESError

Segger: Adding __FPU_PRESENT to the C/C++ > Preprocessor > Preprocessor Definitions project property if the device you are using has an FPU.

So I manually added the __FPU_PRESENT preprocessor and it was buildable.

PRE11

This build error problem is not my concern. My curious point is that, Nordic's FFT example was buildable even though the project didn't use the __FPU_PRESENT preprocessor. What options were configured to build the SES project, which uses ARM math library and FPU, without using the __FPU_PRESENT preprocessor?

HI

Hi, everybody~ I have created a Google Drive shared link. I figured out how to generate this error! After downloading it, browse nRF5_SDK_14.2.0_17b948a\examples\ble_peripheral\ble_app_hrs\pca10040\s132\ses, and open the SES project, please. Or you can try the Keil MDK 5 project, too.

#include "arm_math.h"
#include "arm_const_structs.h"

If I include the above header files, in main.c, the compiler error doesn't appear. So I created my_foo.c source file. If I include those header files in other source files, it generates the error!

QUESTION: When creating other source files, what extra configurations are needed to include those header files?

Parents
  • Hello, Joakim.

    This looks strange. Both HRS project and FPU_FFT(S132) project uses the nRF5_SDK_14.2.0_17b948a/components/device/nrf52.h

    and it is commonly defined that #define __FPU_PRESENT 1.

    Then why does the #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" appear

    if I don't manually define __FPU_USED in the Embedded Studio's preprocessor menu?

    Since both projects use the same nrf52.h file, adding this looks unnecessary to me.

    Aren't we missing other configuration difference between two projects?

    -Regards, MANGO

Reply
  • Hello, Joakim.

    This looks strange. Both HRS project and FPU_FFT(S132) project uses the nRF5_SDK_14.2.0_17b948a/components/device/nrf52.h

    and it is commonly defined that #define __FPU_PRESENT 1.

    Then why does the #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" appear

    if I don't manually define __FPU_USED in the Embedded Studio's preprocessor menu?

    Since both projects use the same nrf52.h file, adding this looks unnecessary to me.

    Aren't we missing other configuration difference between two projects?

    -Regards, MANGO

Children
No Data
Related