2014-09-28 20:48:04 +00:00
|
|
|
#
|
|
|
|
# Makefile for STM32-F103RB Nucleo board with CC256x Bluetooth modules
|
|
|
|
#
|
|
|
|
|
2014-09-29 21:08:37 +00:00
|
|
|
# BINARY=led_counter
|
2014-11-06 21:14:37 +00:00
|
|
|
BINARY=spp_and_le_counter
|
2014-09-28 20:48:04 +00:00
|
|
|
OPENCM3_DIR = libopencm3
|
|
|
|
LDSCRIPT = stm32f1-nucleo.ld
|
|
|
|
|
|
|
|
BTSTACK_ROOT = ../..
|
2014-11-06 21:18:37 +00:00
|
|
|
VPATH = $(BTSTACK_ROOT)/example/embedded
|
|
|
|
VPATH += $(BTSTACK_ROOT)/src
|
2015-11-13 14:04:41 +00:00
|
|
|
VPATH += $(BTSTACK_ROOT)/src/ble
|
|
|
|
VPATH += $(BTSTACK_ROOT)/src/classic
|
|
|
|
VPATH += $(BTSTACK_ROOT)/platform/embedded
|
2015-10-15 14:58:46 +00:00
|
|
|
VPATH += $(BTSTACK_ROOT)/chipset/cc256x
|
2014-09-28 20:48:04 +00:00
|
|
|
|
2015-11-13 14:04:41 +00:00
|
|
|
CORE = \
|
2014-11-06 21:18:37 +00:00
|
|
|
main.c \
|
|
|
|
btstack_memory.c \
|
|
|
|
linked_list.c \
|
|
|
|
memory_pool.c \
|
|
|
|
run_loop.c \
|
|
|
|
run_loop_embedded.c
|
2014-09-28 20:48:04 +00:00
|
|
|
|
2014-09-29 21:08:37 +00:00
|
|
|
COMMON = \
|
2014-11-06 21:18:37 +00:00
|
|
|
bt_control_cc256x.c \
|
2015-05-01 22:38:11 +00:00
|
|
|
bluetooth_init_cc2564B_1.2_BT_Spec_4.1.c \
|
2014-11-06 21:18:37 +00:00
|
|
|
hci.c \
|
|
|
|
hci_cmds.c \
|
|
|
|
hci_dump.c \
|
|
|
|
hci_transport_h4_ehcill_dma.c \
|
|
|
|
l2cap.c \
|
|
|
|
l2cap_signaling.c \
|
|
|
|
remote_device_db_memory.c \
|
|
|
|
rfcomm.c \
|
|
|
|
sdp.c \
|
|
|
|
sdp_util.c \
|
|
|
|
utils.c \
|
|
|
|
sdp_parser.c \
|
|
|
|
sdp_client.c \
|
|
|
|
sdp_query_util.c \
|
|
|
|
sdp_query_rfcomm.c \
|
2014-09-29 21:08:37 +00:00
|
|
|
|
2014-10-02 21:41:29 +00:00
|
|
|
BLE = \
|
2014-11-06 21:18:37 +00:00
|
|
|
att.c \
|
|
|
|
att_server.c \
|
2015-03-02 21:40:56 +00:00
|
|
|
le_device_db_memory.c \
|
2014-11-06 21:18:37 +00:00
|
|
|
sm.c \
|
|
|
|
att_dispatch.c \
|
|
|
|
# gatt_client.c \
|
2014-10-02 21:41:29 +00:00
|
|
|
|
2014-09-28 20:48:04 +00:00
|
|
|
CORE_OBJ = $(CORE:.c=.o)
|
2015-11-13 14:04:41 +00:00
|
|
|
COMMON_OBJ = $(COMMON:.c=.o)
|
|
|
|
BLE_OBJ = $(BLE:.c=.o)
|
2014-09-28 20:48:04 +00:00
|
|
|
|
2014-10-04 17:57:35 +00:00
|
|
|
OBJS += $(CORE_OBJ) $(COMMON_OBJ) $(BLE_OBJ)
|
2014-09-28 20:48:04 +00:00
|
|
|
|
2015-11-13 14:04:41 +00:00
|
|
|
CFLAGS = -I. \
|
|
|
|
-I$(BTSTACK_ROOT)/platform/embedded \
|
|
|
|
-I$(BTSTACK_ROOT)/src \
|
|
|
|
-I$(BTSTACK_ROOT)/chipset/cc256x
|
2014-09-28 20:48:04 +00:00
|
|
|
|
2014-11-06 20:56:45 +00:00
|
|
|
examples: libopencm3/lib/libopencm3_stm32f1.a spp_and_le_counter.h spp_and_le_counter.elf
|
2014-09-28 20:48:04 +00:00
|
|
|
|
|
|
|
include libopencm3.stm32f1.mk
|
|
|
|
|
2015-05-01 22:38:11 +00:00
|
|
|
# fetch and convert init scripts
|
2015-10-15 14:58:46 +00:00
|
|
|
include ${BTSTACK_ROOT}/chipset/cc256x/Makefile.inc
|
2015-05-01 22:38:11 +00:00
|
|
|
|
2014-11-06 21:18:37 +00:00
|
|
|
# clean:
|
2015-10-15 14:58:46 +00:00
|
|
|
# rm -f *.map *.o *.d *.out *.elf *.bin *.hex ../driver/*.o ../../src/*.o ../../ble/*.o ../firmware/*.o ${BTSTACK_ROOT}/chipset/cc256x/*.o ${BTSTACK_ROOT}/src/*.o
|
2014-09-28 20:48:04 +00:00
|
|
|
|
|
|
|
# git clone and compile libopencm3
|
|
|
|
libopencm3/lib/libopencm3_stm32f1.a:
|
2015-05-06 20:40:52 +00:00
|
|
|
git clone https://github.com/libopencm3/libopencm3.git
|
2014-09-28 20:48:04 +00:00
|
|
|
make -C libopencm3
|
|
|
|
|
2014-10-02 21:41:29 +00:00
|
|
|
# compile GATT database
|
|
|
|
spp_and_le_counter.h: spp_and_le_counter.gatt
|
2015-11-13 14:04:41 +00:00
|
|
|
python ${BTSTACK_ROOT}/tool/compile-gatt.py $< $@
|
2014-10-02 21:41:29 +00:00
|
|
|
|