Reputation: 121
I have a BLE113 chip wired like so:
https://i.sstatic.net/bWj57.jpg
I've measured the voltage through the wires to make sure that power is going into the BLE113 board, and a constant input of 3.3V is (which is what is required).
I flashed the chip using the BGDemo project found on Bluegiga's website, and on http://edisonthk.wordpress.com/2014/01/18/getting-started-with-developing-bluetooth-4-0-le-and-android-with-ble112-bluetooth-module/
The bgdemo script:
dim addr(6)
# Boot Event listener
event system_boot(major ,minor ,patch ,build ,ll_version ,protocol_version ,hw )
#Get local BT address
call system_address_get( )(addr(0:6))
# Write BT address to DI service serial number string
call attributes_write(xgatt_dis_2a25,0,6,addr(0:5))
#set to advertising mode
call gap_set_mode(gap_general_discoverable,gap_undirected_connectable)
#set bondable mode
call sm_set_bondable_mode(1)
end
# Disconnection event listener
event connection_disconnected(handle,result)
#connection disconnected, continue advertising
call gap_set_mode(gap_general_discoverable,gap_undirected_connectable)
end
No errors came up through bgbuild. And I mark the chip as discoverable and connectable yet none of my bluetooth devices are discovering the chip, why?
Upvotes: 0
Views: 1422
Reputation: 121
After contacting BlueGiga support about this, they responded with a solution... The BGDemo is unfortunately not set up properly, however when I update my board with the Heart Rate Demo, for example, It is fully discoverable.
When connected to the LightBlue app for iPhones with BLE, all simulated heart information is received as well.
However, the only differences in the Heart Rate demo compared to the BGDemo is the code, all of the project files are virtually the same. Reminding me: BG Support explained that addr should be called with start and length, not start and end like how i was using it when i called the following:
call attributes_write(xgatt_dis_2a25,0,6,addr(0:5))
As such, it should be addr(0:6) instead.
Upvotes: 0
Reputation: 925
Did you add <device type="ble113" />
to project.xml
(or project.bgproj
)?
See Bluegiga's knowledge base article for more information. But in general, to convert a BLE112 project (like bgdemo) to a BLE113 project:
<device type="ble113" />
to project.xml (or project.bgproj)I don't think the last two bullets apply, so check to make sure you have the correct device type in your project file (most likely named project.bgproj
).
Example:
<?xml version="1.0" encoding="UTF-8" ?>
<project>
<gatt in="gatt.xml" />
<hardware in="hardware.xml" />
<script in="bgdemo.bgs" />
<image out="out.hex" />
<device type="ble113" />
<boot fw="bootuart" />
</project>
Upvotes: 1