1# BTstack Port with Cinnamon for Semtech SX1280 Controller on STM32L476 Nucleo 2 3*Cinnamon* is BlueKitchen's minimal, yet robust Controller/Link Layer implementation for use with BTstack. 4 5In contrast to common Link Layer implementations, our focus is on a robust and compact implementation for production use, 6where code size matters (e.g. current code size about 8 kB). 7 8## Overview 9 10This port targets the Semtech SX1280 radio controller. The Host Stack and the Controller (incl. Link Layer) run on a STM32 MCU, with the SX1280 connected via SPI. 11 12It uses the SX1280 C-Driver from Semtech to communicate with the SX1280. The main modification was to the SPI driver that uses DMA for full packets. 13 14## Status 15 16Tested with the[Miromico FMLR-80-P-STL4E module](https://miromico.ch/portfolio/fmlr-8x-x-stlx/) 17(see port/stm32-l451-miromico-sx1280) and the 18[STM32 L476 Nucleo dev kit](https://www.st.com/en/evaluation-tools/nucleo-l476rg.html) 19with our [SX1280 Shield](https://github.com/bluekitchen/sx1280-shield). 20 21SEGGER RTT is used for debug output, so a Segger J-Link programmer is required, but the on-board 22[ST-Link programmer and debugger](https://www.st.com/en/development-tools/st-link-v2.html) can be replaced by an 23[SEGGER J-Link OB](https://www.segger.com/products/debug-probes/j-link/models/other-j-links/st-link-on-board/). 24 25Uses 32.768 kHz crytstal as LSE for timing 26 27Support for Broadcast and Peripheral roles. 28 29The Makefile project compiles gatt_counter, gatt_streamer_server, hog_mouse and hog_keyboard examples. 30 31## Limitation 32 33### Advertising State: 34- Only Connectable Advertising supported 35- Only fixed public BD_ADDR of 33:33:33:33:33:33 is used 36 37### Connection State: 38- Encryption not implemented 39- Some LL PDUs not supported 40 41### Central Role: 42- Not implemented 43 44### Observer Role: 45- Not implemented 46 47### Low power mode - basically not implemented: 48- MCU does not sleep 49- SPI could be disabled during sleep 50- 1 ms SysTick is used for host stack although 16-bit tick time is provided by LPTIM1 based on 32768 Hz LSE. 51 52## Getting Started 53 54Just run make. You can upload the EXAMPLE.elf file created in build folder, 55e.g. with Ozone using the provided EXAMPLE.jdebug, and run it. 56 57## TODO 58 59### General 60- indicate random address in advertising pdus 61- allow to set random BD_ADDR via HCI command and use in Advertisements 62- support other regular adv types 63- handle Encryption 64 65## Low Power 66- enter STANDY_RC mode when idle 67- implement MCU sleep (if next wakeup isn't immediate) 68- sleep after connection request until first packet from Central 69- replace SysTick with tick counter based on LPTIM1 70- disable SPI on MCU sleep 71 72 73