hci_dump: stm32 ports

This commit is contained in:
Matthias Ringwald 2021-03-10 12:29:13 +01:00
parent 25d9a2cd74
commit 09df40bd40
13 changed files with 68 additions and 11 deletions

View File

@ -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/micro-ecc/uECC.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/yxml/yxml.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_tlv_flash_bank.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/ble/ancs_client.c \
${BTSTACK_ROOT}/src/ble/att_db.c \

View File

@ -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.
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
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.

View File

@ -19,6 +19,9 @@
#ifdef ENABLE_SEGGER_RTT
#include "SEGGER_RTT.h"
#include "hci_dump_segger_rtt_stdout.h"
#else
#include "hci_dump_embedded_stdout.h"
#endif
//
@ -316,7 +319,12 @@ void port_main(void){
btstack_memory_init();
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
hci_init(hci_transport_h4_instance(btstack_uart_block_embedded_instance()), (void*) &config);

View File

@ -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_tlv_flash_bank.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/ble/ancs_client.c \
${BTSTACK_ROOT}/src/ble/att_db.c \

View File

@ -60,6 +60,9 @@
#ifdef ENABLE_SEGGER_RTT
#include "SEGGER_RTT.h"
#include "hci_dump_segger_rtt_stdout.h"
#else
#include "hci_dump_embedded_stdout.h"
#endif
static btstack_packet_callback_registration_t hci_event_callback_registration;
@ -130,8 +133,12 @@ void port_main(void){
btstack_memory_init();
btstack_run_loop_init(btstack_run_loop_embedded_get_instance());
// uncomment for packet log
// 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
hci_init(hci_transport_h2_stm32_instance(), NULL);

View File

@ -41,6 +41,7 @@ VPATH += ${BTSTACK_ROOT}/example
C_SOURCES = \
${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_printf.c \
${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT_Syscalls_GCC.c \
${BTSTACK_ROOT}/chipset/em9301/btstack_chipset_em9301.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_tlv_flash_bank.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/ble/att_db.c \
${BTSTACK_ROOT}/src/ble/att_dispatch.c \

View File

@ -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.
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
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.

View File

@ -61,6 +61,9 @@
#ifdef ENABLE_SEGGER_RTT
#include "SEGGER_RTT.h"
#include "hci_dump_segger_rtt_stdout.h"
#else
#include "hci_dump_embedded_stdout.h"
#endif
// retarget printf
@ -477,7 +480,12 @@ void port_main(void){
btstack_memory_init();
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
btstack_run_loop_set_data_source_handler(&transport_data_source, &hal_spi_em9304_process);

View File

@ -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_Syscalls_GCC.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/ble/ancs_client.c \
${BTSTACK_ROOT}/src/ble/att_db.c \

View File

@ -58,6 +58,12 @@
#include "btstack_tlv_none.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){
printf("Assert: file %s, line %u\n", file, line_nr);
@ -116,8 +122,12 @@ void btstack_port(void){
// init HCI
hci_init(hci_transport, NULL);
// enable full log output while porting
// 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
// hand over to btstack embedded code
btstack_main();

View File

@ -43,6 +43,7 @@ C_SOURCES = \
${BTSTACK_ROOT}/3rd-party/micro-ecc/uECC.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_printf.c \
${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT_Syscalls_GCC.c \
${BTSTACK_ROOT}/platform/freertos/btstack_run_loop_freertos.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}/platform/embedded/hal_flash_bank_memory.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/queue.c \
$(FREERTOS_ROOT)/FreeRTOS/list.c \

View File

@ -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.
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
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.

View File

@ -49,6 +49,12 @@
#include "btstack_config.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
/********************************************
* system calls implementation
@ -582,8 +588,13 @@ void port_thread(void* args){
// enable packet logger
#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
/// GET STARTED with BTstack ///
btstack_memory_init();
btstack_run_loop_init(btstack_run_loop_freertos_get_instance());