1*34fd36daSMatthias Ringwald# BTstack Port for MSP432P401 Launchpad with CC256x 2e01e7c76SMatthias Ringwald 3e01e7c76SMatthias RingwaldThis port is for the the TI MSP432P401R Launchpad with TI's CC256x Bluetooth Controller using TI's DriverLib (without RTOS). 4e01e7c76SMatthias RingwaldFor easy development, Ozone project files are generated as well. 5e01e7c76SMatthias Ringwald 6e01e7c76SMatthias RingwaldAs the MSP432P401 does not have support for hardware RTS/CTS, this port makes use of Ping Pong DMA transfer mode 7e01e7c76SMatthias Ringwald(similar to circular DMA on other MCUs) to use two adjacent receive buffers and raise RTS until a completed buffer is processed. 8e01e7c76SMatthias Ringwald 9e01e7c76SMatthias Ringwald## Hardware 10e01e7c76SMatthias Ringwald 11e01e7c76SMatthias Ringwald[TI MSP432P401R LaunchPad](https://www.ti.com/tool/MSP-EXP432P401R) 12e01e7c76SMatthias Ringwald 13e01e7c76SMatthias RingwaldAs Bluetooth Controller, there are two BoosterPacks that can be use: 14e01e7c76SMatthias Ringwald1. [BOOST-CC2564MODA CC2564B BoosterPack](https://www.ti.com/tool/BOOST-CC2564MODA) (USD 20) 15e01e7c76SMatthias Ringwald2. [Evaluation Module (EM) Adapto](https://www.ti.com/tool/TIDM-LPBP-EMADAPTER) (USD 20) with one of the CC256x modules: 16e01e7c76SMatthias Ringwald - [CC2564B Dual-mode Bluetooth® Controller Evaluation Module](https://store.ti.com/cc2564modnem.aspx) (USD 20) 17e01e7c76SMatthias Ringwald - [CC2564C Dual-mode Bluetooth® Controller Evaluation Module](https://store.ti.com/CC256XCQFN-EM-CC2564C-Dual-Mode-Bluetooth-Controller-Evaluation-Module-P51277.aspx) (USD 60) 18e01e7c76SMatthias Ringwald 19e01e7c76SMatthias RingwaldThe CC2564B Booster pack is around USD 20 while thhe EM Adapter with the CC2564C module is around USD 80. 20e01e7c76SMatthias Ringwald 21e01e7c76SMatthias RingwaldThe project in the BTstack repo `port/msp432p401lp-cc256x' is configured for the EM Adapter + newer CC2564C module. 22e01e7c76SMatthias Ringwald 23e01e7c76SMatthias RingwaldWhen using the CC2564B (either as BOOST-CC2564MODA or CC2564B Dual-mode Bluetooth® Controller Evaluation Module), the *bluetooth_init_cc2564B_1.8_BT_Spec_4.1.c* must be used as cc256x_init_script. See Makefile variable INIT_SCRIPT. 24e01e7c76SMatthias Ringwald 25e01e7c76SMatthias RingwaldWhen using the CC2564B Booster Pack, please use uncomment the defines for the GPIO definition (search for `BOOST-CC2564MODA`) 26e01e7c76SMatthias Ringwald 27e01e7c76SMatthias RingwaldWhen using the EM Adapter Booster Pack, please make sure to solder a 32.768 kHz quarz oscillator as explained in 4.7 of the [EM Wireless Booster Pack User Guide](http://www.ti.com/lit/ug/swru338a/swru338a.pdf). If you don't have an oscillator of that size, you might solder one upside done (turtle-on-back style) to the unused upper right pad and wire GCC, VCC, and clock with thin wires. 28e01e7c76SMatthias Ringwald 29e01e7c76SMatthias Ringwald 30e01e7c76SMatthias Ringwald## Software 31e01e7c76SMatthias Ringwald 32e01e7c76SMatthias RingwaldTo build all examples, you need the regular ARM GCC toolcahin installed. Run make 33e01e7c76SMatthias Ringwald 34e01e7c76SMatthias Ringwald $ make 35e01e7c76SMatthias Ringwald 36e01e7c76SMatthias RingwaldAll examples and the .jdebug Ozone project files are placed in the 'gcc' folder. 37e01e7c76SMatthias Ringwald 38e01e7c76SMatthias Ringwald 39e01e7c76SMatthias Ringwald## Flash And Run The Examples 40e01e7c76SMatthias Ringwald 41e01e7c76SMatthias RingwaldThe Makefile builds different versions: 42e01e7c76SMatthias Ringwald- example.elf: .elf file with all debug information 43e01e7c76SMatthias Ringwald- example.bin: .bin file that can be used for flashing 44e01e7c76SMatthias Ringwald 45e01e7c76SMatthias RingwaldThere are different options to flash and debug the MSP432P401R LaunchPad. If all but the jumpers for power (the left three) are removed on J101, an external JTAG like SEGGER's J-Link can be connected via J8 'MSP432 IN'. 46e01e7c76SMatthias Ringwald 47e01e7c76SMatthias Ringwald## Run Example Project using Ozone 48e01e7c76SMatthias Ringwald 49e01e7c76SMatthias RingwaldWhen using an external J-Link programmer, you can flash and debug using the cross-platform [SEGGER Ozone Debugger](https://www.segger.com/products/development-tools/ozone-j-link-debugger/). It is included in some J-Link programmers or can be used for free for evaluation usage. 50e01e7c76SMatthias Ringwald 51e01e7c76SMatthias RingwaldJust start Ozone and open the .jdebug file in the build folder. When compiled with `ENABLE_SEGGER_RTT`, the debug output shows up in the Terminal window of Ozone. 52e01e7c76SMatthias Ringwald 53e01e7c76SMatthias Ringwald 54e01e7c76SMatthias Ringwald## Debug output 55e01e7c76SMatthias Ringwald 56e01e7c76SMatthias RingwaldAll debug output is send via SEGGER RTT or via USART2. To get the console from USART2, remove `ENABLE_SEGGER_RTT` from btstack_config.h and open a terminal to the virtual serial port of the Launchpad at 115200. 57e01e7c76SMatthias Ringwald 58e01e7c76SMatthias RingwaldIn btstack_config.h resp. in example/btstack_config.h of the generated projects, additional debug information can be disabled/enabled via ENABLE_LOG_INFO. 59e01e7c76SMatthias Ringwald 605d255a7aSMatthias RingwaldAlso, 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 61e01e7c76SMatthias Ringwald 62e01e7c76SMatthias Ringwald 63e01e7c76SMatthias Ringwald## GATT Database 64e01e7c76SMatthias RingwaldIn 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. 65