1*34fd36daSMatthias Ringwald# BTstack Port for Renesas Target Board TB-S1JA with CC256x 223d55d81SMatthias Ringwald 323d55d81SMatthias RingwaldThis port uses the Renesas TB-S1JA with TI's CC256XEM ST Adapter Kit that allows to plug in a CC256xB or CC256xC Bluetooth module. 423d55d81SMatthias RingwaldRenesas e2 Studio (Eclise-based) was used with the SSP HAL and without an RTOS. 523d55d81SMatthias RingwaldFor easy debugging, Ozone project files are generated as well. 623d55d81SMatthias Ringwald 723d55d81SMatthias Ringwald## Hardware 823d55d81SMatthias Ringwald 923d55d81SMatthias RingwaldRenesas Target Board TB-S1JA: 1023d55d81SMatthias Ringwald- [TB-S1JA Target Board Kit](https://www.renesas.com/eu/en/products/synergy/hardware/kits/tb-s1ja.html) 1123d55d81SMatthias Ringwald 1223d55d81SMatthias Ringwald- CC2564B Bluetooth Controller: 1323d55d81SMatthias Ringwald 1. The best option is to get it as a BoostPack 1423d55d81SMatthias Ringwald - Info: BOOST-CC2564MODA: http://www.ti.com/tool/BOOST-CC2564MODA 1523d55d81SMatthias Ringwald 2. Alternatively, get the evaluation module together with the EM Wireless Booster pack and a 32.768 kHz oscillator 1623d55d81SMatthias Ringwald - EM Wireless Booster Pack: 1723d55d81SMatthias Ringwald - [Info](http://www.ti.com/tool/BOOST-CCEMADAPTER) 1823d55d81SMatthias Ringwald - [User Guide](http://www.ti.com/lit/pdf/swru338) 1923d55d81SMatthias Ringwald - CC256x Bluetooth module: 2023d55d81SMatthias Ringwald - [CC2564B Dual-mode Bluetooth® Controller Evaluation Module](https://store.ti.com/cc2564modnem.aspx) 2123d55d81SMatthias Ringwald - [CC2564C Dual-mode Bluetooth® Controller Evaluation Module](https://store.ti.com/CC256XCQFN-EM-CC2564C-Dual-Mode-Bluetooth-Controller-Evaluation-Module-P51277.aspx) 2223d55d81SMatthias Ringwald - The module with the older CC2564B is around USD 20, while the one with the new CC2564C costs around USD 60 2323d55d81SMatthias Ringwald 2423d55d81SMatthias RingwaldThe projects are configured for the CC2564C. When using the CC2564B, *bluetooth_init_cc2564B_1.8_BT_Spec_4.1.c* should be used as cc256x_init_script. You can update this in the create_examples.py script. 2523d55d81SMatthias Ringwald 2623d55d81SMatthias RingwaldConnct the Target Board to the TI Boosterpack, see Booster Pack Pinout: http://www.ti.com/ww/en/launchpad/dl/boosterpack-pinout-v2.pdf 2723d55d81SMatthias Ringwald 2823d55d81SMatthias Ringwald 2923d55d81SMatthias RingwaldJ2 PIN | S1JA PORT | S1JA Signal | Boosterpack 3023d55d81SMatthias Ringwald-------|-----------|-------------|------------ 3123d55d81SMatthias Ringwald2 | P301 | RXD0 | 3 (LP1) 3223d55d81SMatthias Ringwald4 | P302 | TXD0 | 4 (LP1) 3323d55d81SMatthias Ringwald6 | P304 | CTS0 | 36 (LP2) 3423d55d81SMatthias Ringwald8 | P303 | RTS0 | 37 (LP2) 3523d55d81SMatthias Ringwald10 | VCC | VCC | 1 (LP1) 3623d55d81SMatthias Ringwald12 | VSS | GND | 20 (LP2) 3723d55d81SMatthias Ringwald14 | P112 | nShutdown | 19 (LP1) 3823d55d81SMatthias Ringwald 3923d55d81SMatthias Ringwald## Software 4023d55d81SMatthias Ringwald 4123d55d81SMatthias RingwaldGenerate example projects 4223d55d81SMatthias Ringwald 43c6c20663SMatthias Ringwald $ python create_examples.py 4423d55d81SMatthias Ringwald 4523d55d81SMatthias RingwaldThis will generate an e2 Studio project for each example. 4623d55d81SMatthias Ringwald 473035e4e5SMatthias Ringwald### Excluded Examples 483035e4e5SMatthias Ringwald 493035e4e5SMatthias RingwaldThe a2dp examples (a2dp_source_demo and a2dp_sink_demo) were disabled as the C open-source SBC codec 503035e4e5SMatthias Ringwaldwith compile option -O2 wasn't fast enough to provide real-time encoding/decoding. 513035e4e5SMatthias Ringwald 5223d55d81SMatthias Ringwald 5323d55d81SMatthias Ringwald## Build, Flash And Run The Examples in e2 Studio 5423d55d81SMatthias Ringwald 5523d55d81SMatthias RingwaldOpen the e2 Studio project and press the 'Debug' button. Debug output is only available via SEGGER RTT. You can run SEGGER's JLinkRTTViewer or use Ozone as described below. 5623d55d81SMatthias Ringwald 5723d55d81SMatthias Ringwald 5823d55d81SMatthias Ringwald## Run Example Project using Ozone 5923d55d81SMatthias Ringwald 603035e4e5SMatthias RingwaldAfter compiling the project with e2 Studio, the genereated .elf file can be used with Ozone (also e.g. on macOS). 613035e4e5SMatthias RingwaldIn Ozone, the debug output is readily available in the terminal. A .jdebug file is provided in the project folder. 6223d55d81SMatthias Ringwald 6323d55d81SMatthias Ringwald 6423d55d81SMatthias Ringwald## Debug output 6523d55d81SMatthias Ringwald 6623d55d81SMatthias RingwaldAll debug output is send via SEGGER RTT. 6723d55d81SMatthias Ringwald 6823d55d81SMatthias RingwaldIn 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. 6923d55d81SMatthias Ringwald 70057ebb45SMatthias RingwaldAlso, the full packet log can be enabled in src/hal_entry.c by uncommenting the hci_dump_init(...) call. 713035e4e5SMatthias RingwaldThe console output can then be converted into .pklg files by running tool/create_packet_log.py. The .pklg file can be 723035e4e5SMatthias Ringwaldanalyzed with the macOS X PacketLogger or WireShark. 7323d55d81SMatthias Ringwald 7423d55d81SMatthias Ringwald## GATT Database 75c6c20663SMatthias RingwaldIn BTstack, the GATT Database is defined via the .gatt file in the example folder. The create_examples.py script converts the .gatt files into a corresponding .h for the project. After updating a .gatt file, the .h can be updated manually by running the provided update_gatt_db.sh or update_gatt_db.bat scripts. 7623d55d81SMatthias Ringwald 77c6c20663SMatthias RingwaldNote: In theory, this can be integrated into the e2 Studio/Eclipse project. 7823d55d81SMatthias Ringwald 7923d55d81SMatthias Ringwald 8023d55d81SMatthias Ringwald## Notes 8123d55d81SMatthias Ringwald- HCI UART is set to 2 mbps. Using 3 or 4 mbps causes hang during startup 8223d55d81SMatthias Ringwald 8323d55d81SMatthias Ringwald 8423d55d81SMatthias Ringwald## Nice to have 853035e4e5SMatthias Ringwald- Allow compilation using Makefile/CMake without the e2 Studio, e.g. on the Mac. 86