Automatically exported from code.google.com/p/utooth
utooth is a Bluetooth stack for constrained devices. Currently utooth is supported in TI's MSP430 Microcontroller series and for PAN1323 Bluetooth module. The communcation with the module happens using 4 wire UART.
It is easy to extend to other constrained microcontrollers and bluetooth modules. It is ideal for baremetal firmware. It is also easily extendable if an RTOS is being used.
Following features are supported:
- HCI
- L2CAP
- RFCOMM
To build the stack the following is needed:
- gcc-msp430 (GCC Tools)
- binutils-msp430 (Bin utils)
- gdb-msp430 (MSP430 GDB Utils)
- msp430-libc (Standard C Library files)
- msp430mcu (Target specific files)
To install the build tools in Ubuntu:
sudo apt install gcc-msp430 binutils-msp430 gdb-msp430 msp430-libc msp430mcu
To flash the binary the following is used:
- MSPDEBUG
To install MSPDEBUG in Ubuntu:
sudo apt install mspdebug
To build the project make sure you have the above build utilities.
Following are the steps:
mkdir bin obj
make
Following will be the sample output:
msp430-gcc -mmcu=msp430f5438a -I./include -c src/bluetooth_init_cc2560A_2.1.c -o obj/bluetooth_init_cc2560A_2.1.o
msp430-gcc -mmcu=msp430f5438a -g -Wall -I./include -c src/bt_control_init.c -o obj/bt_control_init.o
msp430-gcc -mmcu=msp430f5438a -g -Wall -I./include -c src/btdev.c -o obj/btdev.o
src/btdev.c: In function ‘main’:
src/btdev.c:212:2: warning: implicit declaration of function ‘init_timer_A0’ [-Wimplicit-function-declaration]
msp430-gcc -mmcu=msp430f5438a -g -Wall -I./include -c src/cq.c -o obj/cq.o
msp430-gcc -mmcu=msp430f5438a -g -Wall -I./include -c src/hal_board.c -o obj/hal_board.o
msp430-gcc -mmcu=msp430f5438a -g -Wall -I./include -c src/hal_buttons.c -o obj/hal_buttons.o
msp430-gcc -mmcu=msp430f5438a -g -Wall -I./include -c src/hal_compat.c -o obj/hal_compat.o
msp430-gcc -mmcu=msp430f5438a -g -Wall -I./include -c src/hal_lcd.c -o obj/hal_lcd.o
msp430-gcc -mmcu=msp430f5438a -g -Wall -I./include -c src/hal_timer.c -o obj/hal_timer.o
msp430-gcc -mmcu=msp430f5438a -g -Wall -I./include -c src/hal_uart_dma.c -o obj/hal_uart_dma.o
msp430-gcc -mmcu=msp430f5438a -g -Wall -I./include -c src/hal_usb.c -o obj/hal_usb.o
msp430-gcc -mmcu=msp430f5438a -g -Wall -I./include -c src/hal_usb_uart.c -o obj/hal_usb_uart.o
msp430-gcc -mmcu=msp430f5438a -g -Wall -I./include -c src/hci.c -o obj/hci.o
src/hci.c: In function ‘send_hci_cmd’:
src/hci.c:240:14: warning: assignment makes pointer from integer without a cast [enabled by default]
src/hci.c: In function ‘handle_hci_event’:
src/hci.c:747:16: warning: variable ‘tmp’ set but not used [-Wunused-but-set-variable]
msp430-gcc -mmcu=msp430f5438a -g -Wall -I./include -c src/l2cap.c -o obj/l2cap.o
src/l2cap.c: In function ‘process_l2cap_pkt’:
src/l2cap.c:204:11: warning: variable ‘l2cap_len’ set but not used [-Wunused-but-set-variable]
src/l2cap.c:520:9: warning: ‘conn’ may be used uninitialized in this function [-Wuninitialized]
msp430-gcc -mmcu=msp430f5438a -g -Wall -I./include -c src/list.c -o obj/list.o
msp430-gcc -mmcu=msp430f5438a -g -Wall -I./include -c src/rfcomm.c -o obj/rfcomm.o
msp430-gcc -mmcu=msp430f5438a -g -Wall -I./include obj/bluetooth_init_cc2560A_2.1.o obj/bt_control_init.o obj/btdev.o obj/cq.o obj/hal_board.o obj/hal_buttons.o obj/hal_compat.o obj/hal_lcd.o obj/hal_timer.o obj/hal_uart_dma.o obj/hal_usb.o obj/hal_usb_uart.o obj/hci.o obj/l2cap.o obj/list.o obj/rfcomm.o -o bin/btdev -mmcu=msp430f5438a -Wl,-Map=mem.map
msp430-objcopy -O ihex bin/btdev bin/btdev.hex
Currently the project is under hiatus. I would restart it if I am able to get time or funding. Please feel free to contact me if you need to extend the stack by funding me.