From b3a2b5e1eba555aff6f0b53b8f0c301335baf0bb Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 13 Jun 2018 17:43:21 +0200 Subject: [PATCH] msp432p401lp-cc256x: compile all examples --- port/msp432p401lp-cc256x/Makefile | 232 +++++++++++++--------- port/msp432p401lp-cc256x/Makefile.defs | 43 ++-- port/msp432p401lp-cc256x/btstack_config.h | 1 - 3 files changed, 161 insertions(+), 115 deletions(-) diff --git a/port/msp432p401lp-cc256x/Makefile b/port/msp432p401lp-cc256x/Makefile index 6be2213cc..0d7902fc1 100755 --- a/port/msp432p401lp-cc256x/Makefile +++ b/port/msp432p401lp-cc256x/Makefile @@ -21,24 +21,6 @@ IPATH+=${ROOT}/inc/ IPATH+=${ROOT}/inc/CMSIS/ IPATH+=${ROOT}/driverlib/MSP432P4xx -# -# The default rule, which causes the uart_loopback_24mhz_brclk example to be built. -# -all: ${COMPILER} -all: ${COMPILER}/uart_loopback_24mhz_brclk.axf - -# -# The rule to clean out all the build products. -# -clean: - @rm -rf ${COMPILER} ${wildcard *~} - -# -# The rule to create the target directory. -# -${COMPILER}: - @mkdir -p ${COMPILER} - # BTstack BTSTACK_ROOT=../.. VPATH += ${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/srce @@ -58,45 +40,21 @@ IPATH += ${BTSTACK_ROOT}/3rd-party/segger-rtt IPATH += ${BTSTACK_ROOT}/src IPATH += ${BTSTACK_ROOT}/platform/embedded IPATH += ${BTSTACK_ROOT}/chipset/cc256x +IPATH += ${BTSTACK_ROOT}/3rd-party/hxcmod-player +IPATH += ${BTSTACK_ROOT}/3rd-party/hxcmod-player/mods IPATH += ${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/include IPATH += ${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/include IPATH += . IPATH += ${COMPILER} BTSTACK_SOURCES = \ +a2dp_sink.c \ +a2dp_source.c \ ad_parser.c \ ancs_client.c \ att_db.c \ att_dispatch.c \ att_server.c \ -battery_service_server.c \ -btstack_crypto.c \ -btstack_linked_list.c \ -btstack_memory.c \ -btstack_memory_pool.c \ -btstack_ring_buffer.c \ -btstack_run_loop.c \ -btstack_run_loop_embedded.c \ -btstack_tlv.c \ -btstack_uart_block_embedded.c \ -btstack_util.c \ -device_information_service_server.c \ -hids_device.c \ -gatt_client.c \ -hci.c \ -hci_cmd.c \ -hci_dump.c \ -hci_transport_h4.c \ -l2cap.c \ -l2cap_signaling.c \ -le_device_db_memory.c \ -sm.c \ -uECC.c \ -btstack_tlv_flash_bank.c \ -le_device_db_tlv.c \ -btstack_link_key_db_tlv.c \ -a2dp_sink.c \ -a2dp_source.c \ avdtp.c \ avdtp_acceptor.c \ avdtp_initiator.c \ @@ -108,30 +66,57 @@ avrcp_browsing_controller.c \ avrcp_controller.c \ avrcp_media_item_iterator.c \ avrcp_target.c \ -sdp_util.c \ -sdp_server.c \ -sdp_client.c \ -sdp_client_rfcomm.c \ -spp_server.c \ +battery_service_server.c \ +btstack_crypto.c \ +btstack_hid_parser.c \ +btstack_link_key_db_tlv.c \ +btstack_linked_list.c \ +btstack_memory.c \ +btstack_memory_pool.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 \ -hxcmod.c \ -nao-deceased_by_disease.c \ -hfp_ag.c \ -hfp_hf.c \ -hfp.c \ -hfp_gsm_model.c \ -hfp_msbc.c \ -hsp_hs.c \ -hsp_ag.c \ -hid_device.c \ -rfcomm.c \ -sco_demo_util.c \ -btstack_hid_parser.c \ +btstack_tlv.c \ +btstack_tlv_flash_bank.c \ +btstack_uart_block_embedded.c \ +btstack_util.c \ device_id_server.c \ +device_information_service_server.c \ +goep_client.c \ +gatt_client.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 \ +nao-deceased_by_disease.c \ obex_iterator.c \ pbap_client.c \ +rfcomm.c \ +sco_demo_util.c \ +sdp_client.c \ +sdp_client_rfcomm.c \ +sdp_server.c \ +sdp_util.c \ +sm.c \ +spp_server.c \ +uECC.c \ PORT_SOURCES = \ btstack_chipset_cc256x.o \ @@ -143,7 +128,6 @@ PORT_SOURCES = \ SEGGER_RTT.o \ SEGGER_RTT_Syscalls_GCC.o \ SEGGER_RTT_printf.o \ - le_counter.o \ include ${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/Makefile.inc include ${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/Makefile.inc @@ -151,43 +135,105 @@ include ${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/Makefile.inc BTSTACK_SOURCES += ${SBC_ENCODER} BTSTACK_SOURCES += ${SBC_DECODER} +EXAMPLES = \ + 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 \ + le_counter \ + le_streamer \ + le_streamer_client \ + pbap_client_demo \ + sdp_bnep_query \ + sdp_general_query \ + sdp_rfcomm_query \ + 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 \ + +# +# The default rule, which causes the le_counter example to be built. +# +all: ${COMPILER} +all: \ + linker_script_gcc.ld \ + $(addprefix $(COMPILER)/,$(GATT_FILES:.gatt=.h)) \ + $(addprefix $(COMPILER)/,$(EXAMPLES:=.axf)) \ + +# +# The rule to clean out all the build products. +# +clean: + @rm -rf ${COMPILER} ${wildcard *~} + +# +# The rule to create the target directory. +# +${COMPILER}: + @mkdir -p ${COMPILER} + # compile .gatt descriptions ${COMPILER}/%.h: %.gatt python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@ +## + +# pick up sources OBJECTS = $(BTSTACK_SOURCES:%.c=$(COMPILER)/%.o) $(PORT_SOURCES:%.o=$(COMPILER)/%.o) -# ${COMPILER}/startup_msp432p401r_${COMPILER}.o \ -# ${COMPILER}/system_msp432p401r.o \ -# ${COMPILER}/main.o \ -# ${COMPILER}/SEGGER_RTT.o \ -# ${COMPILER}/SEGGER_RTT_Syscalls_GCC.o \ -# ${COMPILER}/SEGGER_RTT_printf.o \ -# ${COMPILER}/hci_dump.o \ -# ${COMPILER}/btstack_linked_list.o \ -# ${COMPILER}/btstack_memory.o \ -# ${COMPILER}/btstack_memory_pool.o \ -# ${COMPILER}/btstack_run_loop.o \ -# ${COMPILER}/btstack_run_loop_embedded.o \ -# ${COMPILER}/btstack_uart_block_embedded.o \ -# ${COMPILER}/btstack_chipset_cc256x.o \ -# ${COMPILER}/hci_transport_h4.o \ -# ${COMPILER}/btstack_util.o \ -# ${COMPILER}/hci.o \ -# ${COMPILER}/hci_cmd.o \ -# ${COMPILER}/ad_parser.o \ -# ${COMPILER}/bluetooth_init_cc2564B_1.6_BT_Spec_4.1.o \ +CFLAGSgcc=-DTARGET_IS_MSP432P4XX # -# Rules for building the uart_loopback_24mhz_brclk example. +# The rule for linking the application. # -${COMPILER}/uart_loopback_24mhz_brclk.axf: ${COMPILER}/le_counter.h -${COMPILER}/uart_loopback_24mhz_brclk.axf: ${OBJECTS} -${COMPILER}/uart_loopback_24mhz_brclk.axf: ${ROOT}/driverlib/MSP432P4xx/${COMPILER}/msp432p4xx_driverlib.a -${COMPILER}/uart_loopback_24mhz_brclk.axf: linker_script_gcc.ld -SCATTERgcc_uart_loopback_24mhz_brclk=linker_script_gcc.ld -ENTRY_uart_loopback_24mhz_brclk=resetISR -CFLAGSgcc=-DTARGET_IS_MSP432P4XX +${COMPILER}${SUFFIX}/%.axf: ${OBJECTS} ${COMPILER}/%.o ${ROOT}/driverlib/MSP432P4xx/${COMPILER}/msp432p4xx_driverlib.a + @ \ + ldname="linker_script_gcc.ld"; \ + if [ 'x${VERBOSE}' = x ]; \ + then \ + echo " LD ${@} ${LNK_SCP}"; \ + else \ + echo ${LD} -T $${ldname} \ + ${LDFLAGSgcc_${notdir ${@:.axf=}}} \ + ${LDFLAGS} -o ${@} $(filter %.o %.a, ${^}) \ + '${LIBM}' '${LIBC}' '${LIBGCC}'; \ + fi; \ + ${LD} -T $${ldname} \ + ${LDFLAGSgcc_${notdir ${@:.axf=}}} \ + ${LDFLAGS} -o ${@} $(filter %.o %.a, ${^}) \ + '${LIBM}' '${LIBC}' '${LIBGCC}' + @${OBJCOPY} -O binary ${@} ${@:.axf=.bin} # # Include the automatically generated dependency files. diff --git a/port/msp432p401lp-cc256x/Makefile.defs b/port/msp432p401lp-cc256x/Makefile.defs index ad160c36e..eaa773277 100755 --- a/port/msp432p401lp-cc256x/Makefile.defs +++ b/port/msp432p401lp-cc256x/Makefile.defs @@ -165,26 +165,27 @@ ${COMPILER}${SUFFIX}/%.a: # # The rule for linking the application. # -${COMPILER}${SUFFIX}/%.axf: - @if [ 'x${SCATTERgcc_${notdir ${@:.axf=}}}' = x ]; \ - then \ - ldname="${ROOT}/gcc/standalone.ld"; \ - else \ - ldname="${SCATTERgcc_${notdir ${@:.axf=}}}"; \ - fi; \ - if [ 'x${VERBOSE}' = x ]; \ - then \ - echo " LD ${@} ${LNK_SCP}"; \ - else \ - echo ${LD} -T $${ldname} \ - ${LDFLAGSgcc_${notdir ${@:.axf=}}} \ - ${LDFLAGS} -o ${@} $(filter %.o %.a, ${^}) \ - '${LIBM}' '${LIBC}' '${LIBGCC}'; \ - fi; \ - ${LD} -T $${ldname} \ - ${LDFLAGSgcc_${notdir ${@:.axf=}}} \ - ${LDFLAGS} -o ${@} $(filter %.o %.a, ${^}) \ - '${LIBM}' '${LIBC}' '${LIBGCC}' - @${OBJCOPY} -O binary ${@} ${@:.axf=.bin} +# ${COMPILER}${SUFFIX}/%.axf: +# @if [ 'x${SCATTERgcc_${notdir ${@:.axf=}}}' = x ]; \ +# then \ +# ldname="${ROOT}/gcc/standalone.ld"; \ +# else \ +# ldname="${SCATTERgcc_${notdir ${@:.axf=}}}"; \ +# fi; \ +# if [ 'x${VERBOSE}' = x ]; \ +# then \ +# echo " LD ${@} ${LNK_SCP}"; \ +# else \ +# echo ${LD} -T $${ldname} \ +# ${LDFLAGSgcc_${notdir ${@:.axf=}}} \ +# ${LDFLAGS} -o ${@} $(filter %.o %.a, ${^}) \ +# '${LIBM}' '${LIBC}' '${LIBGCC}'; \ +# fi; \ +# ${LD} -T $${ldname} \ +# ${LDFLAGSgcc_${notdir ${@:.axf=}}} \ +# ${LDFLAGS} -o ${@} $(filter %.o %.a, ${^}) \ +# '${LIBM}' '${LIBC}' '${LIBGCC}' +# @${OBJCOPY} -O binary ${@} ${@:.axf=.bin} + endif diff --git a/port/msp432p401lp-cc256x/btstack_config.h b/port/msp432p401lp-cc256x/btstack_config.h index b8efad54b..a4f9563df 100644 --- a/port/msp432p401lp-cc256x/btstack_config.h +++ b/port/msp432p401lp-cc256x/btstack_config.h @@ -7,7 +7,6 @@ // Port related features #define HAVE_EMBEDDED_TIME_MS -#define HAVE_AUDIO_DMA // BTstack features that can be enabled #define ENABLE_BLE