LoRa Basics™ Modem User Manual v3.2 documentation
LoRa Basics Modem Options¶
The LoRa Basics Modem library is highly customizable. The following sections list the compile time options. The list of compile time options can also be obtained by issuing the command make help.
Radio Targets¶
Support for the following transceivers can be selected at build time:
sx128x - SX1280 & SX1281 Transceivers.
lr1110 - LR1110 Transceiver.
lr1120 - LR1120 Transceiver.
sx1261 - SX1261 Transceiver.
sx1262 - SX1262 Transceiver.
LoRa Basics™ Modem (LBM) should be built for a specific transceiver by using the basic_modem_<TARGET> parameter.
MCU Flags¶
MCU flags are passed to the compiler by means of the MCU_FLAGS build parameter. The flags are set as a single text string. For example, to build LoRa Basics Modem for a STM32L4 MCU the following MCU_FLAGS is used:
MCU_FLAGS=”-mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard”
Regions¶
Support for one or more of the following regions can be selected at compile time:
AS_923 - AS923MHz ISM Band. Group selection is performed at runtime through the API.
AU_915 - AU915-928MHz ISM Band.
CN_470 - CN470-510MHz Band.
CN_470_RP_1_0 - CN470-510MHz Band. LoRaWAN Regional Parameters v1.0 version.
EU_868 - EU863-870MHz ISM Band.
IN_865 - IN865-867MHz ISM Band.
KR_920 - KR920-923MHz ISM Band.
RU_864 - RU864-870MHz ISM Band.
US_915 - US902-928MHz ISM Band.
WW_2G4 - Emulation of the LoRaWAN protocol for the 2.4GHz global ISM band.
The supported regions are selected through the REGION build option. If the user does not explicitly select one or more regions, all regions are included at compile time.
Regional Parameters¶
Two versions of the LoRaWAN Regional Parameters are supported:
RP2_101 - LoRaWAN Regional Parameters vRP002-1.0.1 (Default).
RP2_103 - LoRaWAN Regional Parameters vRP002-1.0.3. This option includes support for LR-FHSS.
The LoRaWAN Regional Parameters version is selected at compile time through the RP_VERSION compile option.
Cryptographic Engine Selection¶
LR11xx Transceivers include a Cryptographic Engine which provides a dedicated hardware accelerator for AES-128 encryption based algorithms. This Cryptographic Engine improves the power efficiency of cryptographic operations and reduces the code size of the software stack. Alternatively, LBM includes a software-implemented Cryptographic Engine. The selection of the Cryptographic Engine to use is done through the CRYPTO parameter. The following options are available:
SOFT - Use the LoRa Basics Modem Cryptographic Engine (Default).
LR11XX - Use the LR1110 or LR1120 Cryptographic Engine.
LR11XX_WITH_CREDENTIALS - Use the LR1110 or LR1120 Cryptographic Engine with pre-provisioned EUIs and keys.
GNSS¶
LR1110 Transceivers include a GNSS receiver that allows fast and energy efficient outdoor geolocation. Use of the GNSS receiver can be enabled or disabled by means of the following parameter:
USE_GNSS=yes/no - Enable or disable the use of the LR1110 GNSS receiver.
Debug Options¶
The following options can be enabled for debugging:
VERBOSE=yes/no - Increase build verbosity (default: no).
DEBUG=yes/no - Enable debugging options (default: no).
MODEM_TRACE=yes/no - Choose to enable or disable modem trace print (default: yes).
Example¶
For example to compile LoRa Basics Modem for an STM32L4 CPU with an SX1262 transceiver, with support for US_915 region using regional parameters RP2-1.0.1, without modem trace print and with increase build verbosity the following command line should be used:
make basic_modem_sx1262 MCU_FLAGS=”-mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard” REGION=US_915 RP_VERSION=RP2_101 CRYPTO=SOFT MODEM_TRACE=no VERBOSE=yes
Table of Contents
- Introduction
- LoRa Basics Modem Architecture
- LoRa Basics Modem Integration with LoRa Cloud
- LoRa Basics Modem Options
- Developing an Application with LoRa Basics™ Modem
- Porting
- Radio Selection
- Reset and Initialize the System
- Get Version Information
- Fetch an Event
- Join a LoRaWAN® Network
- LoRaWAN® Class B
- LoRaWAN® Multicast
- Send Data Over LoRaWAN
- Receive Data Over LoRaWAN
- Manage a LoRaWAN Connection Lifecycle
- Get Time from the Network Server or Application Server
- Send Information with the Device Management Services
- Update the Almanac with Device Management Services
- Send Data with the Stream Service
- Send Data with the File Upload Service
- Configure a Timer
- Interleave Direct Radio Access
- Known Limitations
- LoRa Basics™ Modem API Reference
- LoRa Basics™ Modem Event Codes Definitions
- LoRa Basics™ Modem Device Management Fields
- LoRa Basics™ Modem API Return Codes
- LoRa Basics™ Modem Datarate Profiles
- LoRa Basics™ Modem API Functions
- smtc_modem_abort_extended_uplink()
- smtc_modem_adr_get_profile()
- smtc_modem_adr_set_profile()
- smtc_modem_alarm_clear_timer()
- smtc_modem_alarm_get_remaining_time()
- smtc_modem_alarm_start_timer()
- smtc_modem_class_b_get_ping_slot_periodicity()
- smtc_modem_class_b_set_ping_slot_periodicity()
- smtc_modem_connection_timeout_get_current_values()
- smtc_modem_connection_timeout_get_thresholds()
- smtc_modem_connection_timeout_set_thresholds()
- smtc_modem_d2d_class_b_get_tx_max_payload()
- smtc_modem_d2d_class_b_request_uplink()
- smtc_modem_dm_get_fport()
- smtc_modem_dm_get_info_fields()
- smtc_modem_dm_get_info_interval()
- smtc_modem_dm_get_user_data()
- smtc_modem_dm_request_single_uplink()
- smtc_modem_dm_set_fport()
- smtc_modem_dm_set_info_fields()
- smtc_modem_dm_set_info_interval()
- smtc_modem_dm_set_user_data()
- smtc_modem_factory_reset()
- smtc_modem_file_upload_init()
- smtc_modem_file_upload_reset()
- smtc_modem_file_upload_start()
- smtc_modem_get_adr_ack_limit_delay()
- smtc_modem_get_available_datarates()
- smtc_modem_get_certification_mode()
- smtc_modem_get_charge()
- smtc_modem_get_class()
- smtc_modem_get_crystal_error_ppm()
- smtc_modem_get_deveui()
- smtc_modem_get_duty_cycle_status()
- smtc_modem_get_event()
- smtc_modem_get_joineui()
- smtc_modem_get_lorawan_version()
- smtc_modem_get_modem_version()
- smtc_modem_get_nb_trans()
- smtc_modem_get_network_frame_pending_status()
- smtc_modem_get_network_type()
- smtc_modem_get_next_tx_max_payload()
- smtc_modem_get_region()
- smtc_modem_get_regional_params_version()
- smtc_modem_get_stack_state()
- smtc_modem_get_status()
- smtc_modem_get_time()
- smtc_modem_get_tx_power_offset_db()
- smtc_modem_increment_event_middleware()
- smtc_modem_init()
- smtc_modem_join_network()
- smtc_modem_lbt_get_parameters()
- smtc_modem_lbt_get_state()
- smtc_modem_lbt_set_parameters()
- smtc_modem_lbt_set_state()
- smtc_modem_leave_network()
- smtc_modem_lorawan_class_b_request_ping_slot_info()
- smtc_modem_lorawan_get_lost_connection_counter()
- smtc_modem_lorawan_request_link_check()
- smtc_modem_multicast_class_b_get_session_status()
- smtc_modem_multicast_class_b_start_session()
- smtc_modem_multicast_class_b_stop_all_sessions()
- smtc_modem_multicast_class_b_stop_session()
- smtc_modem_multicast_class_c_get_session_status()
- smtc_modem_multicast_class_c_start_session()
- smtc_modem_multicast_class_c_stop_all_sessions()
- smtc_modem_multicast_class_c_stop_session()
- smtc_modem_multicast_get_grp_config()
- smtc_modem_multicast_set_grp_config()
- smtc_modem_request_emergency_uplink()
- smtc_modem_request_empty_uplink()
- smtc_modem_request_extended_uplink()
- smtc_modem_request_uplink()
- smtc_modem_reset()
- smtc_modem_reset_charge()
- smtc_modem_resume_after_user_radio_access()
- smtc_modem_rp_abort_user_radio_access_task()
- smtc_modem_rp_add_user_radio_access_task()
- smtc_modem_run_engine()
- smtc_modem_set_adr_ack_limit_delay()
- smtc_modem_set_certification_mode()
- smtc_modem_set_class()
- smtc_modem_set_crystal_error_ppm()
- smtc_modem_set_deveui()
- smtc_modem_set_joineui()
- smtc_modem_set_nb_trans()
- smtc_modem_set_network_type()
- smtc_modem_set_nwkkey()
- smtc_modem_set_region()
- smtc_modem_set_tx_power_offset_db()
- smtc_modem_stream_add_data()
- smtc_modem_stream_init()
- smtc_modem_stream_status()
- smtc_modem_suspend_before_user_radio_access()
- smtc_modem_suspend_radio_communications()
- smtc_modem_time_get_alcsync_fport()
- smtc_modem_time_get_sync_interval_s()
- smtc_modem_time_get_sync_invalid_delay_s()
- smtc_modem_time_set_alcsync_fport()
- smtc_modem_time_set_sync_interval_s()
- smtc_modem_time_set_sync_invalid_delay_s()
- smtc_modem_time_start_sync_service()
- smtc_modem_time_stop_sync_service()
- smtc_modem_time_trigger_sync_request()
- LoRa Basics™ Modem API LR11xx Extension
- LoRa Basics™ Modem API Test Functions
- smtc_modem_test_direct_radio_read()
- smtc_modem_test_direct_radio_write()
- smtc_modem_test_duty_cycle_app_activate()
- smtc_modem_test_get_nb_rx_packets()
- smtc_modem_test_get_rssi()
- smtc_modem_test_nop()
- smtc_modem_test_radio_reset()
- smtc_modem_test_rssi()
- smtc_modem_test_rx_continuous()
- smtc_modem_test_start()
- smtc_modem_test_stop()
- smtc_modem_test_tx()
- smtc_modem_test_tx_cw()
- Revision History