From 5d255a7a698d33ffc189721832fd1dd2aeb3e43c Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 10 Mar 2021 11:35:41 +0100 Subject: [PATCH] hci_dump: msp432 port --- port/msp432p401lp-cc256x/Makefile | 2 ++ port/msp432p401lp-cc256x/README.md | 2 +- port/msp432p401lp-cc256x/main.c | 12 +++++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/port/msp432p401lp-cc256x/Makefile b/port/msp432p401lp-cc256x/Makefile index c58fbeccc..dbe874a64 100755 --- a/port/msp432p401lp-cc256x/Makefile +++ b/port/msp432p401lp-cc256x/Makefile @@ -161,6 +161,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}/platform/lwip/port/sys_arch.c \ ${BTSTACK_ROOT}/platform/lwip/bnep_lwip.c \ diff --git a/port/msp432p401lp-cc256x/README.md b/port/msp432p401lp-cc256x/README.md index d3eb20aed..cb8837afb 100644 --- a/port/msp432p401lp-cc256x/README.md +++ b/port/msp432p401lp-cc256x/README.md @@ -57,7 +57,7 @@ All debug output is send via SEGGER RTT or via USART2. To get the console from U In btstack_config.h resp. in example/btstack_config.h of the generated projects, additional debug information can be disabled/enabled via ENABLE_LOG_INFO. -Also, the full packet log can be enabled in main.c by uncommenting the hci_dump_open(..) line. The 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 main.c by uncommenting the hci_dump_init(..) line. The output can then be converted into .pklg files for OS X PacketLogger or WireShark by running tool/create_packet_log.py ## GATT Database diff --git a/port/msp432p401lp-cc256x/main.c b/port/msp432p401lp-cc256x/main.c index 5cb2d4d5a..4522fb1cf 100755 --- a/port/msp432p401lp-cc256x/main.c +++ b/port/msp432p401lp-cc256x/main.c @@ -27,6 +27,12 @@ #include "classic/btstack_link_key_db_tlv.h" #include "ble/le_device_db_tlv.h" +#ifdef ENABLE_SEGGER_RTT +#include "hci_dump_segger_rtt_stdout.h" +#else +#include "hci_dump_embedded_stdout.h" +#endif + static void delay_ms(uint32_t ms); static hci_transport_config_uart_t config = { @@ -631,7 +637,11 @@ int main(void) btstack_run_loop_init(btstack_run_loop_embedded_get_instance()); // 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 hci_init(hci_transport_h4_instance(btstack_uart_block_embedded_instance()), (void*) &config);