Posts: 7
Registered: ‎04-03-2017

BG Lib for MSP controller for developing BLE master using BLE121LR

Hi, Guys...


Till now I worked on BG Script for developing BLE Master. But now I want to move on BG Lib for OTA and other features. In my project, we are using BLE121LR module and MSP430 as the host controller. 


All I need now is a BG Lib for MSP controller. I tried to include the BGLib I got with Bluegiga SDK. But as they are for the desktop application, they are giving too many errors. So if any one has customized BG Lib for 8051 or ARM or MSP please share with me. 


Thanks in advance. 

Posts: 2,821
Registered: ‎08-25-2015

Re: BG Lib for MSP controller for developing BLE master using BLE121LR



You might have better luck on TI's forum, here's a few threads that came up when I searched "BGLIB MSP430" on google:





Posts: 7
Registered: ‎04-03-2017

Re: BG Lib for MSP controller for developing BLE master using BLE121LR

Hi, Tiago,


Thank you so much... Actually, I used native TI MSP 430 compiler, but to use your BG Lib, I have to use MSP430 GCC compiler. I achieved this. But when I am trying to connect to a device using ble_cmd_gap_connect_direct(&connect_addr, gap_address_type_public, 40, 60, 100, 0), the final BG API command going to BLE121LR is  00 0F 06 03 FF FF FF FF FF FF 00 28 00 3C 00 64 00 00 00 ... But here the address I am sending is going as all FFs. Actual address I am passing is 0xAB,0x65,0xD8,0x44,0x16,0xFF. Below is the code how I am doing it.


bd_addr found_devices[MAX_DEVICES];
bd_addr connect_addr;
bd_addr temp_

volatile unsigned char flag_systemboot = 0, flag_device_found = 1,flag_connection = 0,conn_handler = 9,rssi_read=0;
volatile unsigned char do_scanning=0;
char temp_add[6] = {0xAB,0x65,0xD8,0x44,0x16,0xFF};
//char temp_add1[6] = {0xFF,0x16,0x44,0xD8,0x65,0xAB};
//short unsigned int temp_add1[6] = {0xFF,0x16,0x44,0xD8,0x65,0xAB};


void ble_evt_gap_scan_response(const struct ble_msg_gap_scan_response_evt_t *msg)


debug_transmit_String("Data: ");
for(int i=0;i<msg->data.len;i++)
debug_transmit_String(" \r\n");

flag_device_found = memcmp(msg->sender.addr,temp_add,6);

if(flag_device_found == 0)
for (int i = 0; i < 6; i++) {
connect_addr.addr[i] = temp_add1[i];

flag_device_found = 1;


ble_cmd_gap_connect_direct(&connect_addr, gap_address_type_public, 40, 60, 100, 0);



debug_transmit_String("Addr: ");
for(int i=0;i<6;i++)
debug_transmit_String(" \r\n");




In the above code, I am scanning and getting scan responses from BLE. I am comparing the address I am getting the scan response to address I stored. Whenever this is a success, then in the same function I am trying to connect the device. I am able to copy the address into the variable, and I verified it by printing the data in that variable. But when the ble_connect_direct command is implementing in the code, the address going to BLE device is FF FF FF FF FF FF which is not the address I am passing.