### Build LCTT Certification Example (make) Source: https://github.com/lora-net/swl2001/blob/master/lbm_applications/2_porting_nrf_52840/README.md Use this command to build the LCTT certification example for the lr1110 radio using make. ```bash make lr1110 MODEM_APP=LCTT_CERTIF ``` -------------------------------- ### Build Hardware Modem Example (make) Source: https://github.com/lora-net/swl2001/blob/master/lbm_applications/2_porting_nrf_52840/README.md Use this command to build the hardware modem example for the lr1110 radio using make. ```bash make lr1110 MODEM_APP=HW_MODEM ``` -------------------------------- ### Build Hardware Modem Example (cmake) Source: https://github.com/lora-net/swl2001/blob/master/lbm_applications/2_porting_nrf_52840/README.md Use this command to build the hardware modem example for the lr1110 radio using cmake. ```bash cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=MinSizeRel -DLBM_RADIO=lr1110 -DAPP=hw_modem -DLBM_CMAKE_CONFIG_AUTO=ON ninja -C build ``` -------------------------------- ### Build Porting Tests Example (make) Source: https://github.com/lora-net/swl2001/blob/master/lbm_applications/2_porting_nrf_52840/README.md Use this command to build the porting tests example for the lr1110 radio using make. ```bash make lr1110 MODEM_APP=PORTING_TESTS ``` -------------------------------- ### Build LCTT Certification Example (cmake) Source: https://github.com/lora-net/swl2001/blob/master/lbm_applications/2_porting_nrf_52840/README.md Use this command to build the LCTT certification example for the lr1110 radio using cmake. ```bash cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=MinSizeRel -DLBM_RADIO=lr1110 -DAPP=lctt_certif -DLBM_CMAKE_CONFIG_AUTO=ON ninja -C build ``` -------------------------------- ### Build Porting Tests Example (cmake) Source: https://github.com/lora-net/swl2001/blob/master/lbm_applications/2_porting_nrf_52840/README.md Use this command to build the porting tests example for the lr1110 radio using cmake. ```bash cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=MinSizeRel -DLBM_RADIO=lr1110 -DAPP=porting_tests -DLBM_CMAKE_CONFIG_AUTO=ON ninja -C build ``` -------------------------------- ### Example Output Source: https://github.com/lora-net/swl2001/blob/master/lbm_applications/3_geolocation_on_lora_edge/main_full_almanac_update/README.md This is an example of the expected output during the full almanac update process, indicating success. ```shell INFO: FULL ALMANAC UPDATE example is starting ... INFO: Event received: RESET INFO: LR11XX FW: 0x0401, type: 0x01 INFO: mw_gnss_almanac_full_update: SUCCESS (123 ms) INFO: SUCESS: almanac source date Sun 2025-03-30 00:00:00 GMT ``` -------------------------------- ### Install LR20XX Driver Libraries and Headers Source: https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_core/radio_drivers/lr20xx_driver/src/CMakeLists.txt Configures the installation of all defined LR20XX driver libraries and their associated include directories. This ensures that the driver can be correctly integrated into other projects. ```cmake install(TARGETS lr20xx_driver lr20xx_driver_lora lr20xx_driver_fsk lr20xx_driver_bluetooth_le lr20xx_driver_bpsk lr20xx_driver_flrc lr20xx_driver_lr_fhss lr20xx_driver_ook lr20xx_driver_oqpsk_15_4 lr20xx_driver_wi_sun lr20xx_driver_wm_bus lr20xx_driver_z_wave lr20xx_driver_rttof EXPORT Lr20xxDriverTargets LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin INCLUDES DESTINATION include ) ``` -------------------------------- ### CMake Project Setup Source: https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_core/radio_drivers/lr20xx_driver/CMakeLists.txt Sets the minimum required CMake version and defines the project name, description, and language. ```cmake cmake_minimum_required(VERSION 3.25) project( lr20xx_driver DESCRIPTION "LR20xx driver library" LANGUAGES C ) ``` -------------------------------- ### Install SX128x Library and Headers Source: https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_core/radio_drivers/sx128x_driver/src/CMakeLists.txt Installs the sx128x_driver library, export configuration, and include files to their designated locations. This makes the driver available for use in other projects. ```cmake install(TARGETS sx128x_driver EXPORT Sx128xDriverTargets LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin INCLUDES DESTINATION include ) ``` -------------------------------- ### Build Relay Tx Example with Make Source: https://github.com/lora-net/swl2001/blob/master/lbm_examples/README.md Use this command to build the Relay Tx example for the lr1110 radio using Make. This enables the Relay Tx feature and adds a WOR frame before each uplink. ```bash make full_lr1110 MODEM_APP=PERIODICAL_UPLINK ALLOW_RELAY_TX=yes ``` -------------------------------- ### Build LCTT Certification Example with CMake Source: https://github.com/lora-net/swl2001/blob/master/lbm_examples/README.md Use this command to build the LCTT certification example for the lr1110 radio using CMake. This application enables certification mode when the blue button is pushed. ```bash cmake -B build/ -G Ninja -DCMAKE_BUILD_TYPE=MinSizeRel -DBOARD=NUCLEO_L476 -DLBM_RADIO=lr1110 -DAPP=lctt_certif -DLBM_CMAKE_CONFIG_AUTO=ON ninja -C build/ ``` -------------------------------- ### Configure LBM Example ELF Target Sources Source: https://github.com/lora-net/swl2001/blob/master/lbm_examples/hw_modem/CMakeLists.txt Defines the source files for the lbm_example.elf target. Includes main application files and hardware-specific modem sources. ```cmake target_sources(lbm_example.elf PRIVATE main_${APP}.c cmd_parser.c git_version.c hw_modem.c ) ``` -------------------------------- ### Build Relay Tx Example with CMake Source: https://github.com/lora-net/swl2001/blob/master/lbm_examples/README.md Use this command to build the Relay Tx example for the lr1110 radio using CMake. This enables the Relay Tx feature and adds a WOR frame before each uplink. ```bash cmake -B build/ -G Ninja -DCMAKE_BUILD_TYPE=MinSizeRel -DBOARD=NUCLEO_L476 -DLBM_RADIO=lr1110 -DAPP=periodical_uplink -DLBM_RELAY_TX=ON -DLBM_CMAKE_CONFIG_AUTO=ON ninja -C build/ ``` -------------------------------- ### Build Periodical Uplink Example with Make Source: https://github.com/lora-net/swl2001/blob/master/README.md Builds the periodical uplink example for the LR1110 Semtech radio using Make. Ensure the GNU Arm Embedded Toolchain and Make are in your PATH. ```bash make -C lbm_examples full_lr1110 MODEM_APP=PERIODICAL_UPLINK ``` -------------------------------- ### Build Periodical Uplink Example with CMake Source: https://github.com/lora-net/swl2001/blob/master/README.md Builds the periodical uplink example for the LR1110 Semtech radio using CMake and Ninja. This process involves configuring with CMake, building with Ninja, and flashing the connected board. ```bash cd lbm_examples cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=MinSizeRel -DLBM_CMAKE_CONFIG_AUTO=ON -DBOARD=NUCLEO_L476 -DLBM_RADIO=lr1110 -DAPP=periodical_uplink cd build ninja # This will flash a connected stm32 nucleo board ninja flash ``` -------------------------------- ### Flash Target with Ninja Source: https://github.com/lora-net/swl2001/blob/master/lbm_applications/3_geolocation_on_lora_edge/main_full_almanac_update/README.md Flash the compiled binary to the target board using Ninja. Requires 'stlink-tools' to be installed. ```bash ninja -C build flash ``` -------------------------------- ### Get Next ThreadX Timer Expiration Source: https://github.com/lora-net/swl2001/blob/master/lbm_applications/1_thread_x_on_stm32_u5/smtc_hal_u5/threadx/utility/low_power/low_power.md This example shows how to use `tx_timer_get_next` to determine the next timer expiration in ticks before entering a low power state. This ensures ThreadX timer services remain accurate. ```c ULONG tx_low_power_next_expiration; /* The next timer expiration (units of ThreadX timer ticks). */ ULONG timers_active; /* At this point, we want to enter low power mode, since nothing meaningful is going on in the system. However, in order to keep the ThreadX timer services accurate, we must first determine the next ThreadX timer expiration in terms of ticks. This is accomplished via the tx_timer_get_next API. */ timers_active = tx_timer_get_next(&tx_low_power_next_expiration); ``` -------------------------------- ### Install SX127x Driver Target Source: https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_core/radio_drivers/sx127x_driver/src/CMakeLists.txt Installs the SX127x driver library and its associated artifacts. This command specifies the target name, export name, and installation destinations for libraries, archives, runtimes, and include files. ```cmake install(TARGETS sx127x_driver EXPORT Sx127xDriverTargets LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin INCLUDES DESTINATION include ) ``` -------------------------------- ### Build with Make Source: https://github.com/lora-net/swl2001/blob/master/lbm_applications/3_geolocation_on_lora_edge/main_wifi_region_detection/README.md Build the application using GNU make. Specify the target board and application name. Refer to `../app_makefiles/app_options.mk` for default compilation options. ```shell $ make full_lr1110 MODEM_APP=EXAMPLE_WIFI_REGION_DETECTION ``` -------------------------------- ### Explore Makefile Build Options Source: https://github.com/lora-net/swl2001/blob/master/lbm_lib/README.md View all available build process options for the LoRa Basics Modem using the Makefile system. This command lists the various configurations possible. ```bash make -C help ``` -------------------------------- ### Compile with Make Source: https://github.com/lora-net/swl2001/blob/master/lbm_applications/3_geolocation_on_lora_edge/main_full_almanac_update/README.md Compile the full almanac update application using Make. Set MODEM_APP to EXAMPLE_FULL_ALMANAC_UPDATE. ```bash make full_lr1110 MODEM_APP=EXAMPLE_FULL_ALMANAC_UPDATE ``` -------------------------------- ### Build Periodical Uplink Example (cmake) Source: https://github.com/lora-net/swl2001/blob/master/lbm_applications/2_porting_nrf_52840/README.md Use this command to build the periodical uplink example for the lr1110 radio using cmake. ```bash cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=MinSizeRel -DLBM_RADIO=lr1110 -DAPP=periodical_uplink -DLBM_CMAKE_CONFIG_AUTO=ON ninja -C build ``` -------------------------------- ### Configure LoRaWAN Credentials Source: https://github.com/lora-net/swl2001/blob/master/lbm_applications/1_thread_x_on_stm32_u5/README.md Modify the 'example_options.h' file to set your LoRaWAN Device EUI, Join EUI, and App Key. Ensure these values are correctly formatted as byte arrays. ```c #define USER_LORAWAN_DEVICE_EUI {0xAC, 0xAF, 0xEF, 0xAB, 0x00, 0x00, 0x00, 0x00} #define USER_LORAWAN_JOIN_EUI {0xAC, 0xAF, 0xEF, 0xAB, 0x00, 0x00, 0x00, 0x00} #define USER_LORAWAN_APP_KEY {0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } ``` -------------------------------- ### Build LR11xx Flasher with Make Source: https://github.com/lora-net/swl2001/blob/master/lbm_applications/3_geolocation_on_lora_edge/main_lr11xx_flasher/README.md Alternatively, use this make command to build the LR11xx flasher tool. Ensure the `lr11xx_fw.h` file is in the `main_lr11xx_flasher` directory. ```bash make full_lr1110 MODEM_APP=EXAMPLE_LR11XX_FLASHER ``` -------------------------------- ### Install lr11xx_driver Target Source: https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_core/radio_drivers/lr11xx_driver/src/CMakeLists.txt Installs the 'lr11xx_driver' target, defining the destinations for the library, archive, runtime binaries, and include files. This ensures the driver can be used by other projects. ```cmake install(TARGETS lr11xx_driver EXPORT Lr11xxDriverTargets LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin INCLUDES DESTINATION include ) ``` -------------------------------- ### Wi-Fi Region Detection Output Example Source: https://github.com/lora-net/swl2001/blob/master/lbm_applications/3_geolocation_on_lora_edge/main_wifi_region_detection/README.md This is an example of the output generated by the Wi-Fi region detection application, showing scan results and the estimated geographical region. ```shell INFO: Event received: WIFI_SCAN_DONE SCAN_DONE info: -- number of results: 5 -- power consumption: 20765 nah -- scan duration: 7199 ms [ 14 CC 20 CB 53 56 ] Channel:8 Type:1 RSSI:-57 Origin:FIXED Country code:.. SSID:TP-LINK_CB5356 [ 64 70 02 D9 94 55 ] Channel:6 Type:1 RSSI:-74 Origin:FIXED Country code:US SSID:briere [ F4 CA E5 8B 49 A0 ] Channel:11 Type:1 RSSI:-91 Origin:FIXED Country code:.. SSID:freebox_briere [ F4 CA E5 8B 49 A2 ] Channel:11 Type:1 RSSI:-92 Origin:FIXED Country code:.. SSID:FreeWifi_secure [ 38 B5 C9 03 8A 60 ] Channel:1 Type:1 RSSI:-94 Origin:FIXED Country code:FR SSID:Livebox-8A60 === Region Scores (value, ratio%, margin%) === EU868 : 5, 83%, 80% US915 : 1, 17%, N/A CN470 : 0, 0%, N/A AU915 : 0, 0%, N/A KR920 : 0, 0%, N/A IN865 : 0, 0%, N/A RU864 : 0, 0%, N/A AS923 : 0, 0%, N/A =========================================== INFO: ----------------------- INFO: Estimated region: EU868 with 81% confidence INFO: ----------------------- ``` -------------------------------- ### Install SX126x Driver Target Source: https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_core/radio_drivers/sx126x_driver/src/CMakeLists.txt Installs the 'sx126x_driver' target, including its library, archive, runtime binaries, and include files. This makes the driver available for use in other projects. ```cmake install(TARGETS sx126x_driver EXPORT Sx126xDriverTargets LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin INCLUDES DESTINATION include ) ``` -------------------------------- ### Configure Target Sources for nRF52840 Example Source: https://github.com/lora-net/swl2001/blob/master/lbm_applications/2_porting_nrf_52840/main_examples/CMakeLists.txt Specifies the source files for the 'lbm_example.elf' target, dynamically including 'main_.c' based on the 'APP' variable. This is a common pattern for managing application-specific sources in CMake projects. ```cmake target_sources(lbm_example.elf PRIVATE main_${APP}.c ) ``` -------------------------------- ### Install Exported Targets Source: https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_core/radio_drivers/lr20xx_driver/CMakeLists.txt Configures the installation of exported targets, creating a CMake configuration file for consumers of the library. This allows other projects to find and use the LR20xx driver. ```cmake install(EXPORT Lr20xxDriverTargets FILE Lr20xxDriverConfig.cmake NAMESPACE lr20xx_driver:: DESTINATION lib/cmake/Lr20xx ) ``` -------------------------------- ### Build Periodical Uplink Example with CMake Source: https://github.com/lora-net/swl2001/blob/master/lbm_examples/README.md Use this command to build the periodical uplink example for the lr1110 radio using CMake. Ensure LoRaWAN credentials are set in example_options.h. ```bash cmake -B build/ -G Ninja -DCMAKE_BUILD_TYPE=MinSizeRel -DBOARD=NUCLEO_L476 -DLBM_RADIO=lr1110 -DAPP=periodical_uplink -DLBM_CMAKE_CONFIG_AUTO=ON ninja -C build/ ``` -------------------------------- ### Configure Debugging Options Source: https://github.com/lora-net/swl2001/blob/master/lbm_lib/README.md Control build verbosity, enable debugging options, and manage modem trace print statements using VERBOSE, DEBUG, and MODEM_TRACE parameters. ```bash make VERBOSE=yes ``` ```bash make DEBUG=yes ``` ```bash make MODEM_TRACE=no ``` -------------------------------- ### Build and Install SMTC RALF Libraries for Radios Source: https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_core/smtc_ralf/src/CMakeLists.txt This snippet iterates through different radio types, creating a static library for each. It sets up include directories and defines installation rules for the libraries and their aliases. ```cmake foreach(radio lr11xx lr20xx sx126x sx127x sx128x) set(library_name smtc_ralf_${radio}) add_library(${library_name} STATIC EXCLUDE_FROM_ALL ${CMAKE_CURRENT_SOURCE_DIR}/ralf_${radio}.c ) target_include_directories(${library_name} PUBLIC $ $ ) install(TARGETS ${library_name} OPTIONAL EXPORT SmtcRalfTargets LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin INCLUDES DESTINATION include ) add_library(smtc_ralf::${library_name} ALIAS ${library_name}) endforeach(radio) ``` -------------------------------- ### Link Libraries for lbm_example.elf Source: https://github.com/lora-net/swl2001/blob/master/lbm_applications/2_porting_nrf_52840/CMakeLists.txt This command links the necessary libraries to the lbm_example.elf executable. These libraries provide the core LoRaWAN functionality and hardware abstraction. ```cmake target_link_libraries(lbm_example.elf PRIVATE lora_basics_modem_core radio_hal smtc_modem_hal_implem ) ``` -------------------------------- ### Build Relay Tx for LCTT with Make Source: https://github.com/lora-net/swl2001/blob/master/lbm_examples/README.md Use this command to build the Relay Tx example for LCTT certification with Make. This enables the Relay Tx feature and allows testing with the LCTT tool. ```bash make full_lr1110 MODEM_APP=LCTT_CERTIF ALLOW_RELAY_TX=yes ``` -------------------------------- ### TX_LOW_POWER_TIMER_SETUP Source: https://github.com/lora-net/swl2001/blob/master/lbm_applications/1_thread_x_on_stm32_u5/smtc_hal_u5/threadx/utility/low_power/low_power.md Sets up a low power timer to wake the processor after a specified number of ticks. This macro is essential for tickless operation in low power mode. ```APIDOC ## TX_LOW_POWER_TIMER_SETUP ### Description This macro invokes a user-defined function to set up a low power timer. It is called within `tx_low_power_enter` and is crucial for managing tickless operation in low power mode. ### Function Signature ```c VOID TX_LOW_POWER_TIMER_SETUP(ULONG tx_low_power_next_expiration); ``` ### Parameters #### Input Parameters - **tx_low_power_next_expiration** (ULONG) - The number of ticks to configure the low power timer. If `TX_LOW_POWER_TICKLESS` is not defined and no timers are active, this will be `0xFFFFFFFF`. ### Return Values - None ### Notes - The input `tx_low_power_next_expiration` is in ThreadX ticks. The frequency of a tick is defined by `TX_TIMER_TICKS_PER_SECOND`. - Do not put the processor to sleep within this macro. ### Optional Define - **TX_LOW_POWER_TICKLESS**: If defined, ThreadX will not call `TX_LOW_POWER_TIMER_SETUP` if no timers are active, and the internal tick count will not be maintained during or after low power mode. `TX_LOW_POWER_TIMER_SETUP` must also be defined if `TX_LOW_POWER_TICKLESS` is defined. ### Example ```c /* Low power timer function prototype. */ void low_power_timer_config(ULONG ticks); /* Define the TX_LOW_POWER_TIMER_SETUP macro. */ #define TX_LOW_POWER_TIMER_SETUP low_power_timer_config void low_power_timer_config(ULONG ticks) { /* Insert code here to configure a hardware timer to wake the processor from sleep after ticks/TX_TIMER_TICKS_PER_SECOND seconds. */ } ``` ``` -------------------------------- ### Server Side View: NMEA Data Stream Example Source: https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_core/modem_services/stream_packages/rose.rst Illustrates unconsumed data from offsets 0x3450 to 0x34BC, showing NMEA sentences with potential recovery (¿) and lost (×) octets. This example uses delimiters like '$' or CR/NL for message boundary detection. ```objdump streamOffset=0x3450 0x00: ××××GA,123529,2307.038,N,01131.0 0x20: 00,E,1,08,0.9,545.4,M,46.9,M,,*4 0x40: 7 $GPGSA,A,3,04,05,,09,12,,,24 0x60: ,,,,,2.5,1.3,2.1*39 $¿PGSV,2,1 0x80: ,08,01,40,083,4¿¿2,17,3¿8,41,12 0xA0: ,07,344,39,14,2¿,228,45*75 ``` -------------------------------- ### Compile Application with Make Source: https://github.com/lora-net/swl2001/blob/master/lbm_applications/1_thread_x_on_stm32_u5/README.md Use the 'make full_sx1261' command to compile the application for the SX1261 radio. Ensure your ARM GCC toolchain is set up. ```makefile make full_sx1261 ``` -------------------------------- ### LL ADC Driver Updates Source: https://github.com/lora-net/swl2001/blob/master/lbm_examples/mcu_drivers/STM32L4xx_HAL_Driver/Release_Notes.html Fix for injected conversion configuration with SW start in the LL ADC driver. ```APIDOC ## LL ADC Driver Enhancements ### Description Fix for injected conversion configuration with SW start in the LL ADC driver. ### Fix: - Fix injected conversion configuration with SW start in `LL_ADC_INJ_ConfigQueueContext()` ``` -------------------------------- ### Get Almanac Help Source: https://github.com/lora-net/swl2001/blob/master/lbm_applications/3_geolocation_on_lora_edge/main_full_almanac_update/README.md Use this command to display the help message for the almanac generation script. ```bash python ./get_full_almanac.py --help ``` -------------------------------- ### Linking Libraries for lbm_example.elf Source: https://github.com/lora-net/swl2001/blob/master/lbm_applications/3_geolocation_on_lora_edge/CMakeLists.txt This section specifies the source files and libraries required to build the `lbm_example.elf` executable. It includes the main C file and necessary HAL libraries. ```cmake target_sources(lbm_example.elf PRIVATE main.c $ ) target_link_libraries(lbm_example.elf lora_basics_modem_core radio_hal smtc_modem_hal_implem ) ``` -------------------------------- ### Enable Miscellaneous Services Source: https://github.com/lora-net/swl2001/blob/master/lbm_lib/README.md Compile in additional services like Geolocation or Store and Forward by setting their corresponding build options. ```bash make LBM_GEOLOCATION=true ``` ```bash make LBM_STORE_AND_FORWARD=true ```