LM LM068 User manual

LM068
LM068 BLE Adapter
USER GUIDE v1.1
Firmware Version: LM068_BLE_PERI_0205
© All rights reserved.
All trade names are registered trademarks of respective manufacturers listed.

This manual may not be copied in any media or form without the written consent of original maker.

© Copyright LM Technologies Ltd Page 2 of 41
www.lm-technologies.com
User Manual for “LM068_BLE_Peri_0204” FW
Revision
Date
Changes
Description
v1.0
21
-
05
-
2019
Created user manual for LM068_B
LE
_Peri_0201 firmware
V1.1
02
-
12
-
2019
Improved the BLE Data
upload rate

© Copyright LM Technologies Ltd Page 3 of 41
www.lm-technologies.com
User Manual for “LM068_BLE_Peri_0204” FW
Contents
1. Firmware version History ..................................................................... 5
2. Introduction ......................................................................................... 6
3. Flowchart of operation ......................................................................... 7
4. Overview of LM068_BLE_Peri_0201 firmware .................................... 8
4.1 BLE Advertisement: ............................................................................ 8
4.2 BLE Advertising data: ......................................................................... 9
4.3 BLE Connection ................................................................................ 12
4.4 Serial over GATT service: .................................................................. 14
4.5 Messages on UART of BLE adapter: ................................................... 15
5. LED Indication ................................................................................... 19
5.1 Power on LED sequence ................................................................... 19
5.2 LED0 ............................................................................................... 19
5.3 LED1 ............................................................................................... 19
5.4 LED2 ............................................................................................... 19
5.4.1 Connected state: ........................................................................... 19
5.4.2 BLE advertiser-mode: .................................................................... 19
5.4.3 Pairing State ................................................................................. 19
6. AT command Parser on LM devices: ................................................... 20
7. Basic configuration AT commands ..................................................... 21
7.1 Basic configuration AT commands for Quick reference: ........................ 21
7.1.1 General settings AT commands: ..................................................... 21
7.1.2 UART settings AT commands: ........................................................ 21
7.1.3 Firmware Upgrade AT commands: .................................................. 21
7.2 Adapter Settings commands: ............................................................. 22
7.2.1 “AT*ADDR”\r\n ............................................................................. 22
7.2.2 “AT*NAME”\r\n ............................................................................. 22
7.2.3 “AT*UPDATENAME”\r\n ................................................................. 22
7.2.4 “AT*ECHO”\r\n ............................................................................. 23
7.2.5 “AT*RESP”\r\n .............................................................................. 23
7.2.6 “AT*VER”\r\n ............................................................................... 24
7.2.7 “AT*RESET”\r\n ............................................................................ 24
7.2.8 “AT*SETTINGS”\r\n ...................................................................... 25
7.3 UART Settings commands: ................................................................ 25
7.3.1 “AT*BAUD”\r\n ............................................................................. 25
7.3.2 “AT*PAR”\r\n ............................................................................... 26
7.3.3 “AT*STOP”\r\n ............................................................................. 26
7.3.4 “AT*FLOW”\r\n ............................................................................. 26

© Copyright LM Technologies Ltd Page 4 of 41
www.lm-technologies.com
User Manual for “LM068_BLE_Peri_0204” FW
7.3.5 “AT*UARTCONF”\r\n: .................................................................... 27
7.4 Bluetooth Security Settings commands: .............................................. 28
7.5 Firmware Upgrade commands: .......................................................... 28
7.5.1 “AT*UPGRADEINT”\r\n .................................................................. 28
7.5.2 “AT*UPGRADE”\r\n ....................................................................... 29
8 GAP Peripheral Role related AT commands........................................ 30
8.1 GAP Central AT commands in brief .................................................... 30
8.2 BLE security commands: ................................................................... 30
8.2.1 “AT*LESEC”\r\n ............................................................................ 30
8.2.2 “AT*CLRWHITE”\r\n...................................................................... 31
8.2.3 “AT*LEBOND”\r\n ......................................................................... 31
8.2.4 “AT*LECONFIG”\r\n ...................................................................... 31
9 Firmware upgrade on LM devices ...................................................... 33
9.1 Firmware upgrade over UART interface .............................................. 33
10 Simple Secure Pairing between LM device and remote device .......... 35
11 Appendix ............................................................................................ 36
11.1 Abbreviations ................................................................................ 36
11.2 BLE Peripheral characteristics ......................................................... 36
11.3 GATT UUID type ........................................................................... 37
11.4 GATT_Status_code ........................................................................ 38
11.5 BLE Service UUIDs ........................................................................ 40
Table of Figures:
Figure 1: Application scenario for LM068_BLE_Peri_0201 firmware ......................... 6
Figure 2: Flowchart for LM068_BLE_Peri_0201 firmware ........................................ 7
Figure 3: BLE adapter in Scanned devices List ....................................................... 8
Figure 4: More data in BLE adapter advertisements ............................................. 10
Figure 5: Hex data in BLE adapter advertisements ............................................... 11
Figure 6: Pairing required for connection to be stable .......................................... 12
Figure 7: Services on BLE adapter ...................................................................... 13
Figure 8: Details of Services provided on BLE adapter .......................................... 14
Figure 9: Details for Serial-Over-GATT service ..................................................... 15
Figure 10: Default settings on Hercules for serial communication .......................... 16
Figure 11: Serial messages on BLE adapter for BLE Connection and Data receive ... 17
Figure 12: Data transfer in full Duplex over BLE link ............................................ 18

© Copyright LM Technologies Ltd Page 5 of 41
www.lm-technologies.com
User Manual for “LM068_BLE_Peri_0204” FW
1. Firmware version History
Version: LM068_BLE_Peri_0201
1. LM068 adapter behaves as GAP peripheral only.
2. No support for SPP profile.
3. Firmware Upgrade provided over UART interface.
4. BT5.0 compliant stack.
Version: LM961_LE_Peri_0204
1. Released for LM961
2. LM068 adapter behaves as GAP peripheral only.
3. No support for SPP profile.
4. Firmware Upgrade provided over UART interface.
5. BT5.0 compliant stack.
6. Updated the connection interval to 7.5mSec instead of 10mSec, MTU is 23.
Can receive 23 but sends only (23-3)20Bytes in a packet.
Version: LM961_LE_Peri_0205
1. Improved the BLE Data upload rate. Maximum 40 packets per seconds are
sent with 20 bytes each.

© Copyright LM Technologies Ltd Page 6 of 41
www.lm-technologies.com
User Manual for “LM068_BLE_Peri_0204” FW
2. Introduction
This document describes the functionality of the “LM068_BLE_Peri_0201” application
for LM068 adapter.
LM068 is an adapter provides standard DB9 connector for serial interface, USB mini
plugin for Powering or pin9 of DB9 connector can be used for Powering. LM068
adapter provides DTE/DCE selection Switch to switch the DTE and DCE role. LM068
adapter provides LEDs for different state indications.
This document refers the firmware LM068_BLE_Peri_0201 as “BLE adapter”.
This document provides details for
1. Firmware version history for LM068_BLE_Peri_0201 adapter firmware
2. Overview of LM068_BLE_Peri_0201 firmware
3. LED indication information
4. AT command Parser module of LM devices
5. AT commands and information
6. Firmware Upgrade procedure
The BLE adapter is configured to have GAP peripheral role. User cannot change the
GAP role of the BLE Adapter.
BLE adapter can accept connections from android, iOS or any Gap-Central device.
User can configure the adapter using AT commands before the adapter is connected
to the remote GAP-Central device, Once connected over BLE, the UART lines are
used for data transmission only. Data can be transferred in full duplex mode.
Generally, the MTU (maximum transfer unit) supported by BLE adapter is 20, i.e.
each BLE packet can send/receive maximum 20 data bytes to/from.
BLE Gap-Central
device (BLE App)
BLE-Peripheral
device
Rx = Data
received
Tx = Data to be sent
to Gap-Central
device
send data to LM068
as “Write Command
wo response”
Data from LM068
adapter is shown as
“Notification packet”
Figure 1: Application scenario for LM068_BLE_Peri_0201 firmware

© Copyright LM Technologies Ltd Page 7 of 41
www.lm-technologies.com
User Manual for “LM068_BLE_Peri_0204” FW
3. Flowchart of operation
Figure 2: Flowchart for LM068_BLE_Peri_0201 firmware

© Copyright LM Technologies Ltd Page 8 of 41
www.lm-technologies.com
User Manual for “LM068_BLE_Peri_0204” FW
4. Overview of LM068_BLE_Peri_0201 firmware
Below section explains the GATT peripheral role of LM068_BLE_Peri_0201 adapter
firmware.
As a BLE peripheral device, BLE adapter implements database for Generic Access
service, Generic Attribute service and Serial-Over-GATT service.
4.1 BLE Advertisement:
i. LM068_BLE_Peri_0201 firmware advertises itself as BLE peripheral device.
After power on, GATT database is initialized and BLE adapter starts
advertising itself for connections.
ii. BLE adapter uses its BD address as Static and Public BLE device address
meaning it will be advertising the same BD address for each advertisements
packet (unlike few devices which use random resolvable BD-addresses).
iii. When user starts BLE devices scanning the BLE adapter is showed with its
BD-address.
iv. A short name of the BLE adapter is added in the scan response data as
“LM068BLE”. A full name of the device can be read using Generic Access
service after connection is completed.
Figure 3: BLE adapter in Scanned devices List

© Copyright LM Technologies Ltd Page 9 of 41
www.lm-technologies.com
User Manual for “LM068_BLE_Peri_0204” FW
4.2 BLE Advertising data:
Below screen shot shows the data advertised by LM068_BLE_Peri_0201
firmware when scanned by the BLE-Gap-Central device
i. The BLE adapter advertises itself as BLE only device.
ii. The Short name of BLE adapter is included in advertising data as
“LM068BLE”.
iii. As a GAP-Peripheral device, the BLE adapter has implemented database for
Generic Access service (0x1800), Generic Attribute service (0x1801) and
Serial-Over-GATT service.
iv. Using Generic Access service, GAP-Central device can read the Full name of
the device.
v. A 128-bit UUID of Serial-Over-GATT service is added in the advertisements
as “0000-5501-d102-11e1-9b23-0002-5b00-a5a5”.
vi. Advertising filers for considering the BLE security as per the whitelist
devices is applied as per the LESEC configuration on the BLE adapter. This
is described in more detail in LESEC section further in the document.

© Copyright LM Technologies Ltd Page 10 of 41
www.lm-technologies.com
User Manual for “LM068_BLE_Peri_0204” FW
Figure 4: More data in BLE adapter advertisements

© Copyright LM Technologies Ltd Page 11 of 41
www.lm-technologies.com
User Manual for “LM068_BLE_Peri_0204” FW
Figure 5: Hex data in BLE adapter advertisements

© Copyright LM Technologies Ltd Page 12 of 41
www.lm-technologies.com
User Manual for “LM068_BLE_Peri_0204” FW
Figure 6: Pairing required for connection to be stable
4.3 BLE Connection
i. Once the BLE adapter receives the BLE connection request, it accepts
connection and starts the pairing procedure if not previously paired.
ii. Connection is dropped if the pairing is not completed successfully.
iii. After the connection is successful, the Data transmission can be done using
Serial over GATT service.
iv. The 128-bit UUID of Serial-over-GATT service is ”0000-5500-d102-11e1-
9b23-0002-5b00-a5a5”.

© Copyright LM Technologies Ltd Page 13 of 41
www.lm-technologies.com
User Manual for “LM068_BLE_Peri_0204” FW
Figure 7: Services on BLE adapter

© Copyright LM Technologies Ltd Page 14 of 41
www.lm-technologies.com
User Manual for “LM068_BLE_Peri_0204” FW
Figure 8: Details of Services provided on BLE adapter
4.4 Serial over GATT service:
i. Serial communication with the BLE adapter can be performed using Serial-
Over-GATT-Service provided by CSR/Qualcomm with 128-bit UUID as
”0000-5500-d102-11e1-9b23-0002-5b00-a5a5”
ii. The above “Serial over GATT” service supports one characteristic with 128-
bit UUID as “0000-5501-d102-11e1-9b23-0002-5b00-a5a5”.
iii. This characteristic has properties as “Write command”, “Notify” and “Client
Configuration Flag”.
iv. The GAP central device sends data to BLE adapter using Write-WO-
Response command.
v. The BLE adapter sends data to Gap-Central device using Notifications
request.
vi. Before active data transmission starts on the BLE connection, Gap-Central
device should enable the Client-Configuration-Flag on BLE adapter, if this
flag is not enabled, Central or Peripheral device will not show the received
data.
vii. When BLE adapter receives data on its UART (to be sent to GAP-Central), it
sends the data in packets of 20 bytes after every 50mSec. BLE adapter
provides a 200 bytes internal buffer to store the data, when the buffer is

© Copyright LM Technologies Ltd Page 15 of 41
www.lm-technologies.com
User Manual for “LM068_BLE_Peri_0204” FW
full and still BLE adapter receives data on TX line then a warning message
of Buffer full is given to the user.
viii. The data received by BLE adapter from Central device is uploaded on the
Rx line as soon as it receives.
ix. If the data transmission is full duplex there may be some delays observed
as compared to the timings observed with simplex data transfer.
x. The BLE adapter may hang-up if the central device continuously sends the
data packets to BLE adapter, a delay of at-least 10 mSec should be given
between consecutive packets.
Figure 9: Details for Serial-Over-GATT service
4.5 Messages on UART of BLE adapter:
i. Find below screen shots for messages on UART from power on till the
actual data transfer on BLE link.
ii.
iii.
iv. Serial communication with the BLE adapter can be performed using Serial-
Over-GATT-Service provided by CSR/Qualcomm with 128-bit UUID as
”0000-5500-d102-11e1-9b23-0002-5b00-a5a5”.
v. The above “Serial over GATT” service supports one characteristic with 128-
bit UUID as “0000-5501-d102-11e1-9b23-0002-5b00-a5a5”.

© Copyright LM Technologies Ltd Page 16 of 41
www.lm-technologies.com
User Manual for “LM068_BLE_Peri_0204” FW
vi. This characteristic has properties as “Write command”, “Notify” and “Client
Configuration Flag”.
vii. The GAP central device sends data to BLE adapter using Write-WO-
Response command.
viii. The BLE adapter sends data to Gap-Central device using Notifications
request.
Figure 10: Default settings on Hercules for serial communication

© Copyright LM Technologies Ltd Page 17 of 41
www.lm-technologies.com
User Manual for “LM068_BLE_Peri_0204” FW
Figure 11: Serial messages on BLE adapter for BLE Connection and Data receive

© Copyright LM Technologies Ltd Page 18 of 41
www.lm-technologies.com
User Manual for “LM068_BLE_Peri_0204” FW
Figure 12: Data transfer in full Duplex over BLE link

© Copyright LM Technologies Ltd Page 19 of 41
www.lm-technologies.com
User Manual for “LM068_BLE_Peri_0204” FW
5. LED Indication
5.1 Power on LED sequence
1. All LEDs blink fast during power on for 3 seconds. User can notice all
LEDs blinks together approximately 6 to 7 times.
2. The LM device shows the power on LED sequence after AT*Reset=1
and AT*Reset=2 commands.
5.2 LED0
1. LED0 (RED LED on LM068) is constantly ON to indicate that the LM
device is powered and is ready to process AT commands and is in
working condition.
2. If LED0 is not ON, LM068 adapter might have not powered correctly
or not initialised.
3. The state of LED0 is irrespective of Bluetooth connection or pairing
state.
5.3 LED1
1. On LM devices, LED1 (Yellow LED on LM068) indicates the data
transfer in the BLE connected state.
2. When the LM device is not connected to the remote device, LED1
should be OFF.
3. When the LM device is connected to remote GAP central device, LED1
is ON while the LM device is sending/receiving data to/from the
remote device.
4. LED1 should be off when there is no active data transfer on the BLE
connection.
5.4 LED2
5.4.1 Connected state:
LED2 (Blue LED on LM068) shall be constant ON when the LM
device is connected to the remote GAP central device.
5.4.2 BLE advertiser-mode:
When the LM device is in BLE peripheral mode and is advertising
and ready to connect, LED2 will keep blinking fast until the
module/LM device enters Connected state or enters in Pairing
mode.
5.4.3 Pairing State
When the LM device is in pairing mode, LED-1 and LED2 will keep
blinking fast until pairing is completed.
Table of contents
Popular Adapter manuals by other brands

Tenda
Tenda W326U Technical specifications

Connect Tech
Connect Tech Xtreme/104 Opto user manual

LevelOne
LevelOne PLI-4051 user manual

HN Electronic Components
HN Electronic Components HN-Power HNP11-MicroUSBV2 quick start guide

Lindy
Lindy 43901 user manual

Sonnet
Sonnet USB 3.0 ExpressCard/34 quick start guide