mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-04 15:39:59 +00:00
stm32-f4discovery-cc256x: build examples
This commit is contained in:
parent
e72285c600
commit
563abc9410
@ -1,5 +1,5 @@
|
|||||||
##########################################################################################################################
|
##########################################################################################################################
|
||||||
# File automatically-generated by tool: [projectgenerator] version: [3.1.0] date: [Thu Mar 07 18:15:11 CET 2019]
|
# File automatically-generated by tool: [projectgenerator] version: [3.1.0] date: [Thu Mar 07 21:47:00 CET 2019]
|
||||||
##########################################################################################################################
|
##########################################################################################################################
|
||||||
|
|
||||||
# ------------------------------------------------
|
# ------------------------------------------------
|
||||||
@ -31,34 +31,150 @@ OPT = -O2
|
|||||||
# Build path
|
# Build path
|
||||||
BUILD_DIR = build
|
BUILD_DIR = build
|
||||||
|
|
||||||
|
BTSTACK_ROOT = ../..
|
||||||
|
VPATH += ${BTSTACK_ROOT}/3rd-party/micro-ecc
|
||||||
|
VPATH += ${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/srce
|
||||||
|
VPATH += ${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/srce
|
||||||
|
VPATH += ${BTSTACK_ROOT}/3rd-party/hxcmod-player
|
||||||
|
VPATH += ${BTSTACK_ROOT}/3rd-party/hxcmod-player/mods
|
||||||
|
VPATH += ${BTSTACK_ROOT}/3rd-party/md5
|
||||||
|
VPATH += ${BTSTACK_ROOT}/3rd-party/yxml
|
||||||
|
VPATH += ${BTSTACK_ROOT}/3rd-party/segger-rtt
|
||||||
|
VPATH += ${BTSTACK_ROOT}/chipset/cc256x
|
||||||
|
VPATH += ${BTSTACK_ROOT}/example
|
||||||
|
VPATH += ${BTSTACK_ROOT}/platform/embedded
|
||||||
|
VPATH += ${BTSTACK_ROOT}/src
|
||||||
|
VPATH += ${BTSTACK_ROOT}/src/ble
|
||||||
|
VPATH += ${BTSTACK_ROOT}/src/ble/gatt-service
|
||||||
|
VPATH += ${BTSTACK_ROOT}/src/classic
|
||||||
|
VPATH += Drivers/STM32F4xx_HAL_DRIVER/Src
|
||||||
|
VPATH += Src
|
||||||
|
VPATH += port
|
||||||
|
VPATH += port/bsp
|
||||||
|
|
||||||
######################################
|
######################################
|
||||||
# source
|
# source
|
||||||
######################################
|
######################################
|
||||||
# C sources
|
# C sources
|
||||||
C_SOURCES = \
|
C_SOURCES = \
|
||||||
Src/main.c \
|
a2dp_sink.c \
|
||||||
Src/gpio.c \
|
a2dp_source.c \
|
||||||
Src/dma.c \
|
ad_parser.c \
|
||||||
Src/usart.c \
|
ancs_client.c \
|
||||||
Src/stm32f4xx_it.c \
|
att_db.c \
|
||||||
Src/stm32f4xx_hal_msp.c \
|
att_dispatch.c \
|
||||||
Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c \
|
att_server.c \
|
||||||
Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c \
|
audio.c \
|
||||||
Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c \
|
avdtp.c \
|
||||||
Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c \
|
avdtp_acceptor.c \
|
||||||
Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c \
|
avdtp_initiator.c \
|
||||||
Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c \
|
avdtp_sink.c \
|
||||||
Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c \
|
avdtp_source.c \
|
||||||
Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c \
|
avdtp_util.c \
|
||||||
Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c \
|
avrcp.c \
|
||||||
Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c \
|
avrcp_browsing_controller.c \
|
||||||
Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c \
|
avrcp_controller.c \
|
||||||
Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c \
|
avrcp_media_item_iterator.c \
|
||||||
Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c \
|
avrcp_target.c \
|
||||||
Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c \
|
battery_service_server.c \
|
||||||
Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c \
|
bluetooth_init_cc2564B_1.6_BT_Spec_4.1.c \
|
||||||
Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c \
|
btstack_audio.c \
|
||||||
Src/system_stm32f4xx.c
|
btstack_audio_embedded.c \
|
||||||
|
btstack_chipset_cc256x.c \
|
||||||
|
btstack_crypto.c \
|
||||||
|
btstack_cvsd_plc.c \
|
||||||
|
btstack_hid_parser.c \
|
||||||
|
btstack_link_key_db_tlv.c \
|
||||||
|
btstack_linked_list.c \
|
||||||
|
btstack_memory.c \
|
||||||
|
btstack_memory_pool.c \
|
||||||
|
btstack_resample.c \
|
||||||
|
btstack_ring_buffer.c \
|
||||||
|
btstack_run_loop.c \
|
||||||
|
btstack_run_loop_embedded.c \
|
||||||
|
btstack_sbc_decoder_bluedroid.c \
|
||||||
|
btstack_sbc_encoder_bluedroid.c \
|
||||||
|
btstack_sbc_plc.c \
|
||||||
|
btstack_stdin_embedded.c \
|
||||||
|
btstack_tlv.c \
|
||||||
|
btstack_tlv_flash_bank.c \
|
||||||
|
btstack_uart_block_embedded.c \
|
||||||
|
btstack_util.c \
|
||||||
|
cs43l22.c \
|
||||||
|
device_id_server.c \
|
||||||
|
device_information_service_server.c \
|
||||||
|
dma.c \
|
||||||
|
gatt_client.c \
|
||||||
|
goep_client.c \
|
||||||
|
gpio.c \
|
||||||
|
hal_audio_f4discovery.c \
|
||||||
|
hal_flash_bank_stm32.c \
|
||||||
|
hci.c \
|
||||||
|
hci_cmd.c \
|
||||||
|
hci_dump.c \
|
||||||
|
hci_transport_h4.c \
|
||||||
|
hfp.c \
|
||||||
|
hfp_ag.c \
|
||||||
|
hfp_gsm_model.c \
|
||||||
|
hfp_hf.c \
|
||||||
|
hfp_msbc.c \
|
||||||
|
hid_device.c \
|
||||||
|
hids_device.c \
|
||||||
|
hsp_ag.c \
|
||||||
|
hsp_hs.c \
|
||||||
|
hxcmod.c \
|
||||||
|
l2cap.c \
|
||||||
|
l2cap_signaling.c \
|
||||||
|
le_device_db_memory.c \
|
||||||
|
le_device_db_tlv.c \
|
||||||
|
main.c \
|
||||||
|
main.c \
|
||||||
|
md5.c \
|
||||||
|
nao-deceased_by_disease.c \
|
||||||
|
obex_iterator.c \
|
||||||
|
pbap_client.c \
|
||||||
|
port.c \
|
||||||
|
rfcomm.c \
|
||||||
|
sco_demo_util.c \
|
||||||
|
sdp_client.c \
|
||||||
|
sdp_client_rfcomm.c \
|
||||||
|
sdp_server.c \
|
||||||
|
sdp_util.c \
|
||||||
|
SEGGER_RTT.c \
|
||||||
|
SEGGER_RTT_Syscalls_GCC.c \
|
||||||
|
sm.c \
|
||||||
|
spi.c \
|
||||||
|
spp_server.c \
|
||||||
|
stm32f4_discovery.c \
|
||||||
|
stm32f4_discovery_audio.c \
|
||||||
|
stm32f4xx_hal.c \
|
||||||
|
stm32f4xx_hal_cortex.c \
|
||||||
|
stm32f4xx_hal_dma.c \
|
||||||
|
stm32f4xx_hal_dma_ex.c \
|
||||||
|
stm32f4xx_hal_exti.c \
|
||||||
|
stm32f4xx_hal_flash.c \
|
||||||
|
stm32f4xx_hal_flash_ex.c \
|
||||||
|
stm32f4xx_hal_flash_ramfunc.c \
|
||||||
|
stm32f4xx_hal_gpio.c \
|
||||||
|
stm32f4xx_hal_i2c.c \
|
||||||
|
stm32f4xx_hal_i2c_ex.c \
|
||||||
|
stm32f4xx_hal_i2s.c \
|
||||||
|
stm32f4xx_hal_i2s_ex.c \
|
||||||
|
stm32f4xx_hal_msp.c \
|
||||||
|
stm32f4xx_hal_pwr.c \
|
||||||
|
stm32f4xx_hal_pwr_ex.c \
|
||||||
|
stm32f4xx_hal_rcc.c \
|
||||||
|
stm32f4xx_hal_rcc_ex.c \
|
||||||
|
stm32f4xx_hal_spi.c \
|
||||||
|
stm32f4xx_hal_tim.c \
|
||||||
|
stm32f4xx_hal_tim_ex.c \
|
||||||
|
stm32f4xx_hal_uart.c \
|
||||||
|
stm32f4xx_it.c \
|
||||||
|
system_stm32f4xx.c \
|
||||||
|
uECC.c \
|
||||||
|
usart.c \
|
||||||
|
usart.c \
|
||||||
|
yxml.c \
|
||||||
|
|
||||||
# ASM sources
|
# ASM sources
|
||||||
ASM_SOURCES = \
|
ASM_SOURCES = \
|
||||||
@ -95,7 +211,7 @@ CPU = -mcpu=cortex-m4
|
|||||||
FPU = -mfpu=fpv4-sp-d16
|
FPU = -mfpu=fpv4-sp-d16
|
||||||
|
|
||||||
# float-abi
|
# float-abi
|
||||||
FLOAT-ABI = -mfloat-abi=hard
|
FLOAT-ABI = -mfloat-abi=softfp
|
||||||
|
|
||||||
# mcu
|
# mcu
|
||||||
MCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI)
|
MCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI)
|
||||||
@ -120,8 +236,28 @@ C_INCLUDES = \
|
|||||||
-IDrivers/STM32F4xx_HAL_Driver/Inc/Legacy \
|
-IDrivers/STM32F4xx_HAL_Driver/Inc/Legacy \
|
||||||
-IDrivers/CMSIS/Device/ST/STM32F4xx/Include \
|
-IDrivers/CMSIS/Device/ST/STM32F4xx/Include \
|
||||||
-IDrivers/CMSIS/Include \
|
-IDrivers/CMSIS/Include \
|
||||||
-IDrivers/CMSIS/Include
|
|
||||||
|
|
||||||
|
C_INCLUDES += -I.
|
||||||
|
C_INCLUDES += -I$(BUILD_DIR)
|
||||||
|
C_INCLUDES += -I${BTSTACK_ROOT}/src/ble
|
||||||
|
C_INCLUDES += -I${BTSTACK_ROOT}/src/ble/gatt-service
|
||||||
|
C_INCLUDES += -I${BTSTACK_ROOT}/src/classic
|
||||||
|
C_INCLUDES += -I${BTSTACK_ROOT}/src
|
||||||
|
C_INCLUDES += -I${BTSTACK_ROOT}/3rd-party/micro-ecc
|
||||||
|
C_INCLUDES += -I${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/include
|
||||||
|
C_INCLUDES += -I${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/include
|
||||||
|
C_INCLUDES += -I${BTSTACK_ROOT}/3rd-party/hxcmod-player
|
||||||
|
C_INCLUDES += -I${BTSTACK_ROOT}/3rd-party/hxcmod-player/mods
|
||||||
|
C_INCLUDES += -I${BTSTACK_ROOT}/3rd-party/md5
|
||||||
|
C_INCLUDES += -I${BTSTACK_ROOT}/3rd-party/yxml
|
||||||
|
C_INCLUDES += -I${BTSTACK_ROOT}/3rd-party/segger-rtt
|
||||||
|
C_INCLUDES += -I${BTSTACK_ROOT}/platform/embedded
|
||||||
|
C_INCLUDES += -I${BTSTACK_ROOT}/chipset/cc256x
|
||||||
|
C_INCLUDES += -I pdm
|
||||||
|
C_INCLUDES += -I port
|
||||||
|
C_INCLUDES += -I port/bsp
|
||||||
|
C_INCLUDES += -I src
|
||||||
|
C_INCLUDES += -I Drivers/STM32F4xx_HAL_Driver/Inc
|
||||||
|
|
||||||
# compile gcc flags
|
# compile gcc flags
|
||||||
ASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections
|
ASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections
|
||||||
@ -144,13 +280,77 @@ CFLAGS += -MMD -MP -MF"$(@:%.o=%.d)"
|
|||||||
LDSCRIPT = STM32F407VGTx_FLASH.ld
|
LDSCRIPT = STM32F407VGTx_FLASH.ld
|
||||||
|
|
||||||
# libraries
|
# libraries
|
||||||
LIBS = -lc -lm -lnosys
|
LIBS = -lPDMFilter_CM4_GCC -lc -lm -lnosys
|
||||||
LIBDIR =
|
LIBDIR = -Lpdm
|
||||||
LDFLAGS = $(MCU) -specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref -Wl,--gc-sections
|
LDFLAGS = $(MCU) -specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref -Wl,--gc-sections
|
||||||
|
|
||||||
# default action: build all
|
# default action: build all
|
||||||
all: $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin
|
LE_EXAMPLES = \
|
||||||
|
ancs_client_demo \
|
||||||
|
gap_le_advertisements \
|
||||||
|
gatt_battery_query \
|
||||||
|
gatt_browser \
|
||||||
|
le_counter \
|
||||||
|
le_streamer \
|
||||||
|
le_streamer_client \
|
||||||
|
sm_pairing_peripheral \
|
||||||
|
sm_pairing_central
|
||||||
|
|
||||||
|
EXAMPLES = \
|
||||||
|
audio_duplex \
|
||||||
|
a2dp_sink_demo \
|
||||||
|
a2dp_source_demo \
|
||||||
|
ancs_client_demo \
|
||||||
|
dut_mode_classic \
|
||||||
|
gap_dedicated_bonding \
|
||||||
|
gap_inquiry \
|
||||||
|
gap_le_advertisements \
|
||||||
|
gatt_battery_query \
|
||||||
|
gatt_browser \
|
||||||
|
hfp_ag_demo \
|
||||||
|
hfp_hf_demo \
|
||||||
|
hid_host_demo \
|
||||||
|
hid_keyboard_demo \
|
||||||
|
hid_mouse_demo \
|
||||||
|
hog_keyboard_demo \
|
||||||
|
hog_mouse_demo \
|
||||||
|
hsp_ag_demo \
|
||||||
|
hsp_hs_demo \
|
||||||
|
mod_player \
|
||||||
|
le_counter \
|
||||||
|
le_streamer \
|
||||||
|
le_streamer_client \
|
||||||
|
pbap_client_demo \
|
||||||
|
sdp_bnep_query \
|
||||||
|
sdp_general_query \
|
||||||
|
sdp_rfcomm_query \
|
||||||
|
sine_player \
|
||||||
|
sm_pairing_central \
|
||||||
|
sm_pairing_peripheral \
|
||||||
|
spp_and_le_counter \
|
||||||
|
spp_and_le_streamer \
|
||||||
|
spp_counter \
|
||||||
|
spp_streamer \
|
||||||
|
spp_streamer_client \
|
||||||
|
|
||||||
|
GATT_FILES = \
|
||||||
|
ancs_client_demo.gatt \
|
||||||
|
le_counter.gatt \
|
||||||
|
le_streamer.gatt \
|
||||||
|
gatt_browser.gatt \
|
||||||
|
gatt_battery_query.gatt \
|
||||||
|
hog_keyboard_demo.gatt \
|
||||||
|
hog_mouse_demo.gatt \
|
||||||
|
sm_pairing_peripheral.gatt \
|
||||||
|
sm_pairing_central.gatt \
|
||||||
|
spp_and_le_counter.gatt \
|
||||||
|
spp_and_le_streamer.gatt \
|
||||||
|
|
||||||
|
include ${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/Makefile.inc
|
||||||
|
include ${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/Makefile.inc
|
||||||
|
|
||||||
|
C_SOURCES += ${SBC_ENCODER}
|
||||||
|
C_SOURCES += ${SBC_DECODER}
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
# build the application
|
# build the application
|
||||||
@ -162,14 +362,36 @@ vpath %.c $(sort $(dir $(C_SOURCES)))
|
|||||||
OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o)))
|
OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o)))
|
||||||
vpath %.s $(sort $(dir $(ASM_SOURCES)))
|
vpath %.s $(sort $(dir $(ASM_SOURCES)))
|
||||||
|
|
||||||
|
all: \
|
||||||
|
$(OBJECTS) \
|
||||||
|
$(addprefix $(BUILD_DIR)/,$(GATT_FILES:.gatt=.h)) \
|
||||||
|
$(addprefix $(BUILD_DIR)/,$(EXAMPLES:=.elf)) \
|
||||||
|
$(addprefix $(BUILD_DIR)/,$(EXAMPLES:=.hex)) \
|
||||||
|
$(addprefix $(BUILD_DIR)/,$(EXAMPLES:=.bin))
|
||||||
|
|
||||||
|
include ${BTSTACK_ROOT}/chipset/cc256x/Makefile.inc
|
||||||
|
|
||||||
|
$(BUILD_DIR)/%.h: %.gatt
|
||||||
|
python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@
|
||||||
|
|
||||||
|
# $(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR)
|
||||||
|
# $(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@
|
||||||
|
|
||||||
|
# $(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR)
|
||||||
|
# $(AS) -c $(CFLAGS) $< -o $@
|
||||||
|
|
||||||
|
# $(BUILD_DIR)/%.elf: $(OBJECTS) Makefile %.o
|
||||||
|
# $(CC) $(filter-out Makefile,$^) $(LDFLAGS) -o $@
|
||||||
|
# $(SZ) $@
|
||||||
|
|
||||||
$(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR)
|
$(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR)
|
||||||
$(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@
|
$(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@
|
||||||
|
|
||||||
$(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR)
|
$(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR)
|
||||||
$(AS) -c $(CFLAGS) $< -o $@
|
$(AS) -c $(CFLAGS) $< -o $@
|
||||||
|
|
||||||
$(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) Makefile
|
$(BUILD_DIR)/%.elf: $(OBJECTS) %.o
|
||||||
$(CC) $(OBJECTS) $(LDFLAGS) -o $@
|
$(CC) $(filter-out Makefile,$^) $(LDFLAGS) -o $@
|
||||||
$(SZ) $@
|
$(SZ) $@
|
||||||
|
|
||||||
$(BUILD_DIR)/%.hex: $(BUILD_DIR)/%.elf | $(BUILD_DIR)
|
$(BUILD_DIR)/%.hex: $(BUILD_DIR)/%.elf | $(BUILD_DIR)
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
/* Private includes ----------------------------------------------------------*/
|
/* Private includes ----------------------------------------------------------*/
|
||||||
/* USER CODE BEGIN Includes */
|
/* USER CODE BEGIN Includes */
|
||||||
|
#include "port.h"
|
||||||
/* USER CODE END Includes */
|
/* USER CODE END Includes */
|
||||||
|
|
||||||
/* Private typedef -----------------------------------------------------------*/
|
/* Private typedef -----------------------------------------------------------*/
|
||||||
@ -93,7 +93,8 @@ int main(void)
|
|||||||
MX_USART2_UART_Init();
|
MX_USART2_UART_Init();
|
||||||
MX_USART3_UART_Init();
|
MX_USART3_UART_Init();
|
||||||
/* USER CODE BEGIN 2 */
|
/* USER CODE BEGIN 2 */
|
||||||
|
// jump to BTstack port
|
||||||
|
port_main();
|
||||||
/* USER CODE END 2 */
|
/* USER CODE END 2 */
|
||||||
|
|
||||||
/* Infinite loop */
|
/* Infinite loop */
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
// include STM32 first to avoid warning about redefinition of UNUSED
|
// include STM32 first to avoid warning about redefinition of UNUSED
|
||||||
#include "stm32f4xx_hal.h"
|
#include "stm32f4xx_hal.h"
|
||||||
|
#include "main.h"
|
||||||
|
|
||||||
#include "port.h"
|
#include "port.h"
|
||||||
#include "btstack.h"
|
#include "btstack.h"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user