1# BTstack Port with Cinnamon for Semtech SX1280 Controller on Miromico FMLR-80 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/) 17and our [SX1280 Shield](https://github.com/bluekitchen/sx1280-shield) - see (port/stm32-l476rg-nucleo-sx1280). 18On the FMLR-80-P-STL4E module, the 52 Mhz clock for the SX1280 is controlled by the MCU. 19 20SEGGER RTT is used for debug output, so a Segger J-Link programmer is required. 21 22Uses 32.768 kHz crytstal as LSE for timing 23 24Support for Broadcast and Peripheral roles. 25 26The Makefile project compiles gatt_counter, gatt_streamer_server, hog_mouse and hog_keyboard examples. 27 28## Limitation 29 30### Advertising State: 31- Only Connectable Advertising supported 32- Only fixed public BD_ADDR of 33:33:33:33:33:33 is used 33 34### Connection State: 35- Encryption not implemented 36- Some LL PDUs not supported 37 38### Central Role: 39- Not implemented 40 41### Observer Role: 42- Not implemented 43 44### Low power mode - basically not implemented: 45- MCU does not sleep 46- SPI could be disabled during sleep 47- 1 ms SysTick is used for host stack although 16-bit tick time is provided by LPTIM1 based on 32768 Hz LSE. 48 49## Getting Started 50 51For the FMLR-80-P-STL4E module, just run make. You can upload the EXAMPLE.elf file created in build folder, 52e.g. with Ozone using the provided EXAMPLE.jdebug, and run it. 53 54## TODO 55 56### General 57- indicate random address in advertising pdus 58- allow to set random BD_ADDR via HCI command and use in Advertisements 59- support other regular adv types 60- handle Encryption 61 62## Low Power 63- enter STANDY_RC mode when idle 64- implement MCU sleep (if next wakeup isn't immediate) 65- sleep after connection request until first packet from Central 66- replace SysTick with tick counter based on LPTIM1 67- disable SPI on MCU sleep 68 69