1*23d55d81SMatthias Ringwald# BTstack port for Renesas Target Board TB-S1JA with CC256x 2*23d55d81SMatthias Ringwald 3*23d55d81SMatthias 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. 4*23d55d81SMatthias RingwaldRenesas e2 Studio (Eclise-based) was used with the SSP HAL and without an RTOS. 5*23d55d81SMatthias RingwaldFor easy debugging, Ozone project files are generated as well. 6*23d55d81SMatthias Ringwald 7*23d55d81SMatthias Ringwald## Hardware 8*23d55d81SMatthias Ringwald 9*23d55d81SMatthias RingwaldRenesas Target Board TB-S1JA: 10*23d55d81SMatthias Ringwald- [TB-S1JA Target Board Kit](https://www.renesas.com/eu/en/products/synergy/hardware/kits/tb-s1ja.html) 11*23d55d81SMatthias Ringwald 12*23d55d81SMatthias Ringwald- CC2564B Bluetooth Controller: 13*23d55d81SMatthias Ringwald 1. The best option is to get it as a BoostPack 14*23d55d81SMatthias Ringwald - Info: BOOST-CC2564MODA: http://www.ti.com/tool/BOOST-CC2564MODA 15*23d55d81SMatthias Ringwald 2. Alternatively, get the evaluation module together with the EM Wireless Booster pack and a 32.768 kHz oscillator 16*23d55d81SMatthias Ringwald - EM Wireless Booster Pack: 17*23d55d81SMatthias Ringwald - [Info](http://www.ti.com/tool/BOOST-CCEMADAPTER) 18*23d55d81SMatthias Ringwald - [User Guide](http://www.ti.com/lit/pdf/swru338) 19*23d55d81SMatthias Ringwald - CC256x Bluetooth module: 20*23d55d81SMatthias Ringwald - [CC2564B Dual-mode Bluetooth® Controller Evaluation Module](https://store.ti.com/cc2564modnem.aspx) 21*23d55d81SMatthias Ringwald - [CC2564C Dual-mode Bluetooth® Controller Evaluation Module](https://store.ti.com/CC256XCQFN-EM-CC2564C-Dual-Mode-Bluetooth-Controller-Evaluation-Module-P51277.aspx) 22*23d55d81SMatthias Ringwald - The module with the older CC2564B is around USD 20, while the one with the new CC2564C costs around USD 60 23*23d55d81SMatthias Ringwald 24*23d55d81SMatthias 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. 25*23d55d81SMatthias Ringwald 26*23d55d81SMatthias RingwaldConnct the Target Board to the TI Boosterpack, see Booster Pack Pinout: http://www.ti.com/ww/en/launchpad/dl/boosterpack-pinout-v2.pdf 27*23d55d81SMatthias Ringwald 28*23d55d81SMatthias Ringwald 29*23d55d81SMatthias RingwaldJ2 PIN | S1JA PORT | S1JA Signal | Boosterpack 30*23d55d81SMatthias Ringwald-------|-----------|-------------|------------ 31*23d55d81SMatthias Ringwald2 | P301 | RXD0 | 3 (LP1) 32*23d55d81SMatthias Ringwald4 | P302 | TXD0 | 4 (LP1) 33*23d55d81SMatthias Ringwald6 | P304 | CTS0 | 36 (LP2) 34*23d55d81SMatthias Ringwald8 | P303 | RTS0 | 37 (LP2) 35*23d55d81SMatthias Ringwald10 | VCC | VCC | 1 (LP1) 36*23d55d81SMatthias Ringwald12 | VSS | GND | 20 (LP2) 37*23d55d81SMatthias Ringwald14 | P112 | nShutdown | 19 (LP1) 38*23d55d81SMatthias Ringwald 39*23d55d81SMatthias Ringwald## Software 40*23d55d81SMatthias Ringwald 41*23d55d81SMatthias RingwaldGenerate example projects 42*23d55d81SMatthias Ringwald 43*23d55d81SMatthias Ringwald $ ./create_examples.py 44*23d55d81SMatthias Ringwald 45*23d55d81SMatthias RingwaldThis will generate an e2 Studio project for each example. 46*23d55d81SMatthias Ringwald 47*23d55d81SMatthias Ringwald 48*23d55d81SMatthias Ringwald## Build, Flash And Run The Examples in e2 Studio 49*23d55d81SMatthias Ringwald 50*23d55d81SMatthias 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. 51*23d55d81SMatthias Ringwald 52*23d55d81SMatthias Ringwald 53*23d55d81SMatthias Ringwald## Run Example Project using Ozone 54*23d55d81SMatthias Ringwald 55*23d55d81SMatthias 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. 56*23d55d81SMatthias Ringwald 57*23d55d81SMatthias Ringwald 58*23d55d81SMatthias Ringwald## Debug output 59*23d55d81SMatthias Ringwald 60*23d55d81SMatthias RingwaldAll debug output is send via SEGGER RTT. 61*23d55d81SMatthias Ringwald 62*23d55d81SMatthias 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. 63*23d55d81SMatthias Ringwald 64*23d55d81SMatthias 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 65*23d55d81SMatthias Ringwald 66*23d55d81SMatthias Ringwald 67*23d55d81SMatthias Ringwald## GATT Database 68*23d55d81SMatthias 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. 69*23d55d81SMatthias Ringwald 70*23d55d81SMatthias RingwaldNote: In theory, this can be integrated into the Eclipse project, in fact, it's easy to configure it as an Eclipse Builder, but it got tricky to get it working with templates. 71*23d55d81SMatthias Ringwald 72*23d55d81SMatthias Ringwald 73*23d55d81SMatthias Ringwald## ToDo 74*23d55d81SMatthias Ringwald- Implement hal_flash_bank_renesas_ssp 75*23d55d81SMatthias Ringwald 76*23d55d81SMatthias Ringwald 77*23d55d81SMatthias Ringwald## Notes 78*23d55d81SMatthias Ringwald- HCI UART is set to 2 mbps. Using 3 or 4 mbps causes hang during startup 79*23d55d81SMatthias Ringwald 80*23d55d81SMatthias Ringwald 81*23d55d81SMatthias Ringwald## Nice to have 82*23d55d81SMatthias Ringwald- Allow compilation using Makefile/CMake on macOS 83*23d55d81SMatthias Ringwald 84