This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Makefile not including files from Makefile.common

I can't figure out why but my build cannot locate files that are included in the makefile.common I'm using SDK 5.1.0 and the ble_app_hrs project. It seems it can't find one of the files in the source directory.

Here's the Error:

Description	Resource	Path	Location	Type
fatal error: app_error.h: No such file or directory	
battery.c	/ble_app_hrs_PCA10001	line 29	
make: *** [_build/battery.o] Error 1	ble_app_hrs_PCA10001		 

I've tried with the LED project provided and that seems to work. I used it as a template for my makefile. This leads me to believe that the makefile.common is ok. I haven't made any changes to it.

TARGET_CHIP := NRF51822_QFAA_CA
BOARD := BOARD_PCA10001

C_SOURCE_FILES += battery.c
C_SOURCE_FILES += led.c

OUTPUT_FILENAME := ble_app_hrs_gcc
SDK_PATH = ../../../../../


#Uncomment correct line if you have s110 programmed on the chip.
DEVICE_VARIANT := xxaa
#DEVICE_VARIANT := xxab

#USE_SOFTDEVICE := s110
#USE_SOFTDEVICE := s210

include $(SDK_PATH)Source/templates/gcc/Makefile.common
Parents
  • I think that David are correct in that Makefile.common is missing an include path. If you take a look at the default Makefile for ble_app_hrs for nrf6310, you can see that it adds several includepaths:

    
    TARGET_CHIP := NRF51822_QFAA_CA
    BOARD := BOARD_NRF6310
    CFLAGS += -DNRF51822_QFAA_CA -DBLE_STACK_SUPPORT_REQD -DBOARD_NRF6310
    
    C_SOURCE_FILES += main.c
    C_SOURCE_FILES += ../../../../../Source/ble/ble_services/ble_bas.c
    C_SOURCE_FILES += ../../../../../Source/ble/ble_services/ble_dis.c
    C_SOURCE_FILES += ../../../../../Source/ble/ble_services/ble_hrs.c
    C_SOURCE_FILES += ../../../../../Source/ble/ble_services/ble_srv_common.c
    C_SOURCE_FILES += ../../../../../Source/ble/ble_error_log.c
    C_SOURCE_FILES += ../../../../../Source/ble/ble_advdata.c
    C_SOURCE_FILES += ../../../../../Source/ble/ble_sensorsim.c
    C_SOURCE_FILES += ../../../../../Source/sd_common/softdevice_handler.c
    C_SOURCE_FILES += ../../../../../Source/ble/ble_conn_params.c
    C_SOURCE_FILES += ../../../../../Source/ble/ble_bondmngr.c
    C_SOURCE_FILES += ../../../../../Source/app_common/pstorage.c
    C_SOURCE_FILES += ../../../../../Source/app_common/crc16.c
    C_SOURCE_FILES += ../../../../../Source/ble/ble_radio_notification.c
    C_SOURCE_FILES += ../../../../../Source/ble/ble_debug_assert_handler.c
    C_SOURCE_FILES += ../../../../../Source/app_common/app_timer.c
    
    INCLUDEPATHS += -I"../../../../../Include/ble"
    INCLUDEPATHS += -I"../../../../../Include/s110"
    INCLUDEPATHS += -I"../../../../../Include/app_common"
    INCLUDEPATHS += -I"../../../../../Include/ble/ble_services"
    INCLUDEPATHS += -I"../../../../../Include/sd_common"
    SDK_PATH = ../../../../../
    OUTPUT_FILENAME := ble_hrs_gcc
    
    DEVICE_VARIANT := xxaa
    #DEVICE_VARIANT := xxab
    
    USE_SOFTDEVICE := S110
    #USE_SOFTDEVICE := s210
    
    include $(SDK_PATH)Source/templates/gcc/Makefile.common
    
    

    Also, I see that you in your Makefile does not set the USE_SOFTDEVICE variable. If you compile ble_app_hrs, you most likely want to set this, if not, things won't work.

    Finally, you may want to have a look at the GCC setup available here.

Reply
  • I think that David are correct in that Makefile.common is missing an include path. If you take a look at the default Makefile for ble_app_hrs for nrf6310, you can see that it adds several includepaths:

    
    TARGET_CHIP := NRF51822_QFAA_CA
    BOARD := BOARD_NRF6310
    CFLAGS += -DNRF51822_QFAA_CA -DBLE_STACK_SUPPORT_REQD -DBOARD_NRF6310
    
    C_SOURCE_FILES += main.c
    C_SOURCE_FILES += ../../../../../Source/ble/ble_services/ble_bas.c
    C_SOURCE_FILES += ../../../../../Source/ble/ble_services/ble_dis.c
    C_SOURCE_FILES += ../../../../../Source/ble/ble_services/ble_hrs.c
    C_SOURCE_FILES += ../../../../../Source/ble/ble_services/ble_srv_common.c
    C_SOURCE_FILES += ../../../../../Source/ble/ble_error_log.c
    C_SOURCE_FILES += ../../../../../Source/ble/ble_advdata.c
    C_SOURCE_FILES += ../../../../../Source/ble/ble_sensorsim.c
    C_SOURCE_FILES += ../../../../../Source/sd_common/softdevice_handler.c
    C_SOURCE_FILES += ../../../../../Source/ble/ble_conn_params.c
    C_SOURCE_FILES += ../../../../../Source/ble/ble_bondmngr.c
    C_SOURCE_FILES += ../../../../../Source/app_common/pstorage.c
    C_SOURCE_FILES += ../../../../../Source/app_common/crc16.c
    C_SOURCE_FILES += ../../../../../Source/ble/ble_radio_notification.c
    C_SOURCE_FILES += ../../../../../Source/ble/ble_debug_assert_handler.c
    C_SOURCE_FILES += ../../../../../Source/app_common/app_timer.c
    
    INCLUDEPATHS += -I"../../../../../Include/ble"
    INCLUDEPATHS += -I"../../../../../Include/s110"
    INCLUDEPATHS += -I"../../../../../Include/app_common"
    INCLUDEPATHS += -I"../../../../../Include/ble/ble_services"
    INCLUDEPATHS += -I"../../../../../Include/sd_common"
    SDK_PATH = ../../../../../
    OUTPUT_FILENAME := ble_hrs_gcc
    
    DEVICE_VARIANT := xxaa
    #DEVICE_VARIANT := xxab
    
    USE_SOFTDEVICE := S110
    #USE_SOFTDEVICE := s210
    
    include $(SDK_PATH)Source/templates/gcc/Makefile.common
    
    

    Also, I see that you in your Makefile does not set the USE_SOFTDEVICE variable. If you compile ble_app_hrs, you most likely want to set this, if not, things won't work.

    Finally, you may want to have a look at the GCC setup available here.

Children
No Data
Related