ATSAMB11 BluSDK SMART Example Profiles Application
User's Guide
Introduction
This document describes how to set the ATSAMB11-MR/ZR evaluation boards for various example
applications supported by the Advanced Software Framework (ASF). This document also provides the list
of supported IDEs to be used in conjunction with the ATSAMB11-MR/ZR evaluation boards (see Table
2-1). The part number of the ATSAMB11-MR Xplained Pro (XPro) board is ATSAMB11MR-XPRO and the
part number of the ATSAMB11-ZR Xplained Pro board is ATSAMB11ZR-XPRO.
Note: All example applications are included in the BluSDK SMART software package.
Figure 1. ATSAMB11 Xplained Pro Boards
Features
•Observer Application
•Proximity Monitor Application:
–Device discovery and disconnection
–Services and characteristics discovery
–Services – Link Loss service, Immediate Alert service, and Tx Power service
–Setting up Path Loss and Link Loss
–Received Signal Strength Indicator (RSSI) sampling
•Proximity Reporter Application:
–Advertisement
–Pairing/bonding
–Services – Link Loss service (mandatory), Immediate Alert service, and Tx Power service
This chapter describes the functional overview of all the applications that are pre-defined in Atmel Studio.
1.1 Observer Application
The Observer application is used for continuously listening to the advertisement data over the air. This
application supports the following advertisement data types:
•Incomplete list of 16-bit service class UUIDs
•Complete list of 16-bit service class UUIDs
•Incomplete list of 32-bit service class UUIDs
•Complete list of 32-bit service class UUIDs
•Incomplete list of 128-bit service class UUIDs
•Complete list of 128-bit service class UUIDs
•Shortened local name
•Complete local name
•Appearance
•Manufacturer specific data
•Tx Power
•Advertisement interval
ATSAMB11
1.2 Proximity Reporter Application
The Proximity profile is defined by the Bluetooth® SIG to enable proximity monitoring between two
Bluetooth Low Energy (BLE) devices. The Proximity Monitor (a Generic Attribute (GATT) client)
configures the behavior of the peer Proximity Reporter device (a GATT server) based on the link
conditions. The configuration includes setting the alert level, which triggers on the Link Loss or based on
a different threshold of the Path Loss. The Path Loss determines the quality of the connection and it is
derived out of the Received Signal Strength Indicator (RSSI) and transmits the power. The Proximity
Monitor continuously evaluates the Path Loss and creates an immediate alert in the Proximity Reporter
device when the Path Loss crosses threshold values.
On-Board LED Status
The on-board LED is configured to notify the user about the alerts received. The different alerts for the
Link Loss and Immediate Alert services are explained in the following subsections.
Link Loss
On the Link Loss, the LED blinks according to the alert level set by the Proximity Monitor. The alert levels
are:
•NO_ALERT for No alert level
•MILD_ALERT for Mild alert level
•HIGH_ALERT for High alert level
Based on the alert level configuration set by the Proximity Monitor, the LED blinks at different rates:
•If the alert level is “HIGH_ALERT” then the LED blinks faster (1 second interval)
•If the alert level is “MILD_ALERT” then the LED blinks moderately (2 second interval)
•If the alert level is “NO_ALERT” the LED must be off
This alert is applicable when the “Immediate Alert” service is implemented. The example application relies
on the Path Loss configuration done by the Proximity Monitor and notifies accordingly. The alert levels
are:
•NO_ALERT for No alert level
•MILD_ALERT for Mild alert level
•HIGH_ALERT for High alert level
Based on the alert level configuration set by the Proximity Monitor, the LED blinks at different rates:
•If the alert level is “HIGH_ALERT” then the LED blinks faster (3 second interval)
•If the alert level is “MILD_ALERT” then the LED blinks moderately (5 second interval)
•If the alert level is “NO_ALERT” the LED must be off
1.3 Proximity Monitor Application
The Proximity profile is defined by the Bluetooth SIG to enable proximity monitoring between two BLE
devices. The Proximity Monitor (a GATT client) configures the behavior of a peer Proximity Reporter
device (a GATT server) based on the link conditions. The Proximity Monitor configures the desired
behavior of the peer device through setting alert levels on the Link Loss and the Path Loss. In addition, it
also maintains the connection with the Proximity Reporter and monitors the link quality of the connection
based on RSSI reporting from the peer device.
ATSAMB11
1.4 ANCS Profile Application
The Apple Notification Center Service (ANCS) is used to enable a device to access notifications from an
iOS device that exposes ANCS.
The ANCS profile defines the following roles:
•Notification Provider (NP) is a device that provides the iOS notification
•Notification Consumer (NC) is a device that receives the iOS notifications and notification- related
data from Notification Provider
Incoming Call Notification
The programmed ATSAMB11-MR/ZR (Notification Consumer) must be paired with an iPhone® to display
the received incoming call notification on a console.
The Bluetooth SIG defined Alert Notification profile provides similar functionality for Android devices.
ANCS is a variant of the Alert Notification profile customized by Apple. For more details on Alert
Notification, refer to the Alert Notification Profile Application.
1.5 Scan Parameters Service Application
The Scan Parameter service is an example application that demonstrates how to retrieve scan interval
window information from a peer device. The Scan Parameter service must be implemented on a peer
device to retrieve scan interval information. This application implements a GATT server role. This
application can be used for obtaining the updated scan interval window value by configuring the scan
refresh characteristic for notification.
The Time Information Profile is an example application for a compatible Android/iPhone device for
implementing the BLE time service, such as current time, date and day, and displaying it on the console.
The profile defines the following roles:
•Time client, a device in a peripheral role to read the time, date, and day information
•Time server, a device to provide the time-related information
Note: This application is supported in iOS 7.0 and above or a BLE compatible Android device which has
the Microchip SmartConnect mobile application installed.
1.7 HID Mouse Device or HID Keyboard Device Application
The HID Over GATT Profile (HOGP) is defined by the Bluetooth SIG to enable HID services support over
a BLE protocol stack using the GATT profile. This allows devices like a keyboard or mouse to implement
HOGP and to connect with a compatible HOGP/BLE host device, such as mobile phone, tablet, TV, and
so on.
The HID Mouse device or HID Keyboard device application supports the following characteristics:
•Protocol mode (mouse/keyboard)
•Report (mouse/keyboard)
•Report map (mouse/keyboard)
•HID information (mouse/keyboard)
•HID control point (mouse/keyboard)
•Boot mouse input report (mouse only)
•Boot keyboard input report (keyboard only)
•Boot keyboard output report (keyboard only)
ATSAMB11
This example application simulates a function of a mouse or keyboard. Once the connection procedure is
implemented between a mobile phone and the ATSAMB11-MR/ZR board, the board can act as a mouse
or a keyboard.
In the case of a HID Mouse device application, a mouse cursor, visible in the mobile screen, can be
moved as per the predefined pattern by pressing the SW0 button on the board.
In the case of a HID keyboard device application, the predetermined text is sent to the mobile phone by
pressing the SW0 button on the board. This can be viewed in any standard text editor in the mobile
phone.
1.8 Battery Service Application
The Battery Service application is used for reporting the battery level of the device using the battery
characteristics. Any application discovering the database can access the battery service instance during
discovery services. This example application simulates the device battery level from 0% to 100%, with the
step of 1% every second.
1.9 Simple Broadcaster Application
The Simple Broadcaster application is used for continuously broadcasting the advertisement data over
the air. This application supports the following advertisement data types:
The Device Information Service (DIS) application is used for providing a setup for the user to define and
use the BLE DIS service. Any application discovering the database can access the DIS service instance
during discovery services. This application supports the following characteristics:
•Manufacturer name string
•Model number string
•Serial number string
•Hardware revision string
•Firmware revision string
•Software revision string
•System ID
•IEEE® 11073-20601 regulatory certification data list
•PnP ID
ATSAMB11
1.11 Custom Serial Chat Profile Application
The Custom Serial Chat application is used for sending and receiving data between the boards (see,
Table 2-1) and the Microchip SmartConnect mobile application. This is a custom profile example
application, implemented over GATT. The user can send the information to the mobile phone using the
console terminal that is configured with the board and vice versa.
Note: For more information on Custom Serial Chat service, refer to Custom Serial Chat Service
Specification.
1.12 Heart Rate Profile Application
The Heart Rate Profile application is used for enabling the collector device (GATT client) to connect and
interact with a Heart Rate sensor (GATT server) to be used in the fitness applications. The Heart Rate
sensor sends the heart rate measurement in bpm (beats per minute), energy expended in kJ (kilojoules),
and R-R intervals in seconds. In addition to the Heart Rate service, this profile also implements the
Device Information Service, which provides information about the Heart Rate sensor device.
The Heart Rate profile provided by Bluetooth SIG defines three characteristics for the exchange of heart
rate parameters between the sensor and monitor. The characteristics of the profile are used to transfer
heart rate parameters like bpm, R-R interval measurements, and other parameters like body sensor
location and energy expended values. The optional “Heart Rate Control Point characteristic” is used by
the Heart Rate monitor to reset the energy expended in the Heart Rate sensor.
The Heart Rate sensor, which is the GATT server, holds the characteristics and sends the measurement
values to the Heart Rate monitor.
•The Heart Rate, R-R interval, and energy expended are sent using the Heart Rate measurement
characteristics
•The Heart Rate measurements are sent to the monitor on a value change if the monitor has
enabled the notifications
•The body sensor location is read by the monitor by its body sensor location characteristic. The
energy expended sent in the heart rate measurement can be reset by the monitor by writing to the
Heart Rate control point characteristic
Note: The example application simulates the sensor measurements and sends them to the Heart Rate
collector.
1.13 Blood Pressure Profile Application
The Blood Pressure Profile (BLP) application is used for connecting and interacting with a device with a
blood pressure sensor to be used in a consumer and professional health care applications. This
application enables the device to obtain blood pressure measurement and other data from a non-invasive
blood pressure sensor that exposes the Blood Pressure service. For example, a nurse or doctor could
use a non-invasive blood pressure sensor on a patient that sends blood pressure measurements to a
laptop or other handheld device.
ATSAMB11
Blood Pressure Measurements
The blood pressure measurement characteristic can be used to send blood pressure measurements
containing the following information:
•Flags field (containing units of blood pressure and used to show the presence of optional fields)
•Blood pressure measurement compound value field, depending upon the contents of the Flags field
•Timestamp (time of the measurement)
•Pulse Rate
•User ID
•Measurement status fields
The intermediate cuff pressure characteristic may be notified frequently during the course of a
measurement, so that a receiving device can effectively update the display on its user interface during the
measurement process.
When the client characteristic configuration descriptor is configured for indications and a blood pressure
measurement is available, this characteristic is indicated while in a connection. When the client
characteristic configuration descriptor is configured for indications and a blood pressure measurement is
available, this characteristic is indicated while in a connection.
•The blood pressure measurement characteristic is used to send blood pressure measurements
•The intermediate cuff pressure characteristic is used to send current cuff pressure values to a
device to display, while the measurement is in progress
•The blood pressure feature characteristic is used to describe the supported features of the blood
pressure sensor
The ATSAMB11-MR/ZR simulates a blood pressure sensor (GATT server role) and sends simulated
values to the blood pressure monitor (Microchip SmartConnect mobile application).
The Find Me Profile (FMP) application is used to define the device to create an alert signal behavior when
a button is pressed on one device to cause an alerting signal on a peer device.
Find Me Target
The FMP defines the behavior when a button is pressed on a device to cause an immediate alert on a
peer device. This can be used to allow users to find devices that have been misplaced.
The Find Me Target application, which is the GATT server, holds the alert level characteristics and waits
for the Find Me locators alert and performs the following alert level characteristic:
•When the Find Me locator device wishes to cause an alert on the Find Me Target device, it writes
the specific alert level (High, Mild and No alert) in the alert level characteristic.
1.15 Phone Alert Status Profile Application
The Phone Alert Status (PAS) profile is used to obtain the phone alert status exposed by the phone alert
status service on a mobile phone. The alert status and ringer setting information of a mobile phone can
be received and modified by the phone alert status service. The device can also use this profile to
configure the ringer status on the mobile phone.
ATSAMB11
Phone Alert Status Notifications
This profile defines two roles:
•Phone alert server – device that originates the alerts
•Phone alert client – device that receives the alerts and alerts the user
The phone alert client (a GATT client) configuration is implemented on the ATSAMB11-MR/ZR (see Table
2-1). The example application utilizes the SW0 button on the supported hardware platform to
demonstrate the notification use-cases. A BLE compatible Android device that contains the Microchip
SmartConnect mobile application provides the phone alert server functionality in this example. On the
application, once the service is discovered and the user can click on the PAS service to enable the
notifications.
1.After connecting with the mobile phone, press the SW0 button once to set the PAS server to
“Silent” mode.
2.With the second SW0 button press, the device is set to “Mute” mode.
3.With the third SW0 button press, the device is return back to the “Normal” mode.
4.With the fourth SW0 button press, a “Read Characteristic” request is issued, that reads the
characteristics of “Alert Status”, “Ringer Settings”, and “Ringer Control Point”.
Note: The PAS profile application is not supported in iOS devices. This example works only with BLE
compatible Android devices that contain the Microchip SmartConnect mobile application.
1.16 Alert Notification Profile Application
The Alert Notification Profile allows a device to obtain information from a mobile phone about incoming
calls, missed calls, and SMS/MMS messages. The information includes the caller ID for an incoming call
or the sender ID for an email/SMS/MMS, but not the message text. This profile also enables the client
device to get information about the number of unread messages on the server device.
Note: This example application only works with BLE compatible Android devices that contain the
Microchip SmartConnect mobile application.
The Microchip SmartConnect mobile application is used for implementing the Alert Notification service
and can be used for demonstrating an example application. This example application supports missed
call alert notification and SMS alert notification.
The device implements the GATT client, which reads (or notifies) about the characteristic values received
from the GATT server (the mobile phone). The device must be paired with an Android phone. A missed
call or SMS alert notifications can be enabled/disabled, once connection is established. The Microchip
SmartConnect application notifies a missed call or SMS alert, which are then displayed on the terminal
console on the device side.
The “SW0” user button on the supported platform is programmed in such a way that each successive
button press either enables or disables the notifications.
The Multi-Role Peripheral Multi-Connect application demonstrates the ATSAMB11-MR/ZR to have eight
simultaneous active connections. The ATSAMB11-MR/ZR supports multiple roles, such as GAP
peripheral device with battery service and GAP central device with Find Me locator profile at the same
time. It also supports multiple connections, such as GAP peripheral device with battery service that can
connect with seven GAP central devices simultaneously.
The Multi-Role Peripheral Multi-Connect application initially starts advertising using connectable
advertisement packets as a GAP peripheral and if any device sends a connection request, application
gets connected to the remote device and exchanges the data on the established link. If the connection
request from the device is not sent within a minute, then the application initiates to scan the devices and
initiates a connection to the peripheral device, which advertises using connectable advertisement
packets. The ATSAMB11-MR/ZR is exchanging the data as a GAP central once the link is established.
Again, the Multi-Role application is started to advertise using connectable advertisement packets as a
GAP peripheral and gets connected to the remote device, which sends a connection request and
exchanges the data on the new link established. The process continues until the Multi-Connection
application reaches eight connections.
ATSAMB11
1.18 L2CAP Throughput Application
The L2CAP Throughput example application supports the L2CAP central feature and the L2CAP
peripheral feature.
1.19 Health Thermometer Profile Application
The Health Thermometer Profile (HTP) enables the data collection device to obtain data from a
thermometer sensor that exposes the health thermometer service. The profile defines the following roles:
•Thermometer – Device to measure temperature
•Collector – Device to receive temperature measurement and other data from a thermometer
The thermometer implements only one Health Thermometer service in addition to the Device Information
Service to display the information about the thermometer device. The current HTP application implements
the following characteristics:
The iBeacon application is used to advertise iBeacon specific packets that include UUID, major and minor
numbers. Any beacon scanner application can be used for finding the beacon device. The iOS Microchip
SmartConnect app can be used to find the beacon devices in the vicinity.
This profile defines the following roles:
•Monitor – Device (iOS/Android) to search for beacon packets
•Reporter – Device that continuously advertises the beacon packet as a part of advertisement data
1.21 AltBeacon Application
The AltBeacon application advertises packets that include MFG ID, Beacon code, Beacon ID, Reference
RSSI, and MFG reserved value. Any AltBeacon scanner application can be used to find the AltBeacon
device based on the beacon code. The supplied iOS demo app can be used to find the AltBeacon
devices in the vicinity. The profile defines the following roles:
•Monitor – Device (iOS/Android) to search for AltBeacon packets
•Reporter – Device that continuously advertises the AltBeacon packet as part of advertisement data
ATSAMB11
1.22 Eddystone Beacon Application
Eddystone is an open Bluetooth Smart beacon format from Google that works across Android and iOS
devices. The Microchip SmartConnect BLE BluSDK Smart software solution provides full support for this
beacon format on the ATSAMB11-MR/ZR devices.
The Eddystone beacon application supports UID, URL, and TLM frame types. The application can be
configured as follows using the APP_TYPE define:
•Set APP_TYPE to EDDYSTONE_UID_APP to send UID and TLM beacon frames at regular beacon
intervals
•Set APP_TYPE to EDDYSTONE_URL_APP to send URL and TLM frames. This also supports the
URL configuration service that enables the beacon to be configured dynamically from a mobile
application
The Eddystone application is completely configurable using the conf_eddystone.h file. The #defines
present in the conf_eddystone.h file are supplied with default values, which can be changed by the
user to meet the requirements. In addition to this compile time configuration, frame fields like the UID
value, URL, transmit power at 0 meters, and so on can be changed using the APIs provided in the
eddystone.h file.
1.23 Direct Test Mode Application
The Direct Test mode (DTM) application is used to establish performance of Tx and Rx tests between two
ATSAMB11-MR/ZR modules. The BLE Performance Analyzer is a performance analysis tool that is part
of the Wireless Composer tool in Atmel Studio. This tool will be used at both ends (one assuming the role
of a transmitter and the other the role of a receiver) for execution of tests. The BLE Performance Analyzer
communicates to ATSAMB11-MR/ZR by using the DTM application running on the MCU.
1.24 AT Command Application
The following table provides the list of AT commands used.
2.Install the standalone Advanced Software Framework (ASF) package.
3.Keil IDE Installation – To use Keil IDE instead of Atmel Studio, perform the following:
3.1.Download and install Keil MDK-ARM from https://www.keil.com/download/product/.
3.2.Download and install Python from https://www.python.org/downloads/.
Note: When installing the Atmel Studio, the driver for SAMB11-MR/ZR XPRO is installed.
Therefore, Atmel Studio must be installed to use the Keil compiler.
4.On the mobile phone, download and install the Microchip SmartConnect App on the mobile phone,
available in the Apple Store for iPhone and in the Google Play™ Store for Android.
Note: Atmel Studio offers predefined example projects for the SAM B11 and SAM B11ZR XPro boards.
Note: For more information on the previous releases, refer to the Atmel Studio Release Notes available
on the Microchip web page.
ATSAMB11
4.2 Build Procedure
4.2.1 Build Procedure for Atmel Studio
Perform the following steps to build an example project using Atmel Studio IDE. This example build
procedure is developed using the SAMB11-MR/ZR Xplained Pro board, which is also valid for the other
supported hardware platforms (see Table 2-1).
1.Open the Atmel Studio and select File > New > Example Project.
Figure 4-3. Configuring the UART Flow Compiler Symbols for the Time Information
Profile
Note: iOS requires a device supporting the Time Information Profile to include the service
solicitation advertisement type in the advertisement data. The above setting provides configuration
to build the Time Information Profile for iOS or Android. The iOS natively supports Time Server and
does not require a specific mobile application. To enable the devices that are displayed in the iOS
BLE devices page, the service solicitation advertisement data type configuration is necessary.
6.To build the solution, go to Build > Build Solution.
Figure 4-4. Building Solution for Selected Application Example
7.The generated solution is downloaded into the SAMB11-MR/ZR XPro board through the USB
cable. To program the board, go to Tools > Device Programming.
9.After flashing the example application into the SAMB11-MR/ZR Xpro board, it is ready to be used
as a BLE device that supports the selected application example.
1.To run the profile application, refer to Running the Demo.
2.In the case of Device Information, Simple Broadcaster and Observer application, refer to
Application Configuration.
4.2.2 Build Procedure for Keil
Perform the following steps to build an example project using Keil IDE. This example build procedure is
developed using the SAMB11-MR/ZR Xplained Pro board. Applications for Keil IDE are available in the
BluSDKSmart release package under \SDK. After unzipping the package, the example applications are
available in the <release_dir>\apps folder.
1.Open an intended sample application Keil project (*.uvprojx) from Keil IDE.
2.After opening the project, the following files are available in the Project tab:
–xxxx_app.c (xxxx is replaced with the specific application name)
–app_startup.s
–ble_services
–ble_profiles
–services
–libs (driver_lib.lib, ble_api.lib)
3.Set the appropriate build symbols (see the following figure):
–For ATSAMB11-MR – BLE_MODULE=SAMB11_MR
–For ATSAMB11-ZR: BLE_MODULE=SAMB11_ZR
ATSAMB11
Figure 4-7. Selecting SAMB11 Board Type
4.For the Time Information Profile application, the user must select the compiler symbol based on the
following:
–For Android devices: TP_ANDROID
–For iOS devices: NTP_ANDROID
Note: This step is applicable only for the Time Information Profile application.
Figure 4-8. Compiler Symbol for Time Information Profile
Note: iOS requires the device supporting Time Profile to include service solicitation advertisement
type in the advertisement data. The above setting provides configurability to build the Time Profile
for iOS or for Android. iOS natively supports Time Server and does not require a specific mobile
application. To enable devices to be displayed in the iOS BLE devices page, the service solicitation
advertisement data type configuration is necessary.
5.Select Project > Rebuild all target files to compile the project.
Figure 4-9. Compiling the Project
6.Go to Flash > Download to download the application via the USB onto the SAMB11-MR/ZR
XPro board.
7.After flashing the following messages are displayed in the build output section.
4.3.1 Configuration of Device Information Service Application
The list of macros that must be modified by user is as follows:
1.Before Connection:
The user must configure the default characteristics for the Device Information Service by modifying
the following macros in device_info.h, as shown in the following figure.
Figure 4-10. Device Information Service Header File for Atmel Studio
ATSAMB11
Figure 4-11. Device Information Service Header File for Keil
2.After connection:
The user can configure the values of characteristics for the Device Information Service using the
following macros inside device_info.h.
Note: After configuring the profile for Device Information Service, follow the steps mentioned in Device
Information Service Application.
4.3.2 Configuration of Simple Broadcaster Application
•Simple Broadcaster application advertises the default configuration provided as follows:
–Non-connectable undirected advertisement event
–Broadcasts data in advertisement data packets only
–Broadcasts the following advertisement data types:
•Complete list of 16-bit service class UUIDs
•Complete local name
•Appearance
•The configuration and advertisement data types listed above can be changed by using the macros
provided in the simple_broadcaster_app.h file that is available in the \src\config\
directory.
ATSAMB11
Note: After configuration, follow the steps mentioned in Simple Broadcaster Application.
4.3.3 Configuration of Observer Application
The default scanning parameters of Observer application are:
L2CAP Throughput Application Supported by the ATSAMB11-
MR/ZR XPro board to act as
L2CAP Central
Health Thermometer Profile
(HTP) Application
iBeacon ApplicationSupported by the Microchip
AltBeacon ApplicationSupported by the Microchip
Eddystone Beacon ApplicationSupported by the Microchip
Direct Test Mode (DTM)
Application
Supported by the Microchip
SmartConnect application for
iPhone/Android devices to act as a
Health Thermometer Collector
SmartConnect application for
iPhone/Android devices to act as
Beacon Monitor
SmartConnect application for
iPhone/Android devices act as a
AltBeacon App (Monitor)
SmartConnect application for
iPhone/Android devices
Supported by the ATSAMB11MR/ZR XPro board to act as a
Transmitter (Tx) Test Board. BLE
performance analyzer tool
connected with target board using
COM port
Supported by the ATSAMB11MR/ZR XPro board to act as
L2CAP Peripheral
Supported by the ATSAMB11MR/ZR XPro board to act as HTP
application
Supported by the ATSAMB11MR/ZR XPro board to act as
Beacon Reporter
Supported by the ATSAMB11MR/ZR XPro board to act as
Reporter
Supported by the ATSAMB11MR/ZR XPro board to act as
Eddystone Beacon Application
Supported by the ATSAMB11MR/ZR XPro board to act as a
Receiver (Rx) Test Board. BLE
performance analyzer tool
connected with target board
using COM port
AT Command ApplicationSupported by the ATSAMB11-
5.2 Console Logging
For the purpose of debugging, a logging interface can be implemented in the applications.
The logging interface utilizes the same EDBG port that connects to a supported Xplained Pro (XPro)
platform. A serial port monitor application (for example, TeraTerm) is opened and attached to the
appropriate COM port enumerated by the device on the PC.
5.3 Running the Demo
Initializing the Device
Perform the following steps to initialize the device:
1.Open any Terminal Application (for example, TeraTerm). Select the COM port enumerated on the
PC and set the following parameters:
MR/ZR XPro board connected with
serial port monitor application (for
example, TeraTerm) to act as AT
Command Application.
2.Press the Reset button on the supported Xplained Pro (XPro) platforms (see Table 2-1).Note: The device is now ready to be used as selected application and starts to scan or advertise
on the button press. This button must be pressed only when the “Press button” is displayed on the
console log window. The same button is pressed to stop the device scan or advertise.
3.The device is in advertising mode and the device initialization message is displayed on the console
window.
Initializing Application
Initializing SAMB11
BD Address:0xF8F005F23FFF, Address Type:0
BLE Started Advertisement
Pairing Procedure
Perform the following steps to pair the device with the mobile phone application:
1.Open the Microchip SmartConnect application and click Bluetooth Smart in an application
dashboard as illustrated in the following figure.
Note: With a Android mobile phone, ensure that the location service is enabled.
Figure 5-2. Dashboard of Microchip SmartConnect Application
2.To scan for the peripheral devices, click the START SCAN option available in scanning page. The
device name (for example, ATMEL-PXP) is displayed among the list of scanned devices.
3.Select the device name in the scan results, which initiates the pairing procedure. Enter the passkey “123456” on the Bluetooth Pairing Request window and click Pair. The mobile app displays
“Successful connection” upon successful completion of pairing.
Figure 5-4. Pairing Request
4.On the device side, the console displays the successful completion of the pairing procedure.
5.On the Microchip SmartConnect app, the supported services are displayed for the device.
3.After configuration of desired alert levels, click Immediate Alert service and then move the mobile
phone away from the Proximity reporter. Based on the separation distance, Path Loss is plotted on
the zone radar (using RSSI values received from the Proximity Reporter). Based on the zone, the
Proximity Monitor sends the corresponding alert level. The console log on the Proximity Reporter
displays the corresponding alerts and on-board status LED behavior.
Figure 5-8. Proximity Reporter Path Loss Plot Across Safe, Mid, and Danger Zone
Figure 5-9. Proximity Reporter Path Loss Console Log Alerts Notification
ATSAMB11
4.After configuration of desired alert levels, click on the Link Loss service and then move the mobile
phone away from the reporter. Based on the separation distance, the Proximity Reporter receives
the path loss notifications based on alert settings. Keep moving until the “Link Loss” pop-up
appears. The console log on the Proximity Reporter displays the corresponding alerts and when
Link Loss occurs, it reports disconnection and the on-board status LED behavior. The lock screen
emulates a common use-case application where this Link Loss service is used (for example, Key
Fob). When the user is in close proximity, the lock remains open. Subsequently, the user moving
out of range can be triggered to close the lock.
Figure 5-10. Link Loss Pop-up on Proximity Monitor
ATSAMB11
Figure 5-11. Proximity Reporter Console Log for Link Loss
5.After Link Loss, the mobile application attempts to reconnect to the Proximity Reporter. The
connection is re-established by moving the mobile phone closer to the reporter.
6.The Tx Power service is used to retrieve the Tx Power of the Proximity Reporter. Click the Tx
Power service icon in the services screen. The Proximity Monitor reads the Tx Power value from
the Proximity Reporter and displays the TX POWER LEVEL as shown in the following figure.
Figure 5-12. Proximity Monitor – Reading Tx Power Service
5.3.3 Proximity Monitor Application
Perform the following steps to run the Proximity Monitor application demo:
1.Connect one ATSAMB11-MR/ZR device loaded with Proximity Monitor example application code.
Follow the steps (1 and 2) from Initializing the Device.
2.Setup another ATSAMB11-MR/ZR device with Proximity Reporter application. Follow all the steps
from Initializing the Device. The device starts advertising.
3.Then the Proximity Monitor device starts scanning for available devices in the vicinity and displays
their Bluetooth Device Address (BD) in the console window. The Proximity Reporter device found
during the scan is displayed in the console log window (refer to the following figure). Select the
index number of that device to establish connection with it.
Figure 5-13. Proximity Monitor Connection with a Proximity Reporter
ATSAMB11
4.When the connection is established, the Proximity Monitor sets the link loss alert value to “HIGH
ALERT” at the Proximity Reporter device. The Proximity Monitor also monitors the path loss, if the
Proximity Reporter device supports the optional “Immediate Alert” service and “Tx Power” service.
The Proximity Reporter example application supports both of these optional services.
The default alert settings are as follows:
–For HIGH ALERT, set high alert RSSI to -91dBm and above. Alert status is indicated by LED,
which must be ON.
–For MILD ALERT, set RSSI to -70dBm to -90dBm. Alert status is indicated by LED, which
must be toggling.
–For NO ALERT, set RSSI to -69dBm and below. Alert status is indicated by LED, which must
be OFF.
If the reporter device moves out of the proximity of the monitor device, the path loss crosses the
threshold values and the corresponding alert value is set. The alert notification is displayed on the
console as shown below.
Perform the following steps to run the ANCS application demo:
1.Follow the steps from Initializing the Device.
2.From the Settings page of the iPhone, enable Bluetooth. The phone starts to scan for the devices.
ATMEL-ANCS appears among the list of devices scanned. Click the ATMEL-ANCS to connect to
the device.
Figure 5-15. ANCS Device Discovery in iPhone
ATSAMB11
3.When connected, the client side initiates the pairing request with the iPhone. The console log
provides guidance for the user to enter the pass-key on the iPhone.
Figure 5-16. Console Display for Pairing in ANCS
4.In the Bluetooth Pairing Request window of the iPhone, enter the pass-key displayed in the console
log and click Pair. After the device is connected, “ATMEL-ANCS” appears in the MY DEVICES
section on the iPhone.
Figure 5-17. Pairing and Connecting iPhone to ATMEL-ANCS
5.Now, the user can initiate a mobile terminated call to the iPhone. When the iPhone receives a call,
the corresponding incoming call alert is indicated on the device side console log window. Once the
call is terminated, the device waits for a new alert to occur, as shown in the following screen.
Figure 5-18. Console Display for Notification Received as Incoming Call Alert
5.3.5 Scan Parameters Application
Perform the following steps to run the Scan Parameters application demo:
ATSAMB11
1.Establish the connection between the device and mobile phone using the procedure listed in
Running the Demo.
2.When paired, the application displays the Scan Parameters and the Generic Information service.
3.Click the Scan Parameters service. The user receives notification for scan refresh characteristic
value. The user can disable the notification in the Scan Parameters page, as shown in the following
figure.
Figure 5-22. Console Display - All Supported Characteristic Values
5.3.7 HID Mouse Device Application
Perform the following steps to run the HID Mouse Device application demo:
1.Follow the steps from Initializing the Device.
2.In this demonstration, Android device supporting HOGP is used. The HOGP profile is natively
supported in Android version 4.4 (Android KitKat) and higher. The mobile phone must include a
Bluetooth chipset supporting Bluetooth 4.0 or higher. On the mobile phone, enable Bluetooth in the
Settings page to scan for the devices. “ATMEL-HID” appears among the list of scanned devices.
Select ATMEL-HID to connect to the supported platform device.
Figure 5-23. HID (Mouse) Device Discovery on Bluetooth Settings Page
ATSAMB11
3.Click ATMEL-HID to start the pairing procedure. A pop-up requesting for the pass-key appears.
Enter the pass-key “123456” and click Pair.
Figure 5-24. Bluetooth Pairing Request
4.After the pairing is completed, the connected device is listed under Paired devices, as shown in the
following figure.
Figure 5-29. Selecting NENABLE_ULP Symbol to Disable ULP Mode
ATSAMB11
2.Follow the steps from Initializing the Device.
3.In this demonstration, an Android device supporting HOGP is used. The HOGP profile is natively
supported in Android version 4.4 (Android KitKat) and higher. The mobile phone must include a
Bluetooth chip-set supporting Bluetooth 4.0 or higher. On the mobile phone, enable Bluetooth in the
Settings page to scan for the devices. “ATMEL-HID” appears among the list of scanned devices.
Select ATMEL-HID to connect to the supported platform device.
Figure 5-30. HID (Keyboard) Device Discovery on Bluetooth Settings Page
4.Click ATMEL-HID to initiate the pairing procedure.
Figure 5-31. Pairing Procedure with HID Device
Note: Entering into ULP mode with the following hardware changes is required only for SAMB11-MR
Xplained Pro. For SAMB11-ZR Xplained Pro AON_GPIO0 is pulled down by default and connected to the
SW0 button. Once the device is entered into ULP mode, use AON_GPIO to wake-up the device or use
other wake-up sources (BLE Events, AON Timer).
1.Before building the project, ensure that the “ENABLE_ULP” symbol is used, as shown in the
following figure.
Figure 5-35. Selecting ENABLE_ULP Symbol for ULP mode
2.Configure the device using cables and a switch, as shown in the following figure.
Figure 5-37. Configuring the ATSAMB11 to Control ULP Mode
3.Follow the steps (2 through 7) from Disabling ULP Mode.
4.Adjust the switch to connect pin 9 (AON_GPIO_0) to pin 20 (VCC) to disable ULP mode.
Important: This step must be performed to proceed with the next steps.
5.Click SW0 button on the supported platform device.
6.A letter for each press shows in the application “Fast notepad”.
7.The user can see a complete “Hello Atmel” in the application, as shown in Figure 5-34.
8.To enable the ULP mode again, adjust the switch to connect pin 9 (AON_GPIO_0) to pin 19 (GND).
5.3.9 Battery Service Application
Perform the following steps to run the Battery Service Application demo:
1.Establish the connection between the device and mobile phone using the procedure listed in
Running the Demo.
2.When paired, the application displays the Battery Service and the Generic Information service.
3.Select “Battery Service” to receive notifications for the battery level characteristic. The user can
stop receiving the notifications by disabling notifications, as shown in the following figure.
3.When the Device Information Service is selected, the device information service characteristics can
be viewed, as shown in the following screen.
Figure 5-40. Display of Device Information Service Characteristics
4.The page can be refreshed to get the updated characteristic value of all characteristics.
5.3.12 Custom Serial Chat Profile Application
Perform the following steps to run the Custom Serial Chat Profile application demo.
1.Establish the connection between the device and mobile phone using the procedure listed in
Running the Demo.
2.Once pairing is complete, the Custom Serial Chat icon appears on service list page.
3.Click the Custom Serial Chat icon. The chat screen appears where the text that is to be sent to the
remote device is to be entered, and the text coming from the remote device can be seen.
4.Chat text “Hello Atmel” and send to the remote device.
Note: For more information on Custom Serial Chat service, refer to Custom Serial Chat Service
Specification.
5.3.13 Heart Rate Profile Application
Perform the following steps to run the Heart Rate Profile application demo.
1.Establish the connection between the device and mobile phone using the procedure listed in
Running the Demo.
2.After the device is connected, the application displays the Heart Rate and the Device Information
Service.
3.When the notifications are enabled the HRM values are displayed, as shown in the console and the
corresponding mobile app, the LED on SAMB11-MR/ZR board starts blinking while sending
notifications.
Notification Enabled
Heart Rate: 50 bpm RR Values:<100,300>msec User Status:Idle
Heart Rate: 51 bpm RR Values:<500,700>msec User Status:Idle
Heart Rate: 52 bpm RR Values:<900,1100>msec User Status:Idle
Heart Rate: 53 bpm RR Values:<100,300>msec User Status:Idle
Heart Rate: 54 bpm RR Values:<500,700>msec User Status:Idle
Heart Rate: 55 bpm RR Values:<900,1100>msec User Status:Idle
Heart Rate: 56 bpm RR Values:<100,300>msec User Status:Idle
Heart Rate: 57 bpm RR Values:<500,700>msec User Status:Idle
Heart Rate: 58 bpm RR Values:<900,1100>msec User Status:Idle
Heart Rate: 59 bpm RR Values:<100,300>msec User Status:Idle
Energy Expended :3KJ
4.When Stop Notify is disabled, the console logs display the notifications display as:
Notification Disabled
5.During the connection, the SW0 button is used to disconnect the connection. If no connection
exists, the SW0 button is used to start advertisement.
5.3.14 Blood Pressure Profile Application
Perform the following steps to run the Blood Pressure Profile application demo.
1.Establish the connection between the device and mobile phone using the procedure listed in
Running the Demo.
2.When the device is connected, the application displays Blood Pressure, Device Information Service
and Generic Information.
3.Upon entering the Blood Pressure service page, the mobile application enables the notifications
and indications for interim cuff pressure and blood pressure characteristics respectively. The blood
pressure sensor device simulated by the device sends the current blood pressure values after
receiving the indications enabling the request. The corresponding console logs and mobile
application screen are shown in the following figure.
4.The SW0 button can be used on SAMB11-MR/ZR to receive updated blood pressure
measurements. The blood pressure sensor first sends the interim cuff pressure values as
notifications and then sends the final blood pressure measurements as indication. The blood
pressure measurements sent by the blood pressure sensor are simulated values. The following
figures demonstrate the scenario after the SW0 button press.
Figure 5-47. Console Log for Blood Pressure Values after Button Press
Figure 5-48. Blood Pressure Service Pages after Receiving Measurement Data on Button
Press
5.3.15 Find Me Profile Application
Perform the following steps to run the Find Me Profile application demo.
1.Establish the connection between the device and mobile phone using the procedure listed in
Running the Demo.
2.After the device is connected, the application displays a service page that includes Immediate Alert
Service and Generic Information.
3.Since the service level connection is established, notifications are shown based on the alert level
settings as depicted in the following figures.
Figure 5-49. Sending Alerts to Find Me Target ATMEL-FMP
4.On the device side, the console log is displayed as:
Find Me : Mild Alert
Find Me : High Alert
Find Me : No Alert
ATSAMB11
5.3.16 Phone Alert Status Application
Perform the following steps to run the Phone Alert Status application demo.
1.Establish the connection between the device and mobile phone using the procedure listed in
Running the Demo.
2.After connection, the application displays the Phone Alert Status Service page.
3.The notifications are automatically enabled and the application reads the values of “Alert Status”,
“Ringer Settings”, and “Ringer Control Point” characteristics. These are updated on the mobile
application, as illustrated in the following figure.
2.When connected, the application displays the Alert Notification service page. The console log
displays the new and unread alert categories.
Figure 5-52. Alert Notification Categories
3.Enable the notifications by using the SW0 button. The mobile application reflects the status as
shown.
Figure 5-53. Alert Notification Screen on Microchip SmartConnect Application
4.The user can trigger a missed call to the Android device or send an SMS. The corresponding
notification then gets displayed on the device side in the console logs.
3.Set up another ATSAMB11-MR/ZR device with the Find Me application example loaded. Follow the
steps (1 through 3) from Running the Demo. The device starts advertising.
4.The GAP Central (Find Me Locator) scans and then displays the list of all BLE devices that are
advertising. Find Me Target devices (GATT server role) are indicated with tag “---FMP”. Select the
appropriate index number for the Find Me Target. The GAP Central (Find Me Locator) connects to
the selected peer device.
Figure 5-56. Connecting GAP Central (Find Me Locator) with GAP Peripheral (Find Me
Target)
5.The ATSAMB11 as a GAP Central pairs with the connected peripheral. Then the ATSAMB11MR/ZR acts as a GAP Peripheral by advertising with Battery Service UUID in the advertisement
data. Now the ATSAMB11-MR/ZR sends alert levels as a GAP Central, sends battery level
notifications to the device connected as a GAP Peripheral, and also starts advertising with
Connectable advertisement packets.
Figure 5-57. GAP Peripheral (ATSAMB11) Connected to GAP Central (Mobile) and
Transferring the Data
6.The ATSAMB11-MR/ZR acting as a GAP Peripheral (BAS) can connect to seven GAP central
devices (mobile devices through the Microchip SmartConnect application). Now, the ATSAMB11MR/ZR continues to behave as Find Me Locator (GAP Central) and Battery Service Application
(GAP Peripheral) simultaneously with eight active connections. Continuous data transfer happens
on all the links by the ATSAMB11-MR/ZR and even if one link gets disconnected, the data transfer
happens on the other links.
This demonstration requires two ATSAMB11-MR/ZR devices. Program one ATSAMB11-MR/ZR device
with the L2CAP Peripheral and another one with the L2CAP Central application example. Perform the
following steps to run the Throughput application demo:
1.Follow the steps (1 and 2) from Initializing the Device for both devices.
2.The device initializes start-up.
3.The Central device starts scanning and subsequently connects with the desired peripheral device.
The following log shows that both devices connected to confirm the connection status.
Figure 5-58. L2CAP Central Connection with L2CAP Peripheral
ATSAMB11
Figure 5-59. L2CAP Peripheral Connection with a L2CAP Central
4.Once the connection is established, the peripheral device keeps sending the specified data and the
central device receives the same data in a given time. Eventually, calculated Throughput is
displayed on the console for both central and peripheral.
3.Click Beacon Ranging. The beacon application is launched to show the positioning of beacon
device with respect to mobile phones and support following modes:
–Proximity – used to display beacon specific information when the mobile device comes in
close proximity to a given beacon. This mode also shows the corresponding product-related
information configured for this particular beacon device.
–Distance – used to indicate the distance between beacon device and the mobile.
4.Click iBeacon to check the Major, Minor and RSSI value. The RSSI value is automatically updated
based on the movement of the scanner device, as shown in the following figure.
Figure 5-66. Beacon Radar Application in Distance Mode
5.Inside the proximity mode, if the scanner device is very near to the beacon the product information
can be seen when the user is in close proximity to a given beacon device. When the user moves
away from the beacon device information content is no longer shown, indicating that the user has
moved away from the beacon device. Optionally, the message can be closed by clicking on close.
Figure 5-67. Beacon Radar Application in Proximity Mode
5.3.22 AltBeacon Application
Perform the following steps to run the AltBeacon application demo.
1.Follow the steps (1 and 2) from Initializing the Device.
2.The beacon application initialization is displayed in the console.
Initializing AltBeacon Application
BLE AltBeacon Advertisement started
3.Start the Microchip SmartConnect application and click Beacon Ranging from the mobile phone
(see Figure 5-64). In this demonstration, an iPhone is used to run the application.
4.Tap on the AltBeacon icon for Major, Minor and UUID Value. The RSSI values are automatically
updated based on the movement of the scanner device. For more details about the AltBeacon
device, tap on the pop-up message (which shows UUID, ID1 and ID2 values), as shown in the
following figures.
Figure 5-68. AltBeacon Radar Application in Distance Mode
5.In proximity mode, the application opens the configured URL whenever the user comes in close
proximity to the configured beacon device. When the user moves away from the beacon device the
configured beacon is not shown, indicating the user moved away from the beacon device.
Figure 5-69. AltBeacon Radar Application in Proximity Mode
3.Start the Microchip SmartConnect application and click Beacon Ranging from the mobile phone
(see Figure 5-64). In this demonstration, an iPhone is used to run the application.
4.Open the Beacons navigation tab to view the ranging screen. The Eddystone beacon device is
shown on the ranging screen with the Eddystone icon. The position of the beacon is based on the
strength of the signal received from RSSI. Click the Beacon icon to see a pop-up window showing
the identity of the frame; in the case of the EDDYSTONE_URL_APP, the shortened URL value is
shown and in the case of the EDDYSTONE_UID_APP, Namespace ID and Instance ID is shown.
Figure 5-72. Eddystone Beacons (both UID and URL beacons) ranged by Microchip
SmartConnect Application
5.Click the beacon pop-up window to view detailed information. The detailed view shows UID/URL
and telemetric information like battery voltage, beacon temperature, time since power-on, and so
on. This telemetric information is obtained from the Eddystone-TLM frames which are interleaved
with Eddystone identifying frames (UID/URL).
Figure 5-73. Detailed view of the Eddystone URL and UID beacon
6.In the EDDYSTONE_URL_APP, the detailed beacon information screen shows a Configure button.
Click the Configure button. It requests that the user puts the beacon into Configuration mode. The
SW0 hardware button present on the SAM B11 Xplained Pro board has to be long pressed (around
3 seconds) to enter into Configuration mode.
7.Connect to the beacon in Configuration mode as shown in Figure 5-74. Once connected, the
configurable beacon parameters are listed out as shown in Figure 5-75.
Figure 5-74. Connecting to Beacon in Configuration Mode
8.Update the URL, Tx Power mode, beacon period, etc. and then save. Now, disconnect from the
beacon and enter the ranging screen. Once disconnected, the beacon device (ATSAMB11-MR/ZR)
enters into Beacon mode and start sending Eddystone URL frames with the updated values. The
ranging console log screen shows the beacon with new URL value.
Figure 5-76. Eddystone Beacon Console Log
9.The beacon configuration page also provides a reset button that can set all the parameters to
default factory settings.
Eddystone is the backbone of the Physical Web initiative from Google. For more information on the
Physical Web, refer to https://google.github.io/physical-web/.
The following demo shows how the Eddystone application running on an ATSAMB11-MR/ZR device
works seamlessly with the Physical Web Android application.
1.Install the Physical Web Android application in a BLE compatible android device.
2.Build and run the EDDYSTONE_URL_APP in the hardware setup.
3.Open the Physical Web app to detect the URL emitted by the beacon node, as shown in the
following figure.
Figure 5-77. Physical Web App Detecting Eddystone-URL
ATSAMB11
4.Click the Menu button to open the “Edit URL” option; this requests that the user to put the beacon
in Configuration mode. Pressing the SW0 button on the Xplained Pro board for 3 seconds (long
press) puts the beacon device in Configuration mode.
5.The URL configuration window will pop-up once the Android device establishes connection with the
beacon’s configuration service, as shown in the following figure. Change the URL value to a
different one; make sure to use a shortened URL as the size of encoded URL is limited to 17 bytes.
Google’s URL shortener can be used for this purpose https://goo.gl/.
Figure 5-78. URL Configuration on Physical Web App
ATSAMB11
5.3.24 Direct Test Mode Application
This demonstration requires two ATSAMB11-MR/ZR devices loaded with Direct Test Mode example
application code. Perform the following steps to run the DTM with Performance Analyzer tool.
1.Start the performance analyzer in the Atmel Studio.
Figure 5-79. Selecting Studio Performance Analyzer Tool
2.Next, initialize UART. Enter the COM port number and press “Init UART”. A successful initialization
is indicated by receiving a chip response, as shown in the following figure.
Tip: Check the COM port number from the Device Manager.
Figure 5-81. Initializing UART
3.Start the Direct Test Mode, configuring one board as Tx and the other one as Rx. Make sure to
select the same RF Channel for both Rx and Tx during the test, and start the Rx test before the Tx
test so that no packets are missed. The user must see non-zero packets received at the Rx side,
indicating successful transmission and reception.
Note: Any side can be replaced by standard compliant test equipment.
4.On the Rx side, select the appropriate COM port with the same default settings. Open the window
with both Tx and Rx options. Click Start Rx Test and ensure that the packets are transferred for a
certain time period from the Tx device.
Figure 5-83. Starting Rx Test
5.Click Stop Test to display the number of successful received packets.
4.CFG_DEF command – to configure the device, type “AT+CFG_DEF” and then press the <Enter>
key.
Figure 5-86. CFG_DEF Command
5.SCAN command – to scan the BLE device, type “AT+SCAN” and then press the <Enter> key.
After scanning for the device, the scan result is shown in the following figure.
Another service such as the “Device Information Service” or “Battery Service” can be added to the
application by using the ASF wizard as shown in the following steps.
1.Go to the Atmel Studio ASF > ASF Wizard as shown in the following figure.
Figure 6-1. Invoking ASF Wizard
ATSAMB11
2.In the ASF Wizard window, enter “BLE” in the search box, as shown in the following figure.
Figure 6-2. ASF BLE Services and Components Window
3.Select the required BLE Services/Profiles Component, as shown in the following figure.
Figure 6-3. Adding BLE - Device Information Service and its Component
4.The newly added BLE service component must be available in the following directory: src
\thirdparty\wireless\ble_smart_sdk\ble_services\device_information, as
shown in the following figure.
Figure 6-4. Hierarchy of Newly Added Service Component
5.If required in the application use the APIs, as mentioned in the Device Information Service
(device_info.h), for incorporating this functionality.
/**@brief Update the DIS characteristic value after defining the services using
dis_primary_service_define
*
* @param[in] dis_serv dis service instance
* @param[in] info_type dis characteristic type to be updated
* @param[in] info_data data need to be updated
* @return @ref AT_BLE_SUCCESS operation completed successfully.
* @return @ref AT_BLE_FAILURE Generic error.
*/
at_ble_status_t dis_info_update(dis_gatt_service_handler_t *dis_serv , dis_info_type
info_type,
dis_info_data* info_data, at_ble_handle_t conn_handle);
/**@brief DIS service and characteristic initialization (Called only once by user).
The Custom Serial Chat profile consists of a custom serial chat service. Both the mobile app and the host
(ATSAMB11-MR/ZR) need to expose this service. The custom serial chat service is instantiated as a
primary service.
The UUID value assigned to custom serial chat service is:
fd5abba0-3935-11e5-85a6-0002a5d5c51b.
7.2 Service Characteristic
The following characteristics are exposed in the Custom Serial Chat service. Only one instance of each
characteristic is permitted within this service.
Table 7-1. Custom Serial Chat Service Characteristics
ATSAMB11
Characteristic NameRequirementMandatory
EndpointMNotifyDepend on BLE_PAIR_ENABLE
Client characteristic
configuration descriptor
Note:
1.The security permission depends on the BLE_PAIR_ENABLE macro, defined inside the
ble_manager.h.
2.If BLE_PAIR_ENABLE is set true, then the security permission of the Endpoint characteristic is
readable with authentication and writable with authentication.
3.If BLE_PAIR_ENABLE is set false, then the security permission of Endpoint characteristic is none.
7.3 Endpoint
The Endpoint characteristic is used to transmit the chat data provided by the user on the terminal (device
side) and on the mobile chat screen (mobile side).
The UUID value assigned to Endpoint characteristic is fd5abba1-3935-11e5-85a6-0002a5d5c51b.
Security Permission
Properties
macro
MRead, WriteNone
7.3.1 Characteristic Behavior
When the client characteristic configuration descriptor is configured for the notification by a remote
device, the user can send chat text message to the remote device.
Note: The chat text is sent as a notification from the sender (mobile app or ATSAMB11-MR/ZR based
device). Hence, the client characteristic configuration descriptor is always configured for notifications (in
the Custom Serial Chat service instance on the mobile application and host).
4.7.In the Linker tab, configure the following parameters:
•Uncheck Use Memory Layout from Target Dialog
•In R/O Base enter 0x00000000
•In R/W Base enter 0x10018000
•Browse to add the manual scatter file “iBeacon.sct” or “iBeacon_samb11.sct” or
“app_manual.sct” in scatter file path
Note: For more details on sample scatter file, refer to Sample Keil Scatter File.
•Enable Use External Tool for the Flash Programming option
•In the Command section, browse and select the FlashDownload.bat provided in
the <release_dir>\tools\ directory.
•In the Argument edit box, enter #H $H@P.map. This is used to pass the application
map file and the application hex file in to the image creator tool.
•Tools directory has download.py (a Python® file) and other tools that create the
out.img and download it to the SPI flash available on the SAMB11-MR/ZR.
Note: This tool uses Python. Be sure to install Python 2.7.3 or later.
ram - This defines the user application section as defined in Figure 9.2. The user application code and
data resides on the same memory section. The ORIGIN and LENGTH of this section is limited as per
Figure 9-2.
Iram - This section is not applicable for SAMB11. The "Iram" section can be commented and the LENGTH
defined in the "Iram" section can add into LENGTH of existing "ram" section.
/* The stack size used by the application. NOTE: you need to adjust according to your
application. */
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ :
0x800;
/* Support C constructors, and C destructors in both user code
and the C library. This also provides support for C++ code. */
. = ALIGN(4);
KEEP(*(.init))
. = ALIGN(4);
__preinit_array_start = .;
KEEP (*(.preinit_array))
__preinit_array_end = .;
/* .ARM.exidx is sorted, so has to go in its own output section. */
PROVIDE_HIDDEN (__exidx_start = .);
.ARM.exidx :
{
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
} > ram
PROVIDE_HIDDEN (__exidx_end = .);
. = ALIGN(4);
_end = . ;
}
ATSAMB11
9.3 Sample Keil Scatter File
The following is the sample scatter file for Keil. The application code in app.c is loaded into LR_IRAM2
region.
LR_IRAM2 - This defines the user application section as defined in Figure 9-2. The user application code
and data resides on the same memory section. The start address and size of this section is limited as per
Figure 9-2.
If the application is created in some other file name, be sure to edit the app.c file with correct object files.
The application file name must be updated in case of a different file name.
Note: The app.c must contain the int app_entry(void) function and also must have
Microchip provides online support via our web site at http://www.microchip.com/. This web site is used as
a means to make files and information easily available to customers. Accessible by using your favorite
Internet browser, the web site contains the following information:
•Product Support – Data sheets and errata, application notes and sample programs, design
resources, user’s guides and hardware support documents, latest software releases and archived
software
•General Technical Support – Frequently Asked Questions (FAQ), technical support requests,
online discussion groups, Microchip consultant program member listing
•Business of Microchip – Product selector and ordering guides, latest Microchip press releases,
listing of seminars and events, listings of Microchip sales offices, distributors and factory
representatives
Customer Change Notification Service
Microchip’s customer notification service helps keep customers current on Microchip products.
Subscribers will receive e-mail notification whenever there are changes, updates, revisions or errata
related to a specified product family or development tool of interest.
To register, access the Microchip web site at http://www.microchip.com/. Under “Support”, click on
“Customer Change Notification” and follow the registration instructions.
Customer Support
Users of Microchip products can receive assistance through several channels:
•Distributor or Representative
•Local Sales Office
•Field Application Engineer (FAE)
•Technical Support
Customers should contact their distributor, representative or Field Application Engineer (FAE) for support.
Local sales offices are also available to help customers. A listing of sales offices and locations is included
in the back of this document.
Technical support is available through the web site at: http://www.microchip.com/support
Microchip Devices Code Protection Feature
Note the following details of the code protection feature on Microchip devices:
•Microchip products meet the specification contained in their particular Microchip Data Sheet.
•Microchip believes that its family of products is one of the most secure families of its kind on the
market today, when used in the intended manner and under normal conditions.
•There are dishonest and possibly illegal methods used to breach the code protection feature. All of
these methods, to our knowledge, require using the Microchip products in a manner outside the
operating specifications contained in Microchip’s Data Sheets. Most likely, the person doing so is
engaged in theft of intellectual property.
•Microchip is willing to work with the customer who is concerned about the integrity of their code.
•Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their
code. Code protection does not mean that we are guaranteeing the product as “unbreakable.”
Code protection is constantly evolving. We at Microchip are committed to continuously improving the
code protection features of our products. Attempts to break Microchip’s code protection feature may be a
violation of the Digital Millennium Copyright Act. If such acts allow unauthorized access to your software
or other copyrighted work, you may have a right to sue for relief under that Act.
Legal Notice
Information contained in this publication regarding device applications and the like is provided only for
your convenience and may be superseded by updates. It is your responsibility to ensure that your
application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR
WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY
OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS
CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE.
Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life
support and/or safety applications is entirely at the buyer’s risk, and the buyer agrees to defend,
indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting
from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual
property rights unless otherwise stated.
Trademarks
The Microchip name and logo, the Microchip logo, AnyRate, AVR, AVR logo, AVR Freaks, BeaconThings,
BitCloud, CryptoMemory, CryptoRF, dsPIC, FlashFlex, flexPWR, Heldo, JukeBlox, KeeLoq, KeeLoq logo,
Kleer, LANCheck, LINK MD, maXStylus, maXTouch, MediaLB, megaAVR, MOST, MOST logo, MPLAB,
OptoLyzer, PIC, picoPower, PICSTART, PIC32 logo, Prochip Designer, QTouch, RightTouch, SAM-BA,
SpyNIC, SST, SST Logo, SuperFlash, tinyAVR, UNI/O, and XMEGA are registered trademarks of
Microchip Technology Incorporated in the U.S.A. and other countries.
ClockWorks, The Embedded Control Solutions Company, EtherSynch, Hyper Speed Control, HyperLight
Load, IntelliMOS, mTouch, Precision Edge, and Quiet-Wire are registered trademarks of Microchip
Technology Incorporated in the U.S.A.
Adjacent Key Suppression, AKS, Analog-for-the-Digital Age, Any Capacitor, AnyIn, AnyOut, BodyCom,
chipKIT, chipKIT logo, CodeGuard, CryptoAuthentication, CryptoCompanion, CryptoController,
dsPICDEM, dsPICDEM.net, Dynamic Average Matching, DAM, ECAN, EtherGREEN, In-Circuit Serial
Programming, ICSP, Inter-Chip Connectivity, JitterBlocker, KleerNet, KleerNet logo, Mindi, MiWi,
motorBench, MPASM, MPF, MPLAB Certified logo, MPLIB, MPLINK, MultiTRAK, NetDetach, Omniscient
Code Generation, PICDEM, PICDEM.net, PICkit, PICtail, PureSilicon, QMatrix, RightTouch logo, REAL
ICE, Ripple Blocker, SAM-ICE, Serial Quad I/O, SMART-I.S., SQI, SuperSwitcher, SuperSwitcher II, Total
Endurance, TSHARC, USBCheck, VariSense, ViewSpan, WiperLock, Wireless DNA, and ZENA are
trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.
SQTP is a service mark of Microchip Technology Incorporated in the U.S.A.
Silicon Storage Technology is a registered trademark of Microchip Technology Inc. in other countries.
GestIC is a registered trademark of Microchip Technology Germany II GmbH & Co. KG, a subsidiary of
Microchip Technology Inc., in other countries.
All other trademarks mentioned herein are property of their respective companies.