mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-16 08:42:28 +00:00
hci_dump: stm32 ports
This commit is contained in:
parent
25d9a2cd74
commit
09df40bd40
@ -43,6 +43,7 @@ ${BTSTACK_ROOT}/3rd-party/hxcmod-player/hxcmod.c \
|
|||||||
${BTSTACK_ROOT}/3rd-party/hxcmod-player/mods/nao-deceased_by_disease.c \
|
${BTSTACK_ROOT}/3rd-party/hxcmod-player/mods/nao-deceased_by_disease.c \
|
||||||
${BTSTACK_ROOT}/3rd-party/micro-ecc/uECC.c \
|
${BTSTACK_ROOT}/3rd-party/micro-ecc/uECC.c \
|
||||||
${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT.c \
|
${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT.c \
|
||||||
|
${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT_printf.c \
|
||||||
${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT_Syscalls_GCC.c \
|
${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT_Syscalls_GCC.c \
|
||||||
${BTSTACK_ROOT}/3rd-party/yxml/yxml.c \
|
${BTSTACK_ROOT}/3rd-party/yxml/yxml.c \
|
||||||
${BTSTACK_ROOT}/3rd-party/md5/md5.c \
|
${BTSTACK_ROOT}/3rd-party/md5/md5.c \
|
||||||
@ -53,6 +54,8 @@ ${BTSTACK_ROOT}/platform/embedded/btstack_run_loop_embedded.c \
|
|||||||
${BTSTACK_ROOT}/platform/embedded/btstack_stdin_embedded.c \
|
${BTSTACK_ROOT}/platform/embedded/btstack_stdin_embedded.c \
|
||||||
${BTSTACK_ROOT}/platform/embedded/btstack_tlv_flash_bank.c \
|
${BTSTACK_ROOT}/platform/embedded/btstack_tlv_flash_bank.c \
|
||||||
${BTSTACK_ROOT}/platform/embedded/btstack_uart_block_embedded.c \
|
${BTSTACK_ROOT}/platform/embedded/btstack_uart_block_embedded.c \
|
||||||
|
${BTSTACK_ROOT}/platform/embedded/hci_dump_embedded_stdout.c \
|
||||||
|
${BTSTACK_ROOT}/platform/embedded/hci_dump_segger_rtt_stdout.c \
|
||||||
${BTSTACK_ROOT}/src/ad_parser.c \
|
${BTSTACK_ROOT}/src/ad_parser.c \
|
||||||
${BTSTACK_ROOT}/src/ble/ancs_client.c \
|
${BTSTACK_ROOT}/src/ble/ancs_client.c \
|
||||||
${BTSTACK_ROOT}/src/ble/att_db.c \
|
${BTSTACK_ROOT}/src/ble/att_db.c \
|
||||||
|
@ -45,7 +45,7 @@ All debug output can be either send via SEGGER RTT or via USART2. To get the con
|
|||||||
|
|
||||||
In src/btstack_config.h resp. in example/btstack_config.h of the generated projects, additional debug information can be enabled by uncommenting ENABLE_LOG_INFO.
|
In src/btstack_config.h resp. in example/btstack_config.h of the generated projects, additional debug information can be enabled by uncommenting ENABLE_LOG_INFO.
|
||||||
|
|
||||||
Also, the full packet log can be enabled in src/port.c resp. btstack/port/stm32-f4discovery-cc256x/src/port.c by uncommenting the hci_dump_open(..) line. The console output can then be converted into .pklg files for OS X PacketLogger or WireShark by running tool/create_packet_log.py
|
Also, the full packet log can be enabled in src/port.c resp. btstack/port/stm32-f4discovery-cc256x/src/port.c by uncommenting the hci_dump_init(..) line. The console output can then be converted into .pklg files for OS X PacketLogger or WireShark by running tool/create_packet_log.py
|
||||||
|
|
||||||
## GATT Database
|
## GATT Database
|
||||||
In BTstack, the GATT Database is defined via the .gatt file in the example folder. The Makefile contains rules to update the .h file when the .gatt was modified.
|
In BTstack, the GATT Database is defined via the .gatt file in the example folder. The Makefile contains rules to update the .h file when the .gatt was modified.
|
||||||
|
@ -19,6 +19,9 @@
|
|||||||
|
|
||||||
#ifdef ENABLE_SEGGER_RTT
|
#ifdef ENABLE_SEGGER_RTT
|
||||||
#include "SEGGER_RTT.h"
|
#include "SEGGER_RTT.h"
|
||||||
|
#include "hci_dump_segger_rtt_stdout.h"
|
||||||
|
#else
|
||||||
|
#include "hci_dump_embedded_stdout.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -316,7 +319,12 @@ void port_main(void){
|
|||||||
btstack_memory_init();
|
btstack_memory_init();
|
||||||
btstack_run_loop_init(btstack_run_loop_embedded_get_instance());
|
btstack_run_loop_init(btstack_run_loop_embedded_get_instance());
|
||||||
|
|
||||||
// hci_dump_open( NULL, HCI_DUMP_STDOUT );
|
// uncomment to enable packet logger
|
||||||
|
#ifdef ENABLE_SEGGER_RTT
|
||||||
|
// hci_dump_init(hci_dump_segger_rtt_stdout_get_instance());
|
||||||
|
#else
|
||||||
|
// hci_dump_init(hci_dump_embedded_stdout_get_instance());
|
||||||
|
#endif
|
||||||
|
|
||||||
// init HCI
|
// init HCI
|
||||||
hci_init(hci_transport_h4_instance(btstack_uart_block_embedded_instance()), (void*) &config);
|
hci_init(hci_transport_h4_instance(btstack_uart_block_embedded_instance()), (void*) &config);
|
||||||
|
@ -54,6 +54,8 @@ ${BTSTACK_ROOT}/platform/embedded/btstack_run_loop_embedded.c \
|
|||||||
${BTSTACK_ROOT}/platform/embedded/btstack_stdin_embedded.c \
|
${BTSTACK_ROOT}/platform/embedded/btstack_stdin_embedded.c \
|
||||||
${BTSTACK_ROOT}/platform/embedded/btstack_tlv_flash_bank.c \
|
${BTSTACK_ROOT}/platform/embedded/btstack_tlv_flash_bank.c \
|
||||||
${BTSTACK_ROOT}/platform/embedded/btstack_uart_block_embedded.c \
|
${BTSTACK_ROOT}/platform/embedded/btstack_uart_block_embedded.c \
|
||||||
|
${BTSTACK_ROOT}/platform/embedded/hci_dump_embedded_stdout.c \
|
||||||
|
${BTSTACK_ROOT}/platform/embedded/hci_dump_segger_rtt_stdout.c \
|
||||||
${BTSTACK_ROOT}/src/ad_parser.c \
|
${BTSTACK_ROOT}/src/ad_parser.c \
|
||||||
${BTSTACK_ROOT}/src/ble/ancs_client.c \
|
${BTSTACK_ROOT}/src/ble/ancs_client.c \
|
||||||
${BTSTACK_ROOT}/src/ble/att_db.c \
|
${BTSTACK_ROOT}/src/ble/att_db.c \
|
||||||
|
@ -60,6 +60,9 @@
|
|||||||
|
|
||||||
#ifdef ENABLE_SEGGER_RTT
|
#ifdef ENABLE_SEGGER_RTT
|
||||||
#include "SEGGER_RTT.h"
|
#include "SEGGER_RTT.h"
|
||||||
|
#include "hci_dump_segger_rtt_stdout.h"
|
||||||
|
#else
|
||||||
|
#include "hci_dump_embedded_stdout.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static btstack_packet_callback_registration_t hci_event_callback_registration;
|
static btstack_packet_callback_registration_t hci_event_callback_registration;
|
||||||
@ -130,8 +133,12 @@ void port_main(void){
|
|||||||
btstack_memory_init();
|
btstack_memory_init();
|
||||||
btstack_run_loop_init(btstack_run_loop_embedded_get_instance());
|
btstack_run_loop_init(btstack_run_loop_embedded_get_instance());
|
||||||
|
|
||||||
// uncomment for packet log
|
// uncomment to enable packet logger
|
||||||
// hci_dump_open( NULL, HCI_DUMP_STDOUT );
|
#ifdef ENABLE_SEGGER_RTT
|
||||||
|
// hci_dump_init(hci_dump_segger_rtt_stdout_get_instance());
|
||||||
|
#else
|
||||||
|
// hci_dump_init(hci_dump_embedded_stdout_get_instance());
|
||||||
|
#endif
|
||||||
|
|
||||||
// init HCI
|
// init HCI
|
||||||
hci_init(hci_transport_h2_stm32_instance(), NULL);
|
hci_init(hci_transport_h2_stm32_instance(), NULL);
|
||||||
|
@ -41,6 +41,7 @@ VPATH += ${BTSTACK_ROOT}/example
|
|||||||
C_SOURCES = \
|
C_SOURCES = \
|
||||||
${BTSTACK_ROOT}/3rd-party/micro-ecc/uECC.c \
|
${BTSTACK_ROOT}/3rd-party/micro-ecc/uECC.c \
|
||||||
${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT.c \
|
${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT.c \
|
||||||
|
${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT_printf.c \
|
||||||
${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT_Syscalls_GCC.c \
|
${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT_Syscalls_GCC.c \
|
||||||
${BTSTACK_ROOT}/chipset/em9301/btstack_chipset_em9301.c \
|
${BTSTACK_ROOT}/chipset/em9301/btstack_chipset_em9301.c \
|
||||||
${BTSTACK_ROOT}/chipset/em9301/0000000_META_hci_patches_v7.c \
|
${BTSTACK_ROOT}/chipset/em9301/0000000_META_hci_patches_v7.c \
|
||||||
@ -48,6 +49,8 @@ ${BTSTACK_ROOT}/platform/embedded/btstack_run_loop_embedded.c \
|
|||||||
${BTSTACK_ROOT}/platform/embedded/btstack_stdin_embedded.c \
|
${BTSTACK_ROOT}/platform/embedded/btstack_stdin_embedded.c \
|
||||||
${BTSTACK_ROOT}/platform/embedded/btstack_tlv_flash_bank.c \
|
${BTSTACK_ROOT}/platform/embedded/btstack_tlv_flash_bank.c \
|
||||||
${BTSTACK_ROOT}/platform/embedded/btstack_uart_block_embedded.c \
|
${BTSTACK_ROOT}/platform/embedded/btstack_uart_block_embedded.c \
|
||||||
|
${BTSTACK_ROOT}/platform/embedded/hci_dump_embedded_stdout.c \
|
||||||
|
${BTSTACK_ROOT}/platform/embedded/hci_dump_segger_rtt_stdout.c \
|
||||||
${BTSTACK_ROOT}/src/ad_parser.c \
|
${BTSTACK_ROOT}/src/ad_parser.c \
|
||||||
${BTSTACK_ROOT}/src/ble/att_db.c \
|
${BTSTACK_ROOT}/src/ble/att_db.c \
|
||||||
${BTSTACK_ROOT}/src/ble/att_dispatch.c \
|
${BTSTACK_ROOT}/src/ble/att_dispatch.c \
|
||||||
|
@ -39,7 +39,7 @@ All debug output can be either send via SEGGER RTT or via USART2. To get the con
|
|||||||
|
|
||||||
In src/btstack_config.h resp. in example/btstack_config.h of the generated projects, additional debug information can be enabled by uncommenting ENABLE_LOG_INFO.
|
In src/btstack_config.h resp. in example/btstack_config.h of the generated projects, additional debug information can be enabled by uncommenting ENABLE_LOG_INFO.
|
||||||
|
|
||||||
Also, the full packet log can be enabled in src/port.c by uncommenting the hci_dump_open(..) line. The console output can then be converted into .pklg files for OS X PacketLogger or WireShark by running tool/create_packet_log.py
|
Also, the full packet log can be enabled in src/port.c by uncommenting the hci_dump_init(..) line. The console output can then be converted into .pklg files for OS X PacketLogger or WireShark by running tool/create_packet_log.py
|
||||||
|
|
||||||
## GATT Database
|
## GATT Database
|
||||||
In BTstack, the GATT Database is defined via the .gatt file in the example folder. During the build, the .gatt file is converted into a .h file with a binary representation of the GATT Database and useful defines for the application.
|
In BTstack, the GATT Database is defined via the .gatt file in the example folder. During the build, the .gatt file is converted into a .h file with a binary representation of the GATT Database and useful defines for the application.
|
||||||
|
@ -61,6 +61,9 @@
|
|||||||
|
|
||||||
#ifdef ENABLE_SEGGER_RTT
|
#ifdef ENABLE_SEGGER_RTT
|
||||||
#include "SEGGER_RTT.h"
|
#include "SEGGER_RTT.h"
|
||||||
|
#include "hci_dump_segger_rtt_stdout.h"
|
||||||
|
#else
|
||||||
|
#include "hci_dump_embedded_stdout.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// retarget printf
|
// retarget printf
|
||||||
@ -477,7 +480,12 @@ void port_main(void){
|
|||||||
btstack_memory_init();
|
btstack_memory_init();
|
||||||
btstack_run_loop_init(btstack_run_loop_embedded_get_instance());
|
btstack_run_loop_init(btstack_run_loop_embedded_get_instance());
|
||||||
|
|
||||||
// hci_dump_open( NULL, HCI_DUMP_STDOUT );
|
// uncomment to enable packet logger
|
||||||
|
#ifdef ENABLE_SEGGER_RTT
|
||||||
|
// hci_dump_init(hci_dump_segger_rtt_stdout_get_instance());
|
||||||
|
#else
|
||||||
|
// hci_dump_init(hci_dump_embedded_stdout_get_instance());
|
||||||
|
#endif
|
||||||
|
|
||||||
// set up polling data_source
|
// set up polling data_source
|
||||||
btstack_run_loop_set_data_source_handler(&transport_data_source, &hal_spi_em9304_process);
|
btstack_run_loop_set_data_source_handler(&transport_data_source, &hal_spi_em9304_process);
|
||||||
|
@ -48,6 +48,8 @@ ${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT.c \
|
|||||||
${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT_printf.c \
|
${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT_printf.c \
|
||||||
${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT_Syscalls_GCC.c \
|
${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT_Syscalls_GCC.c \
|
||||||
${BTSTACK_ROOT}/platform/embedded/btstack_run_loop_embedded.c \
|
${BTSTACK_ROOT}/platform/embedded/btstack_run_loop_embedded.c \
|
||||||
|
${BTSTACK_ROOT}/platform/embedded/hci_dump_embedded_stdout.c \
|
||||||
|
${BTSTACK_ROOT}/platform/embedded/hci_dump_segger_rtt_stdout.c \
|
||||||
${BTSTACK_ROOT}/src/ad_parser.c \
|
${BTSTACK_ROOT}/src/ad_parser.c \
|
||||||
${BTSTACK_ROOT}/src/ble/ancs_client.c \
|
${BTSTACK_ROOT}/src/ble/ancs_client.c \
|
||||||
${BTSTACK_ROOT}/src/ble/att_db.c \
|
${BTSTACK_ROOT}/src/ble/att_db.c \
|
||||||
|
@ -58,6 +58,12 @@
|
|||||||
#include "btstack_tlv_none.h"
|
#include "btstack_tlv_none.h"
|
||||||
#include "ble/le_device_db_tlv.h"
|
#include "ble/le_device_db_tlv.h"
|
||||||
|
|
||||||
|
#ifdef ENABLE_SEGGER_RTT
|
||||||
|
#include "SEGGER_RTT.h"
|
||||||
|
#include "hci_dump_segger_rtt_stdout.h"
|
||||||
|
#else
|
||||||
|
#include "hci_dump_embedded_stdout.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
void btstack_assert_failed(const char * file, uint16_t line_nr){
|
void btstack_assert_failed(const char * file, uint16_t line_nr){
|
||||||
printf("Assert: file %s, line %u\n", file, line_nr);
|
printf("Assert: file %s, line %u\n", file, line_nr);
|
||||||
@ -115,9 +121,13 @@ void btstack_port(void){
|
|||||||
|
|
||||||
// init HCI
|
// init HCI
|
||||||
hci_init(hci_transport, NULL);
|
hci_init(hci_transport, NULL);
|
||||||
|
|
||||||
// enable full log output while porting
|
// uncomment to enable packet logger
|
||||||
// hci_dump_open(NULL, HCI_DUMP_STDOUT);
|
#ifdef ENABLE_SEGGER_RTT
|
||||||
|
// hci_dump_init(hci_dump_segger_rtt_stdout_get_instance());
|
||||||
|
#else
|
||||||
|
// hci_dump_init(hci_dump_embedded_stdout_get_instance());
|
||||||
|
#endif
|
||||||
|
|
||||||
// hand over to btstack embedded code
|
// hand over to btstack embedded code
|
||||||
btstack_main();
|
btstack_main();
|
||||||
|
@ -43,6 +43,7 @@ C_SOURCES = \
|
|||||||
${BTSTACK_ROOT}/3rd-party/micro-ecc/uECC.c \
|
${BTSTACK_ROOT}/3rd-party/micro-ecc/uECC.c \
|
||||||
${BTSTACK_ROOT}/3rd-party/rijndael/rijndael.c \
|
${BTSTACK_ROOT}/3rd-party/rijndael/rijndael.c \
|
||||||
${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT.c \
|
${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT.c \
|
||||||
|
${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT_printf.c \
|
||||||
${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT_Syscalls_GCC.c \
|
${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT_Syscalls_GCC.c \
|
||||||
${BTSTACK_ROOT}/platform/freertos/btstack_run_loop_freertos.c \
|
${BTSTACK_ROOT}/platform/freertos/btstack_run_loop_freertos.c \
|
||||||
${BTSTACK_ROOT}/src/ad_parser.c \
|
${BTSTACK_ROOT}/src/ad_parser.c \
|
||||||
@ -78,6 +79,8 @@ ${BTSTACK_ROOT}/src/l2cap_signaling.c \
|
|||||||
${BTSTACK_ROOT}/src/hci_transport_h4.c \
|
${BTSTACK_ROOT}/src/hci_transport_h4.c \
|
||||||
${BTSTACK_ROOT}/platform/embedded/hal_flash_bank_memory.c \
|
${BTSTACK_ROOT}/platform/embedded/hal_flash_bank_memory.c \
|
||||||
${BTSTACK_ROOT}/platform/embedded/btstack_tlv_flash_bank.c \
|
${BTSTACK_ROOT}/platform/embedded/btstack_tlv_flash_bank.c \
|
||||||
|
${BTSTACK_ROOT}/platform/embedded/hci_dump_embedded_stdout.c \
|
||||||
|
${BTSTACK_ROOT}/platform/embedded/hci_dump_segger_rtt_stdout.c \
|
||||||
$(FREERTOS_ROOT)/FreeRTOS/tasks.c \
|
$(FREERTOS_ROOT)/FreeRTOS/tasks.c \
|
||||||
$(FREERTOS_ROOT)/FreeRTOS/queue.c \
|
$(FREERTOS_ROOT)/FreeRTOS/queue.c \
|
||||||
$(FREERTOS_ROOT)/FreeRTOS/list.c \
|
$(FREERTOS_ROOT)/FreeRTOS/list.c \
|
||||||
|
@ -74,7 +74,7 @@ All debug output can be either send via SEGGER RTT or via USART1. To get the con
|
|||||||
|
|
||||||
In src/btstack_config.h resp. in example/btstack_config.h of the generated projects, additional debug information can be enabled by uncommenting ENABLE_LOG_INFO.
|
In src/btstack_config.h resp. in example/btstack_config.h of the generated projects, additional debug information can be enabled by uncommenting ENABLE_LOG_INFO.
|
||||||
|
|
||||||
Also, the full packet log can be enabled in src/btstack_port.c by uncommenting the hci_dump_open(..) line. The console output can then be converted into .pklg files for OS X PacketLogger or WireShark by running tool/create_packet_log.py
|
Also, the full packet log can be enabled in src/btstack_port.c by uncommenting the hci_dump_init(..) line. The console output can then be converted into .pklg files for OS X PacketLogger or WireShark by running tool/create_packet_log.py
|
||||||
|
|
||||||
## GATT Database
|
## GATT Database
|
||||||
In BTstack, the GATT Database is defined via the .gatt file in the example folder. During the build, the .gatt file is converted into a .h file with a binary representation of the GATT Database and useful defines for the application.
|
In BTstack, the GATT Database is defined via the .gatt file in the example folder. During the build, the .gatt file is converted into a .h file with a binary representation of the GATT Database and useful defines for the application.
|
||||||
|
@ -49,6 +49,12 @@
|
|||||||
#include "btstack_config.h"
|
#include "btstack_config.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
|
#ifdef ENABLE_SEGGER_RTT
|
||||||
|
#include "hci_dump_segger_rtt_stdout.h"
|
||||||
|
#else
|
||||||
|
#include "hci_dump_embedded_stdout.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef ENABLE_SEGGER_RTT
|
#ifndef ENABLE_SEGGER_RTT
|
||||||
/********************************************
|
/********************************************
|
||||||
* system calls implementation
|
* system calls implementation
|
||||||
@ -582,8 +588,13 @@ void port_thread(void* args){
|
|||||||
|
|
||||||
// enable packet logger
|
// enable packet logger
|
||||||
#ifdef ENABLE_HCI_DUMP
|
#ifdef ENABLE_HCI_DUMP
|
||||||
// hci_dump_open(NULL, HCI_DUMP_STDOUT);
|
#ifdef ENABLE_SEGGER_RTT
|
||||||
|
// hci_dump_init(hci_dump_segger_rtt_stdout_get_instance());
|
||||||
|
#else
|
||||||
|
// hci_dump_init(hci_dump_embedded_stdout_get_instance());
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/// GET STARTED with BTstack ///
|
/// GET STARTED with BTstack ///
|
||||||
btstack_memory_init();
|
btstack_memory_init();
|
||||||
btstack_run_loop_init(btstack_run_loop_freertos_get_instance());
|
btstack_run_loop_init(btstack_run_loop_freertos_get_instance());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user