Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 
    SOLVED

    Linker errors on Bsec library

    Linker errors on Bsec library

    bossssie
    New Poster

    I tried implementing the BSEC library in NRF52 sdk on NRF52840. But I get a lot of linker errors like the one below.

    Severity Code Description Project File Line Suppression State
    Error Debug/nrf52840_xxaa.out uses VFP register arguments, C:/Users/Corne/source/repos/SensorNodeNRF/BME680/libalgobsec.a(bsec_interface.o) does not SensorNodeNRF d:\work\tools\arm_gnu\arm-none-eabi\bin\ld.exe 1

    I tried a few settings with the floating point support settings. But no succes.

    What can I try to get this working?

    Corné

    4 REPLIES 4

    Vincent
    Community Moderator
    Community Moderator

    You can also refer to the following link for this error:

    https://forums.xilinx.com/t5/Embedded-Development-Tools/SDK-uses-VFP-register-arguments-error/td-p/9...

    which means the  -mfloat-abi compiling option is different in SDK and our library, you can have a try on modifying this part. Below is the compiling options for our library.

    GCC_CFLAGS_M4  = -c -std=c99 -mcpu=cortex-m4 -mthumb -O2 -fdata-sections -fno-builtin -fno-common

    GCC_CFLAGS_M4_FPU = -c -std=c99 -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -O2 -mthumb -mabi=aapcs -fdata-sections -fno-builtin -fno-common

     

    Thanks for the reply, but i still have no succes when adding these flags. This is the first time for me to directly edit the makefile so this is all a bit new to me.

    As far as I can see the makefile I have as below should be similar to the lines you posted. I also tried adding the lines to the makefile but this gives the same errors. Can you see anything I need to change in the settings bellow.

    # Optimization flags
    OPT = -Os -ggdb3
    # Uncomment the line below to enable link time optimization
    #OPT += -flto

    # C flags common to all targets
    CFLAGS += $(OPT)
    CFLAGS += -DAPP_TIMER_V2
    CFLAGS += -DAPP_TIMER_V2_RTC1_ENABLED
    CFLAGS += -DBOARD_PCA10056
    CFLAGS += -DCONFIG_GPIO_AS_PINRESET
    CFLAGS += -DENABLE_FEM
    CFLAGS += -DFLOAT_ABI_HARD
    CFLAGS += -DNRF52840_XXAA
    CFLAGS += -DZB_ED_ROLE
    CFLAGS += -DZB_TRACE_LEVEL=0
    CFLAGS += -DZB_TRACE_MASK=0
    CFLAGS += -mcpu=cortex-m4
    CFLAGS += -mthumb -mabi=aapcs
    CFLAGS += -Wall -Werror
    CFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16
    # keep every function in a separate section, this allows linker to discard unused ones
    CFLAGS += -ffunction-sections -fdata-sections -fno-strict-aliasing
    CFLAGS += -fno-builtin -fshort-enums -Wno-packed-bitfield-compat

    # C++ flags common to all targets
    CXXFLAGS += $(OPT)
    # Assembler flags common to all targets
    ASMFLAGS += -ggdb3
    ASMFLAGS += -mcpu=cortex-m4
    ASMFLAGS += -mthumb -mabi=aapcs
    ASMFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16
    ASMFLAGS += -DAPP_TIMER_V2
    ASMFLAGS += -DAPP_TIMER_V2_RTC1_ENABLED
    ASMFLAGS += -DBOARD_PCA10056
    ASMFLAGS += -DCONFIG_GPIO_AS_PINRESET
    ASMFLAGS += -DENABLE_FEM
    ASMFLAGS += -DFLOAT_ABI_HARD
    ASMFLAGS += -DNRF52840_XXAA
    ASMFLAGS += -DZB_ED_ROLE

    # Linker flags
    LDFLAGS += $(OPT)
    LDFLAGS += -mthumb -mabi=aapcs -L$(SDK_ROOT)/modules/nrfx/mdk -T$(LINKER_SCRIPT)
    LDFLAGS += -mcpu=cortex-m4
    LDFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16
    # let linker dump unused sections
    LDFLAGS += -Wl,--gc-sections
    # use newlib in nano version
    LDFLAGS += --specs=nano.specs

    handytech
    Community Moderator
    Community Moderator

    In BSEC's release package, you can find two folders for the Cortex M4 and GCC compiler: Cortex_M4F which supports hard FPU, and Cortex_M4 which supports soft FPU. Could it be that you need to import the libalgobsec.a file from the appropriate folder matching your project's settings?

    Ok thats where I went wrong, thanks for pointing out my mistake.

    Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist