This project is an attempt to write an open-source BlueTooth Low Energy stack for TI cc2540 and cc2541 RF MCUs.
At the moment, the only way to write BTLE applications for those chips is to use a binary stack from TI which can only be used in conjuction with the expensive IAR 8051 compiler.
The open-source stack would be built with SDCC. The firmware can then be uploaded to the chip by using the CC Debugger which is supported by cc-tool.
The starting point for this project was the Pololu Wixel SDK which uses a very similar chip, the cc2511 and SDCC. This is where I took and adapted the files for basic register support, UART and USB. The radio code however will need heavy modifications and maybe reverse engineering in order to work on the cc254x for sending BTLE frames.
It seems that cc254x is being replaced by cc2650 which is the same kind of RF MCU but with an ARM core. Even though the cc254x is still marked ACTIVE, this project could be not quite relevant for new harware applications. But I have a lot of cc254x hardware lying around plus I have the feeling that cc254x is closer to already documented chips that work with open-source software.
The Makefile is a mess at the moment, look at it and adapt any hardcoded paths if necessary.
Run make
to build the libraries and examples.
Run HEX=test_XXXX.hex make flash
to flash any of the examples onto the chip.
test_blink.c
works and prooves that SDCC can be used to produce code for cc254xtest_uart.c
works and is essential for starting to poke the radio hardwaretest_time.c
uses TIMER4 interrupts to generate a millisecond clocktest_usb.c
ugly and incomplete but works for sending data through CDC ACM (cc2540 only)
Now that we have serial communications with the chip, I'm trying to start the radio interface and receive BTLE advertising frames which is the starting point for writing a BTLE stack. I'll post the code as soon as I have something working.
- CC2540/41 System-on-Chip Solution for 2.4- GHz Bluetooth ® low energy Applications User's Guide
- SDCC Manual
- TI BLE stack
- Pololu Wixel SDK
- various cheap cc2540 and cc2541 boards from eBay
- TI cc2541 SensorTag devkit
- TI CC Debugger programmer
- cc-tool for using the CC debugger on Linux