Semtech LoRa Basics Modem-E User manual

Category
Networking
Type
User manual
LoRa Basics Modem-E
Reference Manual
1 of 79
Semtech
LoRa Basics Modem-E
Reference Manual Rev.1.0
RM.BASICSMODEM-E.W.APP Sep-2020
www.semtech.com
Reference Manual
LoRa Basics Modem-E
Reference Manual Rev.1.0
RM.BASICSMODEM-E.W.APP Sep-2020
2 of 79
Semtech
www.semtech.com
Table of Contents
1. Introduction.......................................................................................................................................................9
1.1 Scope ......................................................................................................................................................9
1.2 Overview ................................................................................................................................................9
1.3 Implemented Features .....................................................................................................................9
2. Host-Controller Interface ........................................................................................................................... 11
2.1 SPI Commands .................................................................................................................................. 11
2.1.1 Command Format............................................................................................................... 12
2.1.2 Response Format................................................................................................................. 12
2.1.3 SPI Write Diagram ............................................................................................................... 13
2.1.4 SPI Read Diagram................................................................................................................ 14
2.1.5 Wi-Fi Passive Scan / GNSS Scan SPI Command Diagram ...................................... 14
2.2 BUSY Signalling ................................................................................................................................ 15
2.3 EVENT Signalling .............................................................................................................................. 15
2.3.1 Description ............................................................................................................................ 15
2.3.2 Event Handling Examples ................................................................................................ 15
2.3.3 GetEventSize Command Description........................................................................... 17
2.3.4 GetEvent Command Description................................................................................... 17
2.3.5 GNSS Event Format............................................................................................................. 19
3. System, Register, Memory and Radio.................................................................................................... 21
3.1 System Modes ................................................................................................................................... 21
3.2 System Commands ......................................................................................................................... 21
3.3 Reset Sources .................................................................................................................................... 22
3.4 Register/Memory Commands ..................................................................................................... 22
3.5 Radio Commands ............................................................................................................................ 22
4. Wi-Fi Passive Scanning ............................................................................................................................... 23
4.1 Differences on LoRa Basics Modem-E Implementation .................................................... 23
4.2 WiFiPassiveScanMD ........................................................................................................................ 23
5. GNSS Scanning .............................................................................................................................................. 25
5.1 Differences in LoRa Basics Modem-E Implementation ...................................................... 25
5.1.1 GnssAutonomousMD ........................................................................................................ 25
5.1.2 GnssAssistedMD .................................................................................................................. 26
5.1.3 GnssPushSolverMessage .................................................................................................. 26
6. LoRaWAN® Modem Commands.............................................................................................................. 28
6.1 LoRaWAN® Port ................................................................................................................................ 28
6.2 GetEvent ............................................................................................................................................. 28
6.3 GetVersionMD .................................................................................................................................. 28
6.4 Reset ..................................................................................................................................................... 29
6.5 GetTxPowerOffset ........................................................................................................................... 30
6.6 SetTxPowerOffset ............................................................................................................................ 30
6.7 Test ....................................................................................................................................................... 30
6.8 GetTime ............................................................................................................................................... 31
6.9 GetStatus ............................................................................................................................................ 31
6.10 SetAlarmTimer ............................................................................................................................... 32
6.11 GetPin ................................................................................................................................................ 32
LoRa Basics Modem-E
Reference Manual Rev.1.0
RM.BASICSMODEM-E.W.APP Sep-2020
3 of 79
Semtech
www.semtech.com
6.12 GetChipEui ....................................................................................................................................... 33
6.13 GetJoinEui ........................................................................................................................................ 33
6.14 SetJoinEui ........................................................................................................................................ 34
6.15 GetDevEui ........................................................................................................................................ 34
6.16 SetDevEui ......................................................................................................................................... 35
6.17 SetAppKey ....................................................................................................................................... 35
6.18 GetClass ............................................................................................................................................ 35
6.19 SetClass ............................................................................................................................................. 36
6.20 GetRegion ........................................................................................................................................ 36
6.21 SetRegion ......................................................................................................................................... 37
6.22 ListRegions ...................................................................................................................................... 37
6.23 GetAdrProfile .................................................................................................................................. 38
6.24 SetAdrProfile ................................................................................................................................... 38
6.25 GetDmPort ....................................................................................................................................... 39
6.26 SetDmPort ....................................................................................................................................... 40
6.27 GetDmInfoInterval ........................................................................................................................ 40
6.28 SetDmInfoInterval ......................................................................................................................... 41
6.29 GetDmInfoFields ........................................................................................................................... 41
6.30 SetDmInfoFields ............................................................................................................................ 42
6.31 SendDmStatus ............................................................................................................................... 43
6.32 SetAppStatus .................................................................................................................................. 43
6.33 Join ..................................................................................................................................................... 43
6.34 LeaveNetwork ................................................................................................................................ 44
6.35 SuspendModemComm ............................................................................................................... 45
6.36 GetNextTxMaxPayload ................................................................................................................ 45
6.37 RequestTx ........................................................................................................................................ 45
6.38 EmergencyTx .................................................................................................................................. 46
6.39 UploadInit ........................................................................................................................................ 47
6.40 UploadData ..................................................................................................................................... 47
6.41 UploadStart ..................................................................................................................................... 48
6.42 StreamInit ........................................................................................................................................ 48
6.43 SendStreamData ........................................................................................................................... 49
6.44 StreamStatus .................................................................................................................................. 49
6.45 GetCmdRspSize ............................................................................................................................. 50
6.46 SetTime ............................................................................................................................................. 50
6.47 GetEventSize ................................................................................................................................... 50
6.48 DeriveKeys ....................................................................................................................................... 51
6.49 ManageRFOutput ......................................................................................................................... 51
6.50 SetAlcSyncPort ............................................................................................................................... 51
6.51 GetAlcSyncPort .............................................................................................................................. 52
6.52 SetAlcSyncMode ........................................................................................................................... 52
6.53 GetAlcSyncMode ........................................................................................................................... 53
6.54 SetConnectionTimeout ............................................................................................................... 53
6.55 GetConnectionTimeout .............................................................................................................. 54
6.56 SetCertificationMode ................................................................................................................... 54
6.57 GetCertificationMode .................................................................................................................. 55
LoRa Basics Modem-E
Reference Manual Rev.1.0
RM.BASICSMODEM-E.W.APP Sep-2020
4 of 79
Semtech
www.semtech.com
6.58 GetLRWANState ............................................................................................................................. 55
6.59 GetStatusDutyCycle ..................................................................................................................... 56
7. Test Commands ............................................................................................................................................ 57
7.1 Test Commands Summary ........................................................................................................... 57
7.2 Test Commands Details ................................................................................................................. 58
7.2.1 TST_START ............................................................................................................................. 58
7.2.2 TST_NOP................................................................................................................................. 58
7.2.3 TST_TX_SINGLE.................................................................................................................... 58
7.2.4 TST_TX_CONT....................................................................................................................... 59
7.2.5 TST_TX_CW............................................................................................................................ 59
7.2.6 TST_RX_CONT....................................................................................................................... 59
7.2.7 TST_RSSI.................................................................................................................................. 59
7.2.8 TST_RADIO_RST................................................................................................................... 60
7.2.9 TST_EXIT ................................................................................................................................. 60
7.2.10 TST_BUSYLOOP ................................................................................................................. 60
7.2.11 TST_PANIC........................................................................................................................... 60
7.2.12 TST_WATCHDOG............................................................................................................... 61
7.2.13 TST_SINGLE_PREAM ........................................................................................................ 61
7.2.14 TST_READ_RSSI.................................................................................................................. 61
7.2.15 TST_RSSI_2G4..................................................................................................................... 62
7.2.16 TST_RSSI_GNSS.................................................................................................................. 62
7.2.17 TST_READ_NB_PKTS_RX_CONT.................................................................................. 62
8. Interface Modem - Device and Application Services....................................................................... 64
8.1 Uplink Messages .............................................................................................................................. 64
8.1.1 Uplink Message Format .................................................................................................... 64
8.1.2 Periodic Status Reporting................................................................................................. 65
8.2 Downlink Messages ........................................................................................................................ 66
8.2.1 Downlinks Format............................................................................................................... 66
8.2.2 Downlink Requests............................................................................................................. 67
9. Command Sequences................................................................................................................................. 68
9.1 Device Configuration After Reset .............................................................................................. 68
9.2 LoRaWAN® Join and Packets Transmission ............................................................................ 68
9.3 Streaming ........................................................................................................................................... 69
9.4 Clock Synchronization ................................................................................................................... 69
9.5 Wi-Fi Passive Scanning .................................................................................................................. 69
9.6 GNSS Scanning ................................................................................................................................. 70
9.7 Almanac Update .............................................................................................................................. 71
10. List Of Commands...................................................................................................................................... 72
10.1 System/ Register / Memory Operations ................................................................................ 72
10.2 System Configuration / Status Operations .......................................................................... 72
10.3 Wi-Fi Configuration / Status Operations ............................................................................... 73
10.4 GNSS Configuration / Status Operations .............................................................................. 73
10.5 Modem Configuration / Status Operations ......................................................................... 74
11. Revision History .......................................................................................................................................... 77
LoRa Basics Modem-E
Reference Manual Rev.1.0
RM.BASICSMODEM-E.W.APP Sep-2020
5 of 79
Semtech
www.semtech.com
List of Figures
Figure 1-1: LoRa Basics Modem-E System Overview.............................................................................. 9
Figure 2-1: LoRa Basics Modem-E Interface............................................................................................ 11
Figure 2-2: SPI Write Transaction................................................................................................................ 13
Figure 2-3: SPI Read Transaction ................................................................................................................ 14
Figure 2-4: Wi-Fi Passive Scan / GNSS Scan SPI Transaction............................................................. 15
Figure 2-5: GnssAlmanacRead Transaction ............................................................................................ 16
Figure 2-6: Wi-Fi Passive Scan/ GNSS Scan Transaction..................................................................... 16
Figure 2-7: Class A TX Transaction ............................................................................................................. 17
Figure 8-1: Modem Interfaces Overview.................................................................................................. 64
LoRa Basics Modem-E
Reference Manual Rev.1.0
RM.BASICSMODEM-E.W.APP Sep-2020
6 of 79
Semtech
www.semtech.com
List of Tables
Table 2-1: SPI Command Structure............................................................................................................ 12
Table 2-2: Command Group Id Definition............................................................................................... 12
Table 2-3: SPI Response Structure.............................................................................................................. 12
Table 2-4: Return Code Definitions............................................................................................................ 12
Table 2-5: GetEventSize Command ........................................................................................................... 17
Table 2-6: GetEventSize Response............................................................................................................. 17
Table 2-7: GetEvent Command ................................................................................................................... 18
Table 2-8: GetEvent Response..................................................................................................................... 18
Table 2-9: EventType Definition.................................................................................................................. 18
Table 2-10: GNSS Event Format .................................................................................................................. 19
Table 2-11: GNSS Events for the Host MCU............................................................................................. 19
Table 2-12: GNSS Events for the GNSS Solver........................................................................................ 20
Table 4-1: WiFiPassiveScanMD Command.............................................................................................. 23
Table 4-2: Wi-Fi Channels for Wi-Fi Passive Scanning......................................................................... 23
Table 5-1: GnssAutonomous Command.................................................................................................. 25
Table 5-2: GnssAssistedMD Command .................................................................................................... 26
Table 5-3: GnssPushSolverMessage Command .................................................................................... 26
Table 6-1: GetVersionMD Command ........................................................................................................ 28
Table 6-2: GetVersionMD Response .......................................................................................................... 29
Table 6-3: GetVersionMD Bootloader Field ............................................................................................ 29
Table 6-4: GetVersionMD Firmware Field................................................................................................ 29
Table 6-5: Reset Command........................................................................................................................... 29
Table 6-6: GetTxPowerOffset Command ................................................................................................. 30
Table 6-7: GetTxPowerOffset Response................................................................................................... 30
Table 6-8: SetTxPowerOffset Command.................................................................................................. 30
Table 6-9: GetTime Command..................................................................................................................... 31
Table 6-10: GetTime Response.................................................................................................................... 31
Table 6-11: GetStatus Command................................................................................................................ 31
Table 6-12: GetStatus Response ................................................................................................................. 31
Table 6-13: LoRaWAN® modem status ..................................................................................................... 32
Table 6-14: SetAlarmTimer Command ..................................................................................................... 32
Table 6-15: GetPin Command...................................................................................................................... 32
Table 6-17: GetChipEui Command............................................................................................................. 33
Table 6-18: GetChipEui Response .............................................................................................................. 33
Table 6-19: GetJoinEui Command.............................................................................................................. 33
Table 6-16: GetPin Response........................................................................................................................ 33
Table 6-21: SetJoinEui Command .............................................................................................................. 34
Table 6-22: GetDevEui Command.............................................................................................................. 34
Table 6-23: GetDevEui Response................................................................................................................ 34
Table 6-20: GetJoinEui Response................................................................................................................ 34
Table 6-24: SetDevEui Command............................................................................................................... 35
Table 6-25: SetAppKey Command ............................................................................................................. 35
Table 6-26: GetClass Command.................................................................................................................. 35
Table 6-28: SetClass Command................................................................................................................... 36
Table 6-29: GetRegion Command.............................................................................................................. 36
Table 6-30: GetRegion Response................................................................................................................ 36
Table 6-27: GetClass Response.................................................................................................................... 36
Table 6-31: Regulatory region ..................................................................................................................... 37
Table 6-32: SetRegion Command............................................................................................................... 37
LoRa Basics Modem-E
Reference Manual Rev.1.0
RM.BASICSMODEM-E.W.APP Sep-2020
7 of 79
Semtech
www.semtech.com
Table 6-33: ListRegions Command ............................................................................................................ 37
Table 6-34: ListRegions Response.............................................................................................................. 37
Table 6-35: GetAdrProfile Command........................................................................................................ 38
Table 6-36: GetAdrProfile Response.......................................................................................................... 38
Table 6-37: SetAdrProfile Command......................................................................................................... 38
Table 6-38: ADR profile types....................................................................................................................... 38
Table 6-39: Mobile Long Range and Mobile Low Power ADR Profile DR Usage ....................... 39
Table 6-40: GetDmPort Command ............................................................................................................ 39
Table 6-41: GetDmPort Response .............................................................................................................. 39
Table 6-42: SetDmPort Command............................................................................................................. 40
Table 6-43: GetDmInfoInterval Command.............................................................................................. 40
Table 6-44: GetDmInfoInterval Response................................................................................................ 40
Table 6-45: Reporting Interval Format...................................................................................................... 40
Table 6-46: SetDmInfoInterval Command .............................................................................................. 41
Table 6-47: GetDmInfoFields Command ................................................................................................. 41
Table 6-48: GetDmInfoFields Response................................................................................................... 41
Table 6-49: Device Management InfoList................................................................................................ 41
Table 6-50: SetDmInfoFields Command .................................................................................................. 42
Table 6-51: SendDmStatus Command ..................................................................................................... 43
Table 6-52: SetAppStatus Command........................................................................................................ 43
Table 6-53: Join Command........................................................................................................................... 43
Table 6-54: LoRa Basics Modem-E Data Rate Usage for the Join Procedure .............................. 44
Table 6-55: LeaveNetwork Command ...................................................................................................... 44
Table 6-56: SuspendModemComm Command .................................................................................... 45
Table 6-57: GetNextTxMaxPayload Command...................................................................................... 45
Table 6-58: GetNextTxMaxPayload Response ....................................................................................... 45
Table 6-59: RequestTx Command .............................................................................................................. 45
Table 6-60: EmergencyTx Command........................................................................................................ 46
Table 6-61: UploadInit Command.............................................................................................................. 47
Table 6-62: UploadData Command........................................................................................................... 47
Table 6-63: UploadStart Command ........................................................................................................... 48
Table 6-64: StreamInit Command .............................................................................................................. 48
Table 6-65: SendStreamData Command ................................................................................................. 49
Table 6-66: StreamStatus Command ........................................................................................................ 49
Table 6-67: StreamStatus Response .......................................................................................................... 49
Table 6-68: GetCmdRspSize Command ................................................................................................... 50
Table 6-69: GetCmdRspSize Response..................................................................................................... 50
Table 6-70: SetTime Command................................................................................................................... 50
Table 6-71: DeriveKeys Command............................................................................................................. 51
Table 6-72: ManageRFOutput Command ............................................................................................... 51
Table 6-73: SetAlcSyncPort Command..................................................................................................... 51
Table 6-74: GetAlcSyncPort Command.................................................................................................... 52
Table 6-75: GetAlcSyncPort Response...................................................................................................... 52
Table 6-76: SetAlcSyncPort Command..................................................................................................... 52
Table 6-77: GetAlcSyncMode Command................................................................................................. 53
Table 6-78: GetAlcSyncMode Response................................................................................................... 53
Table 6-79: SetConnectionTimeout Command .................................................................................... 53
Table 6-80: GetConnectionTimeout Command.................................................................................... 54
Table 6-81: GetConnectionTimeout Response...................................................................................... 54
Table 6-82: SetCertificationMode Command ........................................................................................ 54
Table 6-83: GetCertificationMode Command........................................................................................ 55
Table 6-84: GetCertificationMode Response.......................................................................................... 55
Table 6-85: GetLRWANState Command................................................................................................... 55
Table 6-86: GetLRWANState Response..................................................................................................... 55
LoRa Basics Modem-E
Reference Manual Rev.1.0
RM.BASICSMODEM-E.W.APP Sep-2020
8 of 79
Semtech
www.semtech.com
Table 6-87: GetStatusDutyCycle Command........................................................................................... 56
Table 6-88: GetStatusDutyCycle Response............................................................................................. 56
Table 7-1: List of Test Commands .............................................................................................................. 57
Table 7-2: TST_START Command Payload Format............................................................................... 58
Table 7-3: TST_NOP Command Payload Format .................................................................................. 58
Table 7-4: TST_TX_SINGLE Command Payload Format ..................................................................... 58
Table 7-5: Test Commands Encoding of SF, BW and CR..................................................................... 58
Table 7-6: TST_TX_CONT Command Payload Format ........................................................................ 59
Table 7-7: TST_TX_CW Command Payload Format ............................................................................. 59
Table 7-8: TST_RX_CONT Command Payload Format........................................................................ 59
Table 7-9: TST_RSSI Command Payload Format................................................................................... 59
Table 7-10: TST_RSSI Response................................................................................................................... 60
Table 7-11: TST_RADIO_RST Command Payload Format.................................................................. 60
Table 7-12: TST_EXIT Command Payload Format ................................................................................ 60
Table 7-13: TST_BUSYLOOP Command Payload Format................................................................... 60
Table 7-14: TST_PANIC Command Payload Format ............................................................................ 60
Table 7-15: TST_WATCHDOG Command Payload Format................................................................ 61
Table 7-16: TST_SINGLE_PREAM Command Payload Format.......................................................... 61
Table 7-17: TST_READ_RSSI Command Payload Format................................................................... 61
Table 7-18: TST_READ_RSSI Response ..................................................................................................... 61
Table 7-19: TST_RSSI_2G4 Command Payload Format...................................................................... 62
Table 7-20: TST_RSSI_GNSS Command Payload Format................................................................... 62
Table 7-21: TST_READ_NB_PKTS_RX_CONT Command Payload Format ................................... 62
Table 7-22: TST_READ_NB_PKTS_RX_CONT Command.................................................................... 63
Table 8-1: Modem to DAS Uplink Field Descriptions .......................................................................... 64
Table 8-2: DAS Downlinks Format (codes 0x00 to 0x09) ................................................................... 66
Table 8-3: DAS Downlink Format for AlmanacUpdate (Code 0x0A).............................................. 66
Table 8-4: AlmanacUpdate Block Structure............................................................................................ 66
Table 8-5: DAS Downlink Format for AlmanacDebug (Code 0x0B) ............................................... 66
Table 8-6: AlmanacDebugRequest Block Structure............................................................................. 66
Table 8-7: DAS Downlink Format for GnssSolverUpdate (Code 0x0C) ......................................... 67
Table 8-8: SolverUpdate Block Structure................................................................................................. 67
Table 8-9: DAS Downlinks Field Descriptions ........................................................................................ 67
Table 10-1: Register / Memory Access Operations............................................................................... 72
Table 10-2: System Configuration / Status Operations ...................................................................... 72
Table 10-3: Wi-Fi Scanning Configuration / Status Operations....................................................... 73
Table 10-4: GNSS Scanning Configuration / Status Operations...................................................... 73
Table 10-5: Modem Configuration / Status Operations ..................................................................... 74
Table 11-1: Revision History ......................................................................................................................... 77
LoRa Basics Modem-E
Reference Manual Rev.1.0
RM.BASICSMODEM-E.W.APP Sep-2020
9 of 79
Semtech
www.semtech.com
1. Introduction
1.1 Scope
This document provides information on how to use the LoRa Basics Modem-E device in an application. For circuit
specifications and details on the LR1110 functions used by LoRa Basics Modem-E please refer to the LR1110 Datasheets.
This document only details the specificities of LoRa Basics Modem-E, which are unavailable to the LR1110 used as an RF
transceiver. Common functionalities of the LoRa Basics Modem-E and the LR1110 used as an RF transceiver are described
in the LR1110 Transceiver User Manual.
1.2 Overview
LoRa Basics Modem-E is the embedded software programmed inside the LR1110 that supports the LoRaWAN protocol
modem stack along with application layer functions and API's to interface with cloud based geolocation and device and
application services. It uses the Semtech LoRa Cloud™ Device & Application Services. The LoRa Basics Modem-E and
LoRaWAN® complete system is depicted in Figure 1-1: LoRa Basics Modem-E System Overview here below.
Figure 1-1: LoRa Basics Modem-E System Overview
1.3 Implemented Features
The following features are embedded in the LoRa Basics Modem-E:
LoRaWAN® class A protocol version 1.0.3
1
EU868 & US915 Regional parameters
Device Management Periodic Status Messages
Remote reset & re-keying
Temperature monitoring
1. certified against LoRaWAN® specification v1.0.2
ƉƉůŝĐĂƚŝŽŶ
Dh
>ŽZĂĂƐŝĐƐ
DŽĚĞŵͲ
;ϭͿ
>ŽZĂtE
'ĂƚĞǁĂLJ
EĞƚǁŽƌŬ
^ĞƌǀĞƌ
^ĞŵƚĞĐŚ
ůŽƵĚ^ĞƌǀŝĐĞ
ƉƉůŝĐĂƚŝŽŶ
^ĞƌǀĞƌ
>ŽZĂW,z
>ŽZĂtED
ƉƉůŝĐĂƚŝŽŶ
ϭ͘Ϳ>ŽZĂĂƐŝĐƐDŽĚĞŵͲ&ŝƌŵǁĂƌĞƌƵŶŶŝŶŐŽŶƚŚĞ>ZϭϭϭϬĚĞǀŝĐĞ
LoRa Basics Modem-E
Reference Manual Rev.1.0
RM.BASICSMODEM-E.W.APP Sep-2020
10 of 79
Semtech
www.semtech.com
Embedded certification mode
LoRa Cloud™ Large File Upload Service
LoRa Cloud™ Application-Layer Clock Synchronization (ALCSYNC)
LoRa Cloud™ Reliable Octet Stream Encoding (ROSE) Streaming service
Wi-Fi passive scanning
GNSS passive scanning
Over The Air (OTA) GNSS Almanac update service
LoRa Basics Modem-E
Reference Manual Rev.1.0
RM.BASICSMODEM-E.W.APP Sep-2020
11 of 79
Semtech
www.semtech.com
2. Host-Controller Interface
The LoRa Basics Modem-E communicates with the host MCU using a set of API commands and responses implemented
over SPI. It uses two additional signals to communicate status with the host: BUSY and EVENT.
Figure 2-1: LoRa Basics Modem-E Interface
All serial communications consist strictly of host-initiated commands, followed by LoRa Basics Modem-E responses. The
device does not send any unsolicited response on the SPI port. If some event data becomes available asynchronously, the
device signals this using the EVENT line.
The LoRa Basics Modem-E SPI protocol allows the device to return to sleep mode automatically for lowest power
consumption. It also features an automatic CRC protection and parameters verification in the SPI commands, so that the
host MCU can read a feedback (a.k.a return code) immediately after the command is sent.
Moreover, the SPI interface is protected against de-synchronization: for example, if incomplete commands are sent by the
Host MCU (e.g. missing bytes), the watchdog timer will trigger a device reset after 120 seconds, preventing the device from
waiting for command bytes that never arrive.
2.1 SPI Commands
An SPI transaction is initiated by a falling edge of the NSS signal.
Upon generation of an SPI command, the LoRa Basics Modem-E analyses the command message (correct number of bytes
and correct CRC), interprets the command, and finally sends a response. If the packet structure is invalid or the CRC wrong,
the modem ignores the packet and sends a FrameError response. A response is always sent to any command.
In all SPI transactions, multiple octet fields use the big endian format.
,ŽƐƚ
Dh
^W/
h^z
sEd
>ŽZĂ
ĂƐŝĐƐ
DŽĚĞŵͲ
ŽŶ>ZϭϭϭϬ
LoRa Basics Modem-E
Reference Manual Rev.1.0
RM.BASICSMODEM-E.W.APP Sep-2020
12 of 79
Semtech
www.semtech.com
2.1.1 Command Format
The SPI command consists of a 2 Byte Opcode, followed by a Payload of variable length, and then a CRC, as shown in Table
2-1: SPI Command Structure here below.
The field Id is defined as indicated in Table 2-2: Command Group Id Definition. The fields ID and Cmd are referred to as
the command Opcode in tables Table 10-1 to Table 10-5.
The CRC is a crc-8 computed over the whole SPI command packet, using a polynomial generator 0x65 (reversed
reciprocal), and a CRC initial value or 0xFF.
2.1.2 Response Format
The SPI response consists of a 1 Byte Return Code, followed by an optional 1 Byte Payload, and then a CRC, as shown in Table
2-3: SPI Response Structure here below:
The Return Codes (also referred as RC) are defined in Table 2-4: Return Code Definitions.
Table 2-1: SPI Command Structure
Byte Length 1 1 N 1
Field Id Cmd Payload CRC
Table 2-2: Command Group Id Definition
Group Id
System 0x01
Wi-Fi 0x03
GNSS 0x04
Modem 0x06
Table 2-3: SPI Response Structure
Byte Length 1 N 1
Field Return Code Payload (Optional) CRC
Table 2-4: Return Code Definitions
Value Return Code (RC) Description Commands
0x00 OK
Command executed without
error
System/Wi-Fi/GNSS/Modem
0x01 Unknown Command code unknown System/Wi-Fi/GNSS/Modem
0x02 NotImpl
Command not yet
implemented
Modem
LoRa Basics Modem-E
Reference Manual Rev.1.0
RM.BASICSMODEM-E.W.APP Sep-2020
13 of 79
Semtech
www.semtech.com
2.1.3 SPI Write Diagram
An SPI Write consists of three SPI transactions. The host MCU must ensure that the BUSY line is high before initiating the SPI
transactions. The SPI write transaction is depicted in Figure 2-2: SPI Write Transaction hereafter.
1. Before the host issues the SPI command, the LoRa Basics Modem-E is in sleep mode, with the BUSY signal set to
high.
2. The host MCU toggles the NSS line to wake up the LoRa Basics Modem-E .
3. Once BUSY line is low, the host MCU drives the NSS line low and sends the bytes stream.
4. After the bytes stream is sent, the host MCU drives the NSS line high, and waits for the BUSY line to go high.
5. Once the BUSY line is high, the host MCU drives the NSS line to low again and sends two NOPs (0x00 Bytes).
6. After sending the 2 NOPs (0x00 Bytes), the host MCU drives the NSS line high, and waits for the BUSY line to go low.
7. The LoRa Basics Modem-E drives the BUSY line low when it is processing the command.
8. If no more processing is needed, the LoRa Basics Modem-E goes to sleep mode and drives the BUSY line high
Figure 2-2: SPI Write Transaction
0x03 NotInit Command not initialized Modem
0x04 Invalid Command parameters invalid System/Wi-Fi/GNSS/Modem
0x05 Busy
Command cannot be
executed now
Modem
0x06 Fail Command execution failed System/Wi-Fi/GNSS/Modem
0x07 BadFmt Format check failed Modem
0x08 BadFileUploadCrc File Upload CRC Check failed Modem
0x09 BadSig Signature verification failed Modem
0x0A BadSize Size check failed Modem
0x0F FrameError
SPI command checksum or
CRC error
System/Wi-Fi/GNSS/Modem
0x10 NoTime GNSS Time sync lost GNSS
Table 2-4: Return Code Definitions
Value Return Code (RC) Description Commands
LoRa Basics Modem-E
Reference Manual Rev.1.0
RM.BASICSMODEM-E.W.APP Sep-2020
14 of 79
Semtech
www.semtech.com
NOTE: No Status bits nor IRQ Status bits are returned on the MISO line during an SPI Write transaction.
NOTE: the
Reset(...) command does not result in a second phase of BUSY signal to low (step 7.) in the above
description).
2.1.4 SPI Read Diagram
An SPI read consists of three SPI transactions. The host MCU must ensure that the BUSY line is high before initiating the SPI
transactions. The SPI read transaction is depicted in Figure 2-3: SPI Read Transaction hereafter.
1. Before the host issues the SPI command, the LoRa Basics Modem-E is in sleep mode, with the BUSY signal set to high.
2. The host MCU toggles the NSS line to wake up the LoRa Basics Modem-E.
3. Once BUSY line is low, the host MCU drives the NSS line low and sends the bytes stream.
4. After the bytes stream is sent, the host MCU drives the NSS line high, and waits for the BUSY line to go high.
5. Once the BUSY line is high, the host MCU drives the NSS line to low again and sends the expected number of NOPs
(0x00 Bytes).
6. After sending the expected number of NOPs (0x00 Bytes), the host MCU drives the NSS line high, and waits that the
BUSY line goes low.
7. The LoRa Basics Modem-E drives the BUSY line low when it is processing.
8. If no more process is needed, the LoRa Basics Modem-E goes to sleep mode and drives the BUSY line high.
Figure 2-3: SPI Read Transaction
NOTE: No status bits or IRQ status bits are returned on the MISO line during an SPI Read transaction.
2.1.5 Wi-Fi Passive Scan / GNSS Scan SPI Command Diagram
A Wi-Fi Passive Scan or GNSS Scan SPI command consists of three SPI transactions; more specifically, the GNSS/Wi-Fi scan
is triggered by the 3rd transaction after two NOPs. If the 3rd transaction does not occur, the scan will not be launched.
Before the GNSS/WIFI scan is launched, the LoRa Basics Modem-E masks those IRQs (like NSS) which might impact the radio
capture. After the GNSS/WIFI scan is finished, the EVENT line is driven high to signal to the host MCU that scan results are
available.
After the Wi-Fi Passive Scan or GNSS Scan, the LoRa Basics Modem-E returns to sleep mode and drives the BUSY line to high.
LoRa Basics Modem-E
Reference Manual Rev.1.0
RM.BASICSMODEM-E.W.APP Sep-2020
15 of 79
Semtech
www.semtech.com
Figure 2-4: Wi-Fi Passive Scan / GNSS Scan SPI Transaction
NOTE: No status bits or IRQstatus bits are returned on the MISO line during a Wi-Fi Passive Scan / GNSS Scan SPI transaction.
2.2 BUSY Signalling
The BUSY line is an output signal of the LoRa Basics Modem-E. It is mapped on the IO0 pin of the LoRa Basics Modem-E.
The BUSY line is high when the device is in sleep mode, and ready to accept a command. Therefore, it is necessary to check
the status of BUSY prior to sending a command.
Note: The BUSY signal has inverted polarity in the Transceiver and Modem implementations.
2.3 EVENT Signalling
2.3.1 Description
The EVENT signal is an output signal of the LoRa Basics Modem-E. It is mapped on the DIO9 pin of the LoRa Basics Modem-E.
This line signals to the host MCU that the device has an asynchronous event data pending. The event can be LoRaWA
stack, GNSS, or Wi-Fi events. The host MCU must use the GetEventSize (...) command to determine the event size and
GetEvent (...) command to retrieve such data.
The event line stays high until all events are cleared. The host MCU must clear all the events before returning to sleep mode.
This prevents the host MCU from missing the rising edge of the EVENT line when there is a new event. Secondly, this saves
several tens of uA of current consumption when the EVENT line is kept high by the LoRa Basics Modem-E.
2.3.2 Event Handling Examples
Some SPI commands generate an immediate response by the LoRa Basics Modem-E, and therefore do not generate any
event, such as the command GnssReadAssistancePosition(...), as shown in Figure 2-5: GnssAlmanacRead Transaction.
LoRa Basics Modem-E
Reference Manual Rev.1.0
RM.BASICSMODEM-E.W.APP Sep-2020
16 of 79
Semtech
www.semtech.com
Figure 2-5: GnssAlmanacRead Transaction
Figure 2-6: Wi-Fi Passive Scan/ GNSS Scan Transaction shows the event sequence in case of a Wi-Fi Passive Scan or GNSS
Scan command: the EVENT signal indicates that some asynchronous data is available. The GetEventSize(...) command allows
to determine the number of Bytes of the event stored in the LoRa Basics Modem-E, and GetEvent(...) allows to read back this
event.
Figure 2-6: Wi-Fi Passive Scan/ GNSS Scan Transaction
Figure 2-7: Class A TX Transaction shows the event sequence of a LoRaWAN® class A packet transmission.
LoRa Basics Modem-E
Reference Manual Rev.1.0
RM.BASICSMODEM-E.W.APP Sep-2020
17 of 79
Semtech
www.semtech.com
Figure 2-7: Class A TX Transaction
2.3.3 GetEventSize Command Description
The command GetEventSize(...) reads back the Length in Bytes of the event stored in the LoRa Basics Modem-E.
Table 2-6: GetEventSize Response
The ReturnCode (RC) is defined in Table 2-4: Return Code Definitions.
2.3.4 GetEvent Command Description
The command GetEvent(...) retrieves pending events from the Modem. Pending events are indicated by the EVENT line. The
EVENT line is de-asserted after all events have been retrieved and no further events are available. When no event is available
this command returns an empty response payload.
Table 2-5: GetEventSize Command
Byte 0 1 2
Data from Host 0x06 0x33 CRC
Byte 0 (1:2) 3
Data to Host ReturnCode Length CRC
LoRa Basics Modem-E
Reference Manual Rev.1.0
RM.BASICSMODEM-E.W.APP Sep-2020
18 of 79
Semtech
www.semtech.com
Events that are not retrieved by the application might be overwritten by new event data of the same type. In this case, only
the latest event data will be returned and the count field indicates how many events of this type have been missed.
Table 2-8: GetEvent Response
The ReturnCode (RC) is defined in Table 2-4: Return Code Definitions.
The EventType is defined in Table 2-9: EventType Definition.
Count indicates the number of events of this type missed.
Table 2-7: GetEvent Command
Byte 0 1 2
Data from Host 0x06 0x00 CRC
Byte 0 1 2 N N+1
Data to Host ReturnCode EventType Count Data CRC
Table 2-9: EventType Definition
EventType Code Description Data
Reset 0x00 Modem has been reset ResetCount(0:1)
Alarm 0x01 Alarm timer expired --
Joined 0x02 Network successfully joined --
TxDone 0x03 Frame transmitted Status(1)
DownData 0x04 Downlink data received
Rssi(1), Snr(1), Flags(1), Port(1),
Downdata(n)
UploadDone 0x05 File upload completed Status(1)
SetConf 0x06
Config has been changed by
DM
InfoTag(1)
Mute 0x07
Modem has been muted or
unmuted by DM
Mute(1)
StreamDone 0x08
Last data stream fragment
sent
--
JoinFail 0x0A Attempt to join network failed --
Wi-Fi 0x0B Wi-Fi Passive scan done Variable
GNSS 0x0C
GNSS scan done, SPI Almanac
update done
Variable
TimeUpdatedAlcsync 0x0D
Time Updated by Alcsync
(status=1: synchronization
with the network, status = 0:
synchronization lost after 6
days without answer)
Status(1)
LoRa Basics Modem-E
Reference Manual Rev.1.0
RM.BASICSMODEM-E.W.APP Sep-2020
19 of 79
Semtech
www.semtech.com
2.3.5 GNSS Event Format
The GNSS Scan Done Event structure is shown in Table 2-10: GNSS Event Format.
Destination=0x00 indicates that the event is intended for the Host MCU.
The Content field can be one of the following values, as shown in Table 2-11: GNSS Events for the Host MCU.
SwitchAdrMobiletoStatic 0x0E
Indicates the host MCU when
the modem automatically
switches from mobile to static
when connection time-out
occurs.
--
NewLinkAdr 0x0F
Modem receives an Link ADR
request, the host MCU might
check if need to change the
ADR profile from static to
mobile.
--
NoEvent 0xFF
No event exists. Notifies the
user that no data must be
read.
Table 2-10: GNSS Event Format
Destination Content
Destination Content
Table 2-11: GNSS Events for the Host MCU
Content Description
0 Process OK
5 Capture failed
6 No time
7 No satellite detected
8 Almanac too old
9 Almanac update failed (CRC errors)
10 Almanac update failed (Flash integrity error)
13 Global Almanac CRC error at boot
14 Almanac version not supported
Table 2-9: EventType Definition
EventType Code Description Data
LoRa Basics Modem-E
Reference Manual Rev.1.0
RM.BASICSMODEM-E.W.APP Sep-2020
20 of 79
Semtech
www.semtech.com
Dest=0x01 indicates that the event is intended for the GNSS Solver:
Table 2-12: GNSS Events for the GNSS Solver
Content Description
0x00 Payload=0x00 Request aiding position
0x01 Variable NAV message
  • Page 1 1
  • Page 2 2
  • Page 3 3
  • Page 4 4
  • Page 5 5
  • Page 6 6
  • Page 7 7
  • Page 8 8
  • Page 9 9
  • Page 10 10
  • Page 11 11
  • Page 12 12
  • Page 13 13
  • Page 14 14
  • Page 15 15
  • Page 16 16
  • Page 17 17
  • Page 18 18
  • Page 19 19
  • Page 20 20
  • Page 21 21
  • Page 22 22
  • Page 23 23
  • Page 24 24
  • Page 25 25
  • Page 26 26
  • Page 27 27
  • Page 28 28
  • Page 29 29
  • Page 30 30
  • Page 31 31
  • Page 32 32
  • Page 33 33
  • Page 34 34
  • Page 35 35
  • Page 36 36
  • Page 37 37
  • Page 38 38
  • Page 39 39
  • Page 40 40
  • Page 41 41
  • Page 42 42
  • Page 43 43
  • Page 44 44
  • Page 45 45
  • Page 46 46
  • Page 47 47
  • Page 48 48
  • Page 49 49
  • Page 50 50
  • Page 51 51
  • Page 52 52
  • Page 53 53
  • Page 54 54
  • Page 55 55
  • Page 56 56
  • Page 57 57
  • Page 58 58
  • Page 59 59
  • Page 60 60
  • Page 61 61
  • Page 62 62
  • Page 63 63
  • Page 64 64
  • Page 65 65
  • Page 66 66
  • Page 67 67
  • Page 68 68
  • Page 69 69
  • Page 70 70
  • Page 71 71
  • Page 72 72
  • Page 73 73
  • Page 74 74
  • Page 75 75
  • Page 76 76
  • Page 77 77
  • Page 78 78
  • Page 79 79

Semtech LoRa Basics Modem-E User manual

Category
Networking
Type
User manual

Ask a question and I''ll find the answer in the document

Finding information in a document is now easier with AI