1*e01e7c76SMatthias Ringwald# BTstack port for MSP432P401 Launchpad with CC256x 2*e01e7c76SMatthias Ringwald 3*e01e7c76SMatthias RingwaldThis port is for the the TI MSP432P401R Launchpad with TI's CC256x Bluetooth Controller using TI's DriverLib (without RTOS). 4*e01e7c76SMatthias RingwaldFor easy development, Ozone project files are generated as well. 5*e01e7c76SMatthias Ringwald 6*e01e7c76SMatthias RingwaldAs the MSP432P401 does not have support for hardware RTS/CTS, this port makes use of Ping Pong DMA transfer mode 7*e01e7c76SMatthias Ringwald(similar to circular DMA on other MCUs) to use two adjacent receive buffers and raise RTS until a completed buffer is processed. 8*e01e7c76SMatthias Ringwald 9*e01e7c76SMatthias Ringwald## Hardware 10*e01e7c76SMatthias Ringwald 11*e01e7c76SMatthias Ringwald[TI MSP432P401R LaunchPad](https://www.ti.com/tool/MSP-EXP432P401R) 12*e01e7c76SMatthias Ringwald 13*e01e7c76SMatthias RingwaldAs Bluetooth Controller, there are two BoosterPacks that can be use: 14*e01e7c76SMatthias Ringwald1. [BOOST-CC2564MODA CC2564B BoosterPack](https://www.ti.com/tool/BOOST-CC2564MODA) (USD 20) 15*e01e7c76SMatthias Ringwald2. [Evaluation Module (EM) Adapto](https://www.ti.com/tool/TIDM-LPBP-EMADAPTER) (USD 20) with one of the CC256x modules: 16*e01e7c76SMatthias Ringwald - [CC2564B Dual-mode Bluetooth® Controller Evaluation Module](https://store.ti.com/cc2564modnem.aspx) (USD 20) 17*e01e7c76SMatthias 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) 18*e01e7c76SMatthias Ringwald 19*e01e7c76SMatthias RingwaldThe CC2564B Booster pack is around USD 20 while thhe EM Adapter with the CC2564C module is around USD 80. 20*e01e7c76SMatthias Ringwald 21*e01e7c76SMatthias RingwaldThe project in the BTstack repo `port/msp432p401lp-cc256x' is configured for the EM Adapter + newer CC2564C module. 22*e01e7c76SMatthias Ringwald 23*e01e7c76SMatthias 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. 24*e01e7c76SMatthias Ringwald 25*e01e7c76SMatthias RingwaldWhen using the CC2564B Booster Pack, please use uncomment the defines for the GPIO definition (search for `BOOST-CC2564MODA`) 26*e01e7c76SMatthias Ringwald 27*e01e7c76SMatthias 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. 28*e01e7c76SMatthias Ringwald 29*e01e7c76SMatthias Ringwald 30*e01e7c76SMatthias Ringwald## Software 31*e01e7c76SMatthias Ringwald 32*e01e7c76SMatthias RingwaldTo build all examples, you need the regular ARM GCC toolcahin installed. Run make 33*e01e7c76SMatthias Ringwald 34*e01e7c76SMatthias Ringwald $ make 35*e01e7c76SMatthias Ringwald 36*e01e7c76SMatthias RingwaldAll examples and the .jdebug Ozone project files are placed in the 'gcc' folder. 37*e01e7c76SMatthias Ringwald 38*e01e7c76SMatthias Ringwald 39*e01e7c76SMatthias Ringwald## Flash And Run The Examples 40*e01e7c76SMatthias Ringwald 41*e01e7c76SMatthias RingwaldThe Makefile builds different versions: 42*e01e7c76SMatthias Ringwald- example.elf: .elf file with all debug information 43*e01e7c76SMatthias Ringwald- example.bin: .bin file that can be used for flashing 44*e01e7c76SMatthias Ringwald 45*e01e7c76SMatthias 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'. 46*e01e7c76SMatthias Ringwald 47*e01e7c76SMatthias Ringwald## Run Example Project using Ozone 48*e01e7c76SMatthias Ringwald 49*e01e7c76SMatthias 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. 50*e01e7c76SMatthias Ringwald 51*e01e7c76SMatthias 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. 52*e01e7c76SMatthias Ringwald 53*e01e7c76SMatthias Ringwald 54*e01e7c76SMatthias Ringwald## Debug output 55*e01e7c76SMatthias Ringwald 56*e01e7c76SMatthias 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. 57*e01e7c76SMatthias Ringwald 58*e01e7c76SMatthias 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. 59*e01e7c76SMatthias Ringwald 60*e01e7c76SMatthias RingwaldAlso, 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 61*e01e7c76SMatthias Ringwald 62*e01e7c76SMatthias Ringwald 63*e01e7c76SMatthias Ringwald## GATT Database 64*e01e7c76SMatthias 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