Smart Bluetooth Forum Discussions
Impee-BCM20736S is an imp-to-Bluetooth LE gateway built with the BCM20736S SIP from Broadcom. The BCM20736S is programmed using Broadcom’s “WICED Smart” SDK. This gateway reference design allows the BCM20736S SIP to be reprogrammed remotely via the imp. The imp can also interact with and manage the application running on the BCM20736S by interacting with the BLE module via UART.
Learn More...
Show LessPlease join Broadcom, Avnet and our Module partners who will be hosting an IoT Workshop and Seminar.
Register here: http://www.em.avnet.com/en-us/design/trainingandevents/Pages/Broadcom-IoT-Workshop.aspx
Bluetooth:
Broadcom's WICED™ (Wireless Internet Connectivity for Embedded Devices), SMART (Embedded Bluetooth Low Energy), is a very low-power family of pin-compatible devices that, when paired with the included Eclipse-based SDK/Development Kit, vastly reduces the effort required to add “Bluetooth Smart” wireless connectivity for a wide range of IoT embedded applications.
The Broadcom BCM20732/36/37 are members of Broadcom's low-power Bluetooth Smart SOC family of solutions in the WICED portfolio. This family enables market-leading Bluetooth Smart solutions at competitive price points and lower power consumption than comparable solutions on the market. Its powerful set of features includes, among others, simultaneous Master/Slave, ADC, PWM, along with a full Embedded BLE stack and numerous configurable BLE profiles included in ROM (i.e. proximity, heart rate monitor, thermometer, blood pressure monitor, time and others).
Broadcom has also partnered with Anaren, http://www.anaren.com/, to extend support of this BLE family to their revolutionary new Atmosphere development tool which enables embedded developers to create wireless code and mobile application code in one, extraordinarily user-friendly web environment.
Register here: http://www.em.avnet.com/en-us/design/trainingandevents/Pages/Broadcom-IoT-Workshop.aspx
Wi-Fi:
On the Wi-Fi side of connectivity, Broadcom also provides a full-featured Eclipse-based SDK/Development Kit. Additionally, Broadcom is leading the way with Apple MFi HomeKit ready and Universal Bluetooth Smart to WLAN combo chip designs, all of which allow the developers to create secure embedded wireless networking applications on an existing microcontroller, or on an additional WICED module that includes a microcontroller.
The BCM4334X is a single–chip integrated quad radio (WLAN/BT 4.1/FM/& Near Field Communications [NFC], with integrated low noise amplifiers (LNAs) and a transmit/receive (Tx/Rx) switch which offers a level of integration that greatly reduces the external part count, PCB footprint, and overall cost of the embedded wireless solution.
Broadcom has partnered with Inventek Systems, http://www.inventeksys.com, to deliver the first production modules based on the highly anticipated and very integrated BCM4334X offering. Broadcom is also working with Inventek to deliver complete turnkey hardware solutions of different form factors to readily enable Wi-Fi, BLE and NFC connectivity in system design. Inventek also offers IWIN (Inventek Wireless Interoperability Network), firmware, a very compelling and user friendly FW protocol to ensure maximum optimization and seamless integration of WICED. In addition, Inventek also provides customers Cloud-ready Agent FW, IWINC (Inventek Wireless Interoperability Network for Clouds) to enable IoT platforms to seamless connect to target Cloud Owners and/or Providers.
Workshop Objective:
During this session attendees will receive an overview of Broadcom’s WICED Smart and WICED Wi-Fi IoT solutions, including a glimpse into the Roadmap for these products. In addition, hands-on demos will be provided which include detailed technical discussion on both Wi-Fi and Bluetooth Low Energy software and hardware topics which affect today’s embedded IoT developer.
Date / Location: See Below
Time: 9:30 AM - 3:30 PM
Register here: http://www.em.avnet.com/en-us/design/trainingandevents/Pages/Broadcom-IoT-Workshop.aspx
Locations:
TARGET CITY TARGET DATE
Irvine 29-Apr
Los Angeles 30-Apr
Toronto 5-May
Montreal 7-May
Chicago 12-May
Minneapolis 14-May
San Jose 21-May
Boston 16-Jun
Dallas 18-Jun
Vancouver 23-Jun
San Francisco 25-Jun
Cost: Free
Additional Note: For the morning session, a laptop computer with an existing Anaren A20737A-MSDK1 development board and their Atmosphere development environment already setup is preferred. Limited Wi-Fi access will be provided within the classroom, but for best results it’s recommended that you bring a Wi-Fi hotspot with you as well.
The first 20 registrants will receive both an Anaren A20737A-MSDK1 development kit along with one of the new and yet to be announced Inventek BCM4334X USB Thumb Drive based kits free of charge.
Register here: http://www.em.avnet.com/en-us/design/trainingandevents/Pages/Broadcom-IoT-Workshop.aspx
Show LessOriginally launched in Q1 of 2015, Anaren Atmosphere 1.1 updates include new BLE and embedded features, new developer tool features, and more.
Anaren, Inc.’s Wireless Connectivity Group announced today that its Anaren Integrated Radio (AIR) module team has introduced a range of 1.1 updates and improvements to its recently introduced Anaren Atmosphere online development platform. Launched in January 2015, Anaren Atmosphere uniquely provides embedded product manufacturers with tools to wirelessly connect their products to the Internet, making the IOT revolution accessible to its customers) via Bluetooth Smart equipped devices. Based on solicited user feedback, the 1.1 version of the platform further enhances user experience and functionality.
“Ever since we launched our AIR module family in 2010, our guiding principal has been to provide small- to mid-size companies with tools to empower them to wirelessly connect their designs to the Internet, leveraging the IoT without having either RF expertise or App Development skills,” said Mark Bowyer, Anaren’s Director of Wireless Business Development. “The January 2015 introduction of our Atmosphere platform was an important step in that effort. And now, only months later, these new 1.1 features continue that journey.”
External MCU Design Purpose
BCM2073X is a great SoC for most of IoT/wearable products.But an external MCU may be needed for more complicated use case such as smart watch on which there are LCD, camera etc. This article is a guide on hardware design between BC2073X and external MCU.
System Architecture Introduction
Architecture Diagram
The following Figure shows the usual connection between MCU and BCM2073X chip, together with some other devices.
Fig1
The Interconnection BUS between MCU and BCM2073X
There are at least five interconnection bus needed between MCU and our BCM2073X chip: UART RX/TX, RESET, INT, and Wake up signals.
UART RX/TX buses are recommended to do data communication work, like notification status reporting data, external sensors inputting data, LCD display data, camera image data etc.
A reset signal from MCU to BCM2073X chip is used to give a reset signal when BCM2073X chip starts
up, or at any time when BCM2073X work abnormally.
An INT signal is an interruption from BCM2073X chip to MCU. For the occasion when MCU is in sleep mode, there are incoming calls,
messages, alarm or other notifications from the smartphones, tablets or other smart devices, which are connected with our BCM2073X chip through Bluetooth4.0/4.1. BCM2073X chip delivers these messages to MCU once it gets them, so that MCU can manage the related external devices to make the related response.The related response includes turning on or off LCD/LED/Vibrator/buzzer, etc., we can see the related devices showed on the above Fig.
A wake up signal is critical to MCU to wake up BCM2073X chip, when BCM2073X is in sleeping mode. For example when there are inputs from sensors, MCU will send a dedicated status update to BCM2073X after calculation, and BCM2073X chip pass them to the smart device for notifying the end user.
SW Download/Debugging Interface
SW downloading and debugging interface is located in MCU side, the software download interface can be UART or USB. This is determined by the MCU chip we choose. Ask support from MCU vendor for detailed download method.
The debugging interface can be shared with the download UART interface, or other ports. It’s also determined by MCU chips.
RF Testing Interface
We can do RF testing by separately controlling BCM2073X chip to enter into a testing mode by using Broadcom MBT tool. For HW, we connect BCM2073X chip UART RX/TX pin with a computer’s RS232 port. A level shift is needed for keeping the voltage of the two side at the same level, usually 5V voltage level from the computer side, a Vx(for BCM2073X chip, the voltage range is1.6-3.6V, the dedicated value of Vx is determined by BCM2073X, MCU and all the other device) voltage level from the board side. We can also have another simple way to add a USB to COM converting chip to connect BCM2073X UART RX/TX pin on the PCB board with the computers by common USB bus. Please refer the picture below for the detail physical connection between the instruments and the tested device.
For the detailed testing procedures we can refer to the application notes of BLE RF Testing Setup Procedures.
Of course, we have some other methods to do the RF testing, since the extra MCU is the master chip of the whole board, we choose MCU UART interface for commands inputting interface, the dedicated testing commands were sent by the putty or hyper terminal tool passing MCU UART interface to control BCM2073X chip, of course the detailed controlling way mostly rely on the MCU system used; or we also can have another method to integrate the dedicated testing commands into the source code of MCU system side, downloading into the memory on the board, a special testing tool can be added in a APK tool of the smart device in the far end, the special commands of APK tools trig the different testing mode of BLE chip, let the testing work going on by the clear human-computer interaction interface APK tool. MCU pass them to the BCM2073X chips, let it enter into the related testing mode.
Components Selections
For the wearable products, power consumption is the critical side for whole system. Both application requirement and power consumption should be considered during component selection. For MCU, Freescale’s KL25 is one of recommends for wearable products.
LDO or DC to DC convertor is the other key component on the board, the lower working power and the lower idle leakage current is preferred. SII S-1313 is one of recommendation with only 10nA current consumption in sleeping mode.
The other devices like G-sensor, LCD, UV-sensor, etc.Please also consider its working power consumption and standby, sleep power
consumption, make sure they have deep sleep mode and wake up mechanism, when not used, can enter into the deep sleep mode for power consumption reducing and easily return from the deep sleep mode.
Components’ dimension size is needed to be taken into the considerations, which can make the total PCB board smaller and flexible to fulfill the different shape demands of the wearable products. For example, 0201package size is preferred to the RCL parts. CSP and BGA package is recommended for IC chip,and module with more integrated functions is preferred for the ultra small wearable products.
Overview
The BLE profile configuration structure BLE_PROFILE_CFG is used to configure parameters for WICED Smart device, such as advertising, connection, encryption, TX power level, find-me profile, led, buzzer and buttons. The structure BLE_PROFILE_CFG is defined in bleprofile.h. This document describes definition of parameters and gives some examples how to use them.
// BLE Profile Configuration
typedef PACKED struct
{
UINT16 fine_timer_interval; // ms
UINT8 default_adv; // default adv
UINT8 button_adv_toggle; // pairing button make adv toggle (if 1) or always on (if 0)
UINT16 high_undirect_adv_interval; // slots
UINT16 low_undirect_adv_interval; // slots
UINT16 high_undirect_adv_duration; // seconds
UINT16 low_undirect_adv_duration; // seconds
UINT16 high_direct_adv_interval; // seconds
UINT16 low_direct_adv_interval; // seconds
UINT16 high_direct_adv_duration; // seconds
UINT16 low_direct_adv_duration; // seconds
char local_name[LOCAL_NAME_LEN_MAX];
char cod[COD_LEN]; // First two bytes are used as appearance
char ver[VERSION_LEN];
UINT8 encr_required; // if 1, encryption is needed before sending indication/notification
UINT8 disc_required; // if 1, disconnection after confirmation
UINT8 test_enable;
UINT8 tx_power_level; // dbm
UINT8 con_idle_timeout; // second
UINT8 powersave_timeout; // second
UINT16 hdl[HANDLE_NUM_MAX]; // GATT HANDLE number
UINT16 serv[HANDLE_NUM_MAX]; // GATT service UUID
UINT16 cha[HANDLE_NUM_MAX]; // GATT characteristic UUID
UINT8 findme_locator_enable; // if 1 Find me locator is enable
UINT8 findme_alert_level; // alert level of find me
UINT8 client_grouptype_enable; // if 1 grouptype read can be used
UINT8 linkloss_button_enable; // if 1 linkloss button is enable
UINT8 pathloss_check_interval; // second
UINT8 alert_interval; // interval of alert
UINT8 high_alert_num; // number of alert for each interval
UINT8 mild_alert_num; // number of alert for each interval
UINT8 status_led_enable; // if 1 status LED is enable
UINT8 status_led_interval; // second
UINT8 status_led_con_blink; // blink num of connection
UINT8 status_led_dir_adv_blink; // blink num of dir adv
UINT8 status_led_un_adv_blink; // blink num of undir adv
UINT16 led_on_ms; // led blink on duration in ms
UINT16 led_off_ms; // led blink off duration in ms
UINT16 buz_on_ms; // buzzer on duration in ms
UINT8 button_power_timeout; // seconds
UINT8 button_client_timeout; // seconds
UINT8 button_discover_timeout; // seconds
UINT8 button_filter_timeout; // seconds
#ifdef BLE_UART_LOOPBACK_TRACE
UINT8 button_uart_timeout; // seconds
#endif
}BLE_PROFILE_CFG;
UINT16 fine_timer_interval
Define the timeout of fine timer. The resolution of fine timer is 12.5ms, developer can define the timeout by multiplying 12.5ms, but max value is 1000ms.
The application use the function bleprofile_regTimerCb to register the callback function of fine timer, use the function bleprofile_StartTimer/bleprofile_KillTimer to start/stop fine timer.
UINT8 default_adv
Define the default mode of discovery. The following definition of discovery mode is in bleprofile.h.
//Discoverable mode
enum ble_discover_mode
{
NO_DISCOVERABLE = 0,
LOW_DIRECTED_DISCOVERABLE = 1,
HIGH_DIRECTED_DISCOVERABLE = 2,
LOW_UNDIRECTED_DISCOVERABLE = 3,
HIGH_UNDIRECTED_DISCOVERABLE = 4,
MANDATORY_DISCOVERABLE = 0xFF, //without NVRAM checking and start high undirected advertising
};
All central devices can connect peripheral device if the peripheral device is set to undirected discovery mode, but only special central device can connect peripheral device if the peripheral device is set to directed discovery mode.
The “default_adv” usually is used in function xxx_connDown, the following sample code is in bletime.c.
void bletime_connDown(void)
{
…
// Mandatory discovery mode
if(bleprofile_p_cfg->default_adv == MANDATORY_DISCOVERABLE)
{
bleprofile_Discoverable(HIGH_UNDIRECTED_DISCOVERABLE, NULL);
}
// check NVRAM for previously paired BD_ADDR
else
{
bleprofile_ReadNVRAM(VS_BLE_HOST_LIST, sizeof(BLEPROFILE_HOSTINFO), (UINT8 *)&bletime_hostinfo);
bleprofile_Discoverable(bleprofile_p_cfg->default_adv, bletime_hostinfo.bdAddr);
}
…
}
UINT8 button_adv_toggle
Enable or Disable the advertising toggle when BUTTON_DISCOVER pressed.
If enable “button_adv_toogle”, the discover mode will be changed from HIGH_UNDIRECTED_DISCOVERABLE or LOW_UNDIRECTED_DISCOVERABLE to NO_DISCOVERABLE when BUTTON_DISCOVER is pressed.
The following reference code is in bleprofile.c.
void bleprofile_ReadButton(void)
{
...
//BUTTON_DISCOVER is pressed
// application level overide
if (bleprofile_buttonfunctionCb)
{
if (bleprofile_buttonfunctionCb(BUTTON_DISCOVER))
{
TRACE(TRACE_INFO, MODULE_ID_BLEAPP, "Button function %d skipped", TVF_D(BUTTON_DISCOVER));
return;
}
}
…
if ((bleprofile_GetDiscoverable()!= HIGH_UNDIRECTED_DISCOVERABLE) && (bleprofile_GetDiscoverable()!= LOW_UNDIRECTED_DISCOVERABLE))
{
//disconnect if connection exist
if (emconinfo_getState() == CONNECTION)
{
// We want to drop the connection.
// This will call bleprofile_connDown()
// This corner case is prevented by if (bleprofile_app_powersave == -1);
bleprofile_app_powersave = -1; //disable powersave defer
blecm_disconnect(BT_ERROR_CODE_CONNECTION_TERMINATED_BY_LOCAL_HOST);
}
bleprofile_Discoverable(HIGH_UNDIRECTED_DISCOVERABLE, NULL);
}
else if (bleprofile_p_cfg->button_adv_toggle)
{
bleprofile_Discoverable(NO_DISCOVERABLE, NULL);
}
…
}
UINT16 high_undirect_adv_interval
UINT16 low_undirect_adv_interval
Define the interval of undirected advertising. Unit is slot, 0.625ms per slot. The range of interval is from 20 ms to 10.24 s.
UINT16 high_direct_adv_interval
UINT16 low_direct_adv_interval
Define the interval of directed advertising. Unit is second.
UINT16 high_undirect_adv_duration
UINT16 low_undirect_adv_duration
UINT16 high_direct_adv_duration
UINT16 low_direct_adv_duration
Define the duration of undirected or direct advertising. Unit is second.
char local_name[LOCAL_NAME_LEN_MAX]
Define the name of device. The name can be same with the UUID_CHARACTERISTIC_DEVICE_NAME definition in GATT DB, or be a shortened string from UUID_CHARACTERISTIC_DEVICE_NAME definition.
The “local_name” usually is used in customized advertising.
char cod[COD_LEN]
Define the appearance of device. Please use the same value with the UUID_CHARACTERISTIC_APPEARANCE definition in GATT DB.
The “cod” usually is used in customized advertising.
char ver[VERSION_LEN]
Define software version of application.
UINT8 encr_required
Define the encryption setting. The following definition of encryption is in bleprofile.h.
#define SECURITY_ENABLED 0x01
#define SECURITY_REQUEST 0x02
Enable the encryption if the SECURITY_ENABLED bit is set.
Send the encryption request by device when creating connection if the SECURITY_REQUEST bit is set.
The following reference code is in blecgm.c.
void blecgm_connUp(void)
{
…
if((bleprofile_p_cfg->encr_required&SECURITY_REQUEST) == SECURITY_REQUEST)
{
lesmp_sendSecurityRequest();
}
}
UINT8 disc_required
Define the setting of disconnect. The following definition is in bleprofile.h.
enum ble_disc_setting
{
DISC_NONE = 0x00,
DISC_AFTER_CONFIRM = 0x01,
DISC_ATT_TIMEOUT = 0x02,
DISABLE_ATT_TIMEOUT = 0x04,
};
- DISC_AFTER_CONFIRM
If DISC_AFTER_CONFIRM bit is set, disconnect the connection when confirmed the indication had sent.
The following sample code is in blews.c.
void blews_IndicationConf(void)
{
…
if((bleprofile_p_cfg->disc_required) & DISC_AFTER_CONFIRM)
{
if(blews_con_handle && blews_indication_enable && blews_measurement_done)
//Encryption and data measurement is done
{
blecm_disconnect(BT_ERROR_CODE_CONNECTION_TERMINATED_BY_LOCAL_HOST);
…
}
}
}
- DISC_ATT_TIMEOUT
If DISC_ATT_TIMEOUT bit is set, disconnect the connection when ATT timeout.
The following sample code is in blews.c.
void blews_transactionTimeout(void)
{
ble_trace0("WS ATT timeout");
if((bleprofile_p_cfg->disc_required) & DISC_ATT_TIMEOUT)
{
{
blecm_disconnect(BT_ERROR_CODE_CONNECTION_TERMINATED_BY_LOCAL_HOST);
…
}
}
}
- DISABLE_ATT_TIMEOUT
If DISABLE_ATT_TIMEOUT is set, disable the ATT timeout in communication.
The following reference code is in bleprofile.c.
void bleprofile_sendIndication(UINT16 attrHandle, UINT8 *attr, int len, LEATT_NO_PARAM_CB cb)
{
UINT8 data[LEATT_ATT_MTU];
LEATT_PDU_INDICATION_HDR *msg = (LEATT_PDU_INDICATION_HDR *)data;
//attrCode is written by leatt //UINT8 attrCode; // 0x1d = Handle Value Indicataion
msg->handle = attrHandle;
memcpy((UINT8 *)(msg + 1), attr, len);
if ((bleprofile_p_cfg->disc_required) & DISABLE_ATT_TIMEOUT)
{
leatt_setATTTimeout(0);
}
leatt_sendIndication(msg, len, cb);
}
UINT8 test_enable
Developer can add special or test code under “test_enable” control.
UINT8 tx_power_level
Define the default TX power level of device. But TX power level can be changed by function blecm_setTxPowerInADV or blecm_setTxPowerInConnection.
UINT8 con_idle_timeout
Define the timeout of connect idle timer. No timeout if “con_idle_timeout” value is 0.
Disconnect the connection if no communication between two BLE devices when connect idle timeout expires.
The following reference code is in bleprofile.c.
void bleprofile_connUp(void)
{
…
if (bleprofile_p_cfg && bleprofile_p_cfg->con_idle_timeout)
{
emconinfo_setIdleConnTimeout(bleprofile_p_cfg->con_idle_timeout);
blecm_startConnIdleTimer(bleprofile_appTimerCb);
}
…
}
void bleprofile_appTimerCb( UINT32 arg)
{
switch(arg)
{
…
case BLEAPP_APP_TIMER_CONN_IDLE:
{
int id = emconinfo_getAppTimerId();
if ( id >= 0 )
{
// we are going to stop the timer.
bleapptimer_stopAppTimer( id );
emconinfo_setAppTimerId(-1);
// We want to drop the connection.
blecm_disconnect(BT_ERROR_CODE_CONNECTION_TERMINATED_BY_LOCAL_HOST);
}
}
break;
…
}
}
UINT8 powersave_timeout
Define the timeout of power save. No timeout if “powersave_timeout “ value is 0.
If device no connection and no advertising, the device will enter power save mode when power-save timeout expires.
Note: If “powersave_timeout” value isn’t 0, the function bleprofile_pollPowersave must be called in normal timer callback functions, because whether enter power save mode or not is implemented in function bleprofile_pollPowersave.
UINT16 hdl[HANDLE_NUM_MAX]
UINT16 serv[HANDLE_NUM_MAX]
UINT16 cha[HANDLE_NUM_MAX]
Used to store the handles in the GATT DB. These handles are used to operate the GATT DB item in application.
The following sample code is in bleprox.c.
//find the handle, and store it.
void bleprox_DBInit(void)
{
…
for (i = 0; i < HANDLE_NUM_MAX; i++)
{
…
else if (bleprofile_p_cfg->serv == UUID_SERVICE_IMMEDIATE_ALERT &&
bleprofile_p_cfg->cha == UUID_CHARACTERISTIC_ALERT_LEVEL)
{
proxAppState->bleprox_ia_alt_hdl = bleprofile_p_cfg->hdl;
…
}
…
}
}
//use the handle to read the GATT DB
void bleprox_CheckPathLoss(void)
{
BLEPROFILE_DB_PDU db_pdu;
int result;
result = bleprofile_ReadHandle(proxAppState->bleprox_ia_alt_hdl, &db_pdu);
…
}
UINT8 findme_locator_enable
Enable or Disable find-me profile. The find-me profile is realized in ROM code.
If the bit0 of “findme_locator_enable” is 1, the ROM find-me profile is used to find the peer device.
If the bit1 of “findme_locator_enable” is 1, enable the find-me alert toggle.
The sample code , please refer to proximity_plus.c in SDK1.1.0.
UINT8 findme_alert_level
Define the alert level of find-me profile.
The following definition is in bleprox.h.
//Alert mode
enum ble_prox_alert_level
{
NO_ALERT = 0,
MILD_ALERT = 1,
HIGH_ALERT = 2,
UNDIRECTED_DISCOVERABLE_ALERT = 3,
};
UINT8 client_grouptype_enable
Enable or Disable the group type request when locating the find-me handle of peer device.
Locate the find-me handle of peer device by group-type request if “client_grouptype_enable” is set, locate the find-me handle of peer device by type request if “client_grouptype_enable” is clear.
The following reference code is in blefind.c.
void blefind_FindmeReq(void)
{
if (bleprofile_p_cfg->findme_locator_enable)
{
…
if (bleprofile_p_cfg->client_grouptype_enable)
{
bleprofile_sendReadByGroupTypeReq(findAppState->blefind_s_handle, findAppState->blefind_e_handle,
UUID_ATTRIBUTE_PRIMARY_SERVICE);
}
else
{
bleprofile_sendReadByTypeReq(findAppState->blefind_s_handle, findAppState->blefind_e_handle,
UUID_ATTRIBUTE_PRIMARY_SERVICE);
}
…
}
}
UINT8 linkloss_button_enable
Enable or Disable link-loss button.
The sample code refers to bleprox.c.
UINT8 pathloss_check_interval
Define the interval of checking path loss, unit is second.
The sample code refers to bleprox.c.
UINT8 alert_interval
Define the interval of device alert.
Usually use the LED or Buzzer to do an alert. The sample code refers to bleprox.c.
UINT8 high_alert_num
UINT8 mild_alert_num
Define the alert number for high or middle alert.
The sample code refers to bleprox.c.
UINT8 status_led_enable
Enable or Disable status LED. The status LED is used to indicate device status, such as advertising or connection.
The sample code refers to bleprox.c.
UINT8 status_led_interval
Define the blink interval of status LED. Unit is second.
UINT8 status_led_con_blink
Define the blink number of status LED when device is in connection state.
UINT8 status_led_dir_adv_blink
UINT8 status_led_un_adv_blink
Define LED blink number of status LED when device is sending undirected or direct advertising.
UINT16 led_on_ms
UINT16 led_off_ms
Define the duration of LED on or off when LED blink.
UINT16 buz_on_ms
Define the duration of buzzer on.
UINT8 button_power_timeout
UINT8 button_client_timeout
UINT8 button_discover_timeout
UINT8 button_filter_timeout
UINT8 button_uart_timeout
Define the timeout of BUTTON_POWER, BUTTON_CLIENT, BUTTON_DISCOVER, BUTTON_FILTER and BUTTON_UART.
The BUTTON_XXX is generated by long pressing the GPIO_BUTTON. For example, if the “button_power_timeout” value is 3, will detect the BUTTON_POWER is pressed when holding GPIO_BUTTON >3S.
Note: Must call the function bleprofile_ReadButton in fine timer callback function, because checking whether BUTTON_XXX is pressed or not in the function bleprox_ProxButton by polling.
The following sample code is in bleprox.c.
PLACE_IN_DROM const BLE_PROFILE_CFG bleprox_cfg =
{
…
/*.button_power_timeout =*/ 1, // seconds
/*.button_client_timeout =*/ 3, // seconds
/*.button_discover_timeout =*/ 5, // seconds
/*.button_filter_timeout =*/ 10, // seconds
#ifdef BLE_UART_LOOPBACK_TRACE
/*.button_uart_timeout =*/ 15, // seconds
#endif
};
void bleprox_Create(void)
{
…
bleprofile_regButtonFunctionCb(bleprox_ProxButton);
…
}
void bleprox_FineTimeout(UINT32 finecount)
{
…
bleprofile_ReadButton();
…
}
UINT32 bleprox_ProxButton(UINT32 function)
{
…
if (function == BUTTON_PRESS)
{
…
}
else if (function == BUTTON_RELEASE)
{
…
}
else if (function == BUTTON_POWER)
{
…
}
else if (function == BUTTON_CLIENT)
{
…
}
else if (function == BUTTON_DISCOVER)
{
…
}
…
return 0;
}
The source code of function bleprofile_ReadButoon is in bleprofile.c, please see the follow reference code to get more information. When detecting the BUTTON_XXX is pressed, call the button callback function that registered by function bleprofile_regButtonFunctionCb, then do the actions if button callback function return 0, or do nothing if button callback function return 1.
Show Lessvoid bleprofile_ReadButton(void)
{
…
//button pressed
{
…
// application level overide
if (bleprofile_buttonfunctionCb)
{
if (bleprofile_buttonfunctionCb(BUTTON_PRESS))
{
return;
}
}
bleprofile_LEDOn();
bleprofile_BUZBeep(bleprofile_p_cfg->buz_on_ms*2);
…
}
…
//button released
{ …
// application level overide
if (bleprofile_buttonfunctionCb)
{
if (bleprofile_buttonfunctionCb(BUTTON_RELEASE))
{
return;
}
}
bleprofile_LEDOff();
}
…
}
…
// button discover
{
if (bleprofile_p_cfg->button_discover_timeout &&
bleprofile_button_count >= bleprofile_p_cfg->button_discover_timeout * call_per_sec &&
bleprofile_button_count <= (bleprofile_p_cfg->button_discover_timeout + 1) * call_per_sec)
{
// application level overide
if (bleprofile_buttonfunctionCb)
{
if (bleprofile_buttonfunctionCb(BUTTON_DISCOVER))
{
return;
}
}
…
if ((bleprofile_GetDiscoverable()!= HIGH_UNDIRECTED_DISCOVERABLE) &&
(bleprofile_GetDiscoverable()!= LOW_UNDIRECTED_DISCOVERABLE))
{
//disconnect if connection exist
if (emconinfo_getState() == CONNECTION)
{
…
blecm_disconnect( BT_ERROR_CODE_CONNECTION_TERMINATED_BY_LOCAL_HOST);
}
bleprofile_Discoverable(HIGH_UNDIRECTED_DISCOVERABLE, NULL);
}
else if (bleprofile_p_cfg->button_adv_toggle)
{
bleprofile_Discoverable(NO_DISCOVERABLE, NULL);
}
}
…
}
This is a group for developers working on connected embedded devices, IoT, Internet of Things. Anaren offers Atmosphere development tool (atmosphere.anaren.com) with a graphical drag-and-drop user interface to rapidly create embedded application in parallel with a mobile application, all within hours. Truly Rapid Prototyping Platform that can be the Production Platform.
Sign up here: http://www.meetup.com/Atmosphere-IoT-Development-Platform/
Show LessCrystal warm-up work-around video
business explains in this thread the steps that need to be taken to implement the crystal warmup fix within your application: Re: BCM20732S module keeps crashing
Scroll down to his post on Mar 6, 2014 5:31 PM.
We managed to resolve this issue in firmware by doing the following:
1 - create a CSG file inside the application folder named app.csg with the content below:
ENTRY "PMU Crystal Warm up Time"
{
"Crystal warm up time" = 5000
}
Note that the default Crystal warm up time is 2500. By increasing this to 5000 we managed to resolve the issue.
2 - Add the following line to makefile.inc in the same folder:
GS_LIST += $(DIR)/app.cgs
This trick only works in SDK 1.1 and does NOT work in version 1.0.1.
Show Less1.
MSDK Series (Multi-Sensor Dev. Kit)
- Includes Multi-Sensor Development Board featuring an Accelerometer, a Magnetometer, an IR Temperature Sensor, a Buzzer, a Tri-color LED, a Joy Stick, and a Coin Cell Battery holder
- One USB 2.0 cable (Type A to Micro-B)
- Two Single row pin headers can be soldered down to gain access to all the pins in the A20737A module
- Incorporates Broadcom’s BCM20737
- Tiny 11x13x2.5 mm footprint of the A20737A AIR module
- Pre-certified to FCC/IC and ETSI compliant
- Low power consumption
- Anaren’s exclusive online development tool, Atmosphere (Demo Video here: ANAREN AIR V3 - YouTube)
- Atmosphere seamlessly generates and loads the embedded code on the Multi-Sensor Development Board, and creates an app that can be loaded onto the Broadcom Bluetooth Smart mobile device
2.
A20737A Module Series (Integrated Antenna)
- 2.4-GHz RF transceiver incorporating Broadcom's Bluetooth Smart technology
- 1.7 to 3.6V operation
- Operating temperature –30˚C to +85˚C
- Integrated ARM Cortex-M3 microprocessor core
- 512-Kbit EEPROM
- Programmable output power up to +3dBm
- Low Current Consumption (3.3V)
- 25mA in Rx
- 17mA in Tx @ -1dBm
- 20mA in Tx @ +3dBm
- Typical sleep current 2μA @ 3.3V
- Excellent receiver sensitivity, -94dBm average with <1% BER
- Infrared modulator
- 10-Bit auxiliary ADC with nine analog channels
- Support for secure OTA updates
- Integrated LDO
- Supports SPI, I2C, PWM, UART and GPIO peripheral interfaces
- RoHS Compliant
- Shielded package with an integrated antenna
- LGA Footprint
- Small package size: 11mm x 13mm x 2.5mm
- Approximate weight 0.5 grams
- Certified/compliant for use Worldwide
3.
A20737C Module Series (External Antenna)
- Same features as the A20737A above, but the internal antenna has been removed and a U.FL Connector is available for use with an external antenna.
Both parts are supported by Anaren’s exclusive online development tool, Atmosphere (Demo Video here: ANAREN AIR V3 - YouTube)
Show LessCentral and Peripheral
Role Central or Peripheral applies to the BLE connection itself. The device in the central role scans, looking for advertisement, and the device in the peripheral role makes the advertisement.
To understand the distinction, imagine that you have an Android phone and an activity tracker that is a BLE device. The phone supports the central role; the activity tracker supports the peripheral role (to establish a BLE connection you need one of each—two things that only support peripheral couldn't talk to each other, nor could two things that only support central).
Role Master and Slave
After a connection is established, the central device performs as a master and periodically polls the peripheral, which executes in slave role.
Before the Test
The BCM20732 does not support Master/Slave scenario. The BCM20736/BCM20737 will support the Master/Slave environment and is supported in the new SDK 2.x.
Read one of the following sessions to understand what are needed to test BLE. iOS device is used in my test. But Android device and Windows 8 PC can do the job as well.
Simultaneous Master/Slave
Test Configuration
The topology is as follows. EVB1 acts as Slave connected with iPhone. It acts as Master connected to EVB2 at the same time.
[Master:iPhone+LightBlue]
\_____
\
[Slave:BCM920736 EVB1+hello_client:Master]
\_____
\
[Slave:BCM920732/6/7 EVB2+hello_sensor]
Test Procedure
- Plug the EVB1(20736 or 20737, 20736 in this example) into your computer
- Build and download the application hello_client to EVB1 as showed in Figure 1
- Pair EVB1 with a client(iPhone4s or above with LightBlue)
- On iPhone(LightBlue) register for notifications
- Push a button on EVB1 to send notifications to the iPhone(LightBlue) as showed in Figure 2
- Build and download the application hello_sensor to EVB2 as showed in Figure 3. Make sure that your one slave device EVB2 (20732, 20736 or 20737 with hello_sensor) is up and advertising
- Push a button on EVB1 for 6 seconds. That will start connection process with EVB2.
- Push a button on the EVB2 with hello_sensor to deliver notification through hello_client device(EVB1) up to iPhone(LightBlue) as .
Figure 1
Figure 2
Figure 3
Figure 4
Multiple Slaves
Test Configuration
The topology is as follows. EVB1 acts as Slave connected with iPhone. It acts as Master connected to EVBx(x>=2) at the same time.
[Master:iPhone+LightBlue]
\_____
\
[Slave:BCM920736 EVB1+hello_client:Master]
\_____
\
[Slave:BCM920732/6/7 EVB2+hello_sensor]
[Slave:BCM920732/6/7 EVB3+hello_sensor]
[Slave:BCM920732/6/7 EVB4+hello_sensor]
[Slave:BCM920732/6/7 EVB5+hello_sensor]
Test Procedure
Repeat steps from 6 to 8 with another EVBx(x>=2) as showed in Figure 5, you can add more EVB with hello_sensor to the net and report notification.
Show Less