From a76ff755e36c2a84ac3a33cfbda08614dfea7b01 Mon Sep 17 00:00:00 2001 From: Glenn Ruben Bakke Date: Fri, 21 Apr 2017 18:55:59 +0200 Subject: [PATCH] nrf5/bluetooth: Adding back SOFTDEV_HEX as flash tools in main Makefile uses this to locate hex file. --- nrf5/bluetooth/bluetooth_common.mk | 39 +++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/nrf5/bluetooth/bluetooth_common.mk b/nrf5/bluetooth/bluetooth_common.mk index 21aa9bafbe..db31093e00 100644 --- a/nrf5/bluetooth/bluetooth_common.mk +++ b/nrf5/bluetooth/bluetooth_common.mk @@ -1,26 +1,53 @@ SOFTDEV_HEX_NAME ?= +SOFTDEV_HEX_PATH ?= ifeq ($(SD), s110) - INC += -I$(SDK_ROOT)components/softdevice/$(SD)/headers + SOFTDEV_VERSION = 8.0.0 + INC += -Ibluetooth/$(SD)_$(MCU_VARIANT)_$(SOFTDEV_VERSION)/softdevice/$(SD)/headers CFLAGS += -DBLUETOOTH_SD_DEBUG=1 CFLAGS += -DBLUETOOTH_SD=110 - SOFTDEV_HEX_NAME = s110_nrf51_8.0.0_softdevice.hex + SOFTDEV_HEX_NAME = $(SD)_$(MCU_VARIANT)_$(SOFTDEV_VERSION)_softdevice.hex + SOFTDEV_HEX_PATH = bluetooth/$(SD)_$(MCU_VARIANT)_$(SOFTDEV_VERSION)/softdevice/$(SD)/hex + else ifeq ($(SD), s120) $(error No BLE wrapper available yet) else ifeq ($(SD), s130) $(error No BLE wrapper available yet) else ifeq ($(SD), s132) - INC += -I$(SDK_ROOT)components/softdevice/$(SD)/headers - INC += -I$(SDK_ROOT)components/softdevice/$(SD)/headers/$(MCU_VARIANT) + SOFTDEV_VERSION=3.0.0 + INC += -Ibluetooth/$(SD)_$(MCU_VARIANT)_$(SOFTDEV_VERSION)/softdevice/$(SD)/headers + INC += -Ibluetooth/$(SD)_$(MCU_VARIANT)_$(SOFTDEV_VERSION)/softdevice/$(SD)/headers/$(MCU_VARIANT) CFLAGS += -DBLUETOOTH_SD_DEBUG=1 CFLAGS += -DBLUETOOTH_SD=132 - SOFTDEV_HEX_NAME = s132_nrf52_3.0.0_softdevice.hex + SOFTDEV_HEX_NAME = $(SD)_$(MCU_VARIANT)_$(SOFTDEV_VERSION)_softdevice.hex + SOFTDEV_HEX_PATH = bluetooth/$(SD)_$(MCU_VARIANT)_$(SOFTDEV_VERSION)/softdevice/$(SD)/hex else $(error Incorrect softdevice set flag) endif -SOFTDEV_HEX = $(lastword $(wildcard $(SDK_ROOT)/components/softdevice/$(SD)/hex/$(SOFTDEV_HEX_NAME))) +define STACK_MISSING_ERROR + + +###### ERROR: Bluetooth LE Stack not found ############ +# # +# The build target requires a Bluetooth LE stack. # +# $(SD)_$(MCU_VARIANT)_$(SOFTDEV_VERSION) Bluetooth LE stack not found. # +# # +# Please run the download script: # +# # +# bluetooth/download_ble_stack.sh # +# # +####################################################### + +endef + + +SOFTDEV_HEX = $(SOFTDEV_HEX_PATH)/$(SOFTDEV_HEX_NAME) + +ifeq ($(shell test ! -e $(SOFTDEV_HEX) && echo -n no),no) + $(error $(STACK_MISSING_ERROR)) +endif INC += -I./bluetooth