xref: /btstack/port/stm32-l476rg-nucleo-sx1280/README.md (revision 34fd36da1820bede7fdeb1f09f53c180688c8c25)
1*34fd36daSMatthias Ringwald# BTstack Port with Cinnamon for Semtech SX1280 Controller on STM32L476 Nucleo
26b8177c5SMatthias Ringwald
36b8177c5SMatthias Ringwald*Cinnamon* is BlueKitchen's minimal, yet robust Controller/Link Layer implementation for use with BTstack.
46b8177c5SMatthias Ringwald
56b8177c5SMatthias RingwaldIn contrast to common Link Layer implementations, our focus is on a robust and compact implementation for production use,
66b8177c5SMatthias Ringwaldwhere code size matters (e.g. current code size about 8 kB).
76b8177c5SMatthias Ringwald
86b8177c5SMatthias Ringwald## Overview
96b8177c5SMatthias Ringwald
106b8177c5SMatthias RingwaldThis 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.
116b8177c5SMatthias Ringwald
126b8177c5SMatthias RingwaldIt 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.
136b8177c5SMatthias Ringwald
146b8177c5SMatthias Ringwald## Status
156b8177c5SMatthias Ringwald
166b8177c5SMatthias RingwaldTested with the[Miromico FMLR-80-P-STL4E module](https://miromico.ch/portfolio/fmlr-8x-x-stlx/)
176b8177c5SMatthias Ringwald(see port/stm32-l451-miromico-sx1280) and the
186b8177c5SMatthias Ringwald[STM32 L476 Nucleo dev kit](https://www.st.com/en/evaluation-tools/nucleo-l476rg.html)
196b8177c5SMatthias Ringwaldwith our [SX1280 Shield](https://github.com/bluekitchen/sx1280-shield).
206b8177c5SMatthias Ringwald
216b8177c5SMatthias RingwaldSEGGER RTT is used for debug output, so a Segger J-Link programmer is required, but the on-board
226b8177c5SMatthias Ringwald[ST-Link programmer and debugger](https://www.st.com/en/development-tools/st-link-v2.html) can be replaced by an
236b8177c5SMatthias Ringwald[SEGGER J-Link OB](https://www.segger.com/products/debug-probes/j-link/models/other-j-links/st-link-on-board/).
246b8177c5SMatthias Ringwald
256b8177c5SMatthias RingwaldUses 32.768 kHz crytstal as LSE for timing
266b8177c5SMatthias Ringwald
276b8177c5SMatthias RingwaldSupport for Broadcast and Peripheral roles.
286b8177c5SMatthias Ringwald
296b8177c5SMatthias RingwaldThe Makefile project compiles gatt_counter, gatt_streamer_server, hog_mouse and hog_keyboard examples.
306b8177c5SMatthias Ringwald
316b8177c5SMatthias Ringwald## Limitation
326b8177c5SMatthias Ringwald
336b8177c5SMatthias Ringwald### Advertising State:
346b8177c5SMatthias Ringwald- Only Connectable Advertising supported
356b8177c5SMatthias Ringwald- Only fixed public BD_ADDR of 33:33:33:33:33:33 is used
366b8177c5SMatthias Ringwald
376b8177c5SMatthias Ringwald### Connection State:
386b8177c5SMatthias Ringwald- Encryption not implemented
396b8177c5SMatthias Ringwald- Some LL PDUs not supported
406b8177c5SMatthias Ringwald
416b8177c5SMatthias Ringwald### Central Role:
426b8177c5SMatthias Ringwald- Not implemented
436b8177c5SMatthias Ringwald
446b8177c5SMatthias Ringwald### Observer Role:
456b8177c5SMatthias Ringwald- Not implemented
466b8177c5SMatthias Ringwald
476b8177c5SMatthias Ringwald### Low power mode - basically not implemented:
486b8177c5SMatthias Ringwald- MCU does not sleep
496b8177c5SMatthias Ringwald- SPI could be disabled during sleep
506b8177c5SMatthias Ringwald- 1 ms SysTick is used for host stack although 16-bit tick time is provided by LPTIM1 based on 32768 Hz LSE.
516b8177c5SMatthias Ringwald
526b8177c5SMatthias Ringwald## Getting Started
536b8177c5SMatthias Ringwald
546b8177c5SMatthias RingwaldJust run make. You can upload the EXAMPLE.elf file created in build folder,
556b8177c5SMatthias Ringwalde.g. with Ozone using the provided EXAMPLE.jdebug, and run it.
566b8177c5SMatthias Ringwald
576b8177c5SMatthias Ringwald## TODO
586b8177c5SMatthias Ringwald
596b8177c5SMatthias Ringwald### General
606b8177c5SMatthias Ringwald- indicate random address in advertising pdus
616b8177c5SMatthias Ringwald- allow to set random BD_ADDR via HCI command and use in Advertisements
626b8177c5SMatthias Ringwald- support other regular adv types
636b8177c5SMatthias Ringwald- handle Encryption
646b8177c5SMatthias Ringwald
656b8177c5SMatthias Ringwald## Low Power
666b8177c5SMatthias Ringwald- enter STANDY_RC mode when idle
676b8177c5SMatthias Ringwald- implement MCU sleep (if next wakeup isn't immediate)
686b8177c5SMatthias Ringwald- sleep after connection request until first packet from Central
696b8177c5SMatthias Ringwald- replace SysTick with tick counter based on LPTIM1
706b8177c5SMatthias Ringwald- disable SPI on MCU sleep
716b8177c5SMatthias Ringwald
726b8177c5SMatthias Ringwald![STM32 L476RG Nucleo with SX1280 Shield](nucleo-with-sx1280-shield.jpg)
73