123d55d81SMatthias 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 43*c6c20663SMatthias Ringwald $ python create_examples.py 4423d55d81SMatthias Ringwald 4523d55d81SMatthias RingwaldThis will generate an e2 Studio project for each example. 4623d55d81SMatthias Ringwald 4723d55d81SMatthias Ringwald 4823d55d81SMatthias Ringwald## Build, Flash And Run The Examples in e2 Studio 4923d55d81SMatthias Ringwald 5023d55d81SMatthias 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. 5123d55d81SMatthias Ringwald 5223d55d81SMatthias Ringwald 5323d55d81SMatthias Ringwald## Run Example Project using Ozone 5423d55d81SMatthias Ringwald 5523d55d81SMatthias RingwaldAfter compiling the project with e2 Studio, the genereated .elf file can be used with Ozone. In Ozone, the debug output is readily available. A .jdebug file is provided in the project folder. 5623d55d81SMatthias Ringwald 5723d55d81SMatthias Ringwald 5823d55d81SMatthias Ringwald## Debug output 5923d55d81SMatthias Ringwald 6023d55d81SMatthias RingwaldAll debug output is send via SEGGER RTT. 6123d55d81SMatthias Ringwald 6223d55d81SMatthias 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. 6323d55d81SMatthias Ringwald 6423d55d81SMatthias RingwaldAlso, the full packet log can be enabled in src/port.c The console output can then be converted into .pklg files for OS X PacketLogger or WireShark by running tool/create_packet_log.py 6523d55d81SMatthias Ringwald 6623d55d81SMatthias Ringwald 6723d55d81SMatthias Ringwald## GATT Database 68*c6c20663SMatthias 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. 6923d55d81SMatthias Ringwald 70*c6c20663SMatthias RingwaldNote: In theory, this can be integrated into the e2 Studio/Eclipse project. 7123d55d81SMatthias Ringwald 7223d55d81SMatthias Ringwald 7323d55d81SMatthias Ringwald## ToDo 7423d55d81SMatthias Ringwald- Implement hal_flash_bank_renesas_ssp 7523d55d81SMatthias Ringwald 7623d55d81SMatthias Ringwald 7723d55d81SMatthias Ringwald## Notes 7823d55d81SMatthias Ringwald- HCI UART is set to 2 mbps. Using 3 or 4 mbps causes hang during startup 7923d55d81SMatthias Ringwald 8023d55d81SMatthias Ringwald 8123d55d81SMatthias Ringwald## Nice to have 8223d55d81SMatthias Ringwald- Allow compilation using Makefile/CMake on macOS 83