Skip to content

Commit

Permalink
Release v2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mantoine committed Nov 3, 2021
0 parents commit 4274349
Show file tree
Hide file tree
Showing 221 changed files with 82,912 additions and 0 deletions.
166 changes: 166 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
##############################################################################
# Main makefile for basic_modem
##############################################################################

-include makefiles/printing.mk

#-----------------------------------------------------------------------------
# Global configuration options
#-----------------------------------------------------------------------------
# Prefix for all build directories
BUILD_ROOT = build

# Prefix for all binaries names
TARGET_ROOT = basic_modem

BYPASS=no

PERF_TEST=no

# Crypto management
CRYPTO ?= SOFT

# For LR1110 tranceiver
# - CHINA_DEMO -> Use Regional Parameters 1.0
# - HYBRID_CHINA -> RP 1.0, single channel
CHINA_DEMO ?= no
HYBRID_CHINA ?= no

ifeq ($(HYBRID_CHINA),yes)
CHINA_DEMO = yes
endif

# Compile with coverage analysis support
COVERAGE ?= no

# Use multithreaded build (make -j)
MULTITHREAD ?= yes

# Print each object file size
SIZE ?= no

# Save memory usage to log file
LOG_MEM ?= yes

# Tranceiver
RADIO ?= nc

# Trace prints
MODEM_TRACE ?= yes

# GNSS
USE_GNSS ?= yes



ifeq ($(MODEM_APP),EXAMPLE_LR1110_DEMO)
override USE_GNSS = yes
endif


#-----------------------------------------------------------------------------
# default action: print help
#-----------------------------------------------------------------------------
help:
$(call echo_help_b, "Available TARGETs: sx128x lr1110 sx1261 sx1262")
$(call echo_help, "")
$(call echo_help_b, "-------------------------------- Clean -------------------------------------")
$(call echo_help, " * make clean_<TARGET> : clean basic_modem for a given target")
$(call echo_help, " * make clean_all : clean all")
$(call echo_help, "")
$(call echo_help_b, "----------------------------- Compilation ----------------------------------")
$(call echo_help, " * make basic_modem_<TARGET> : build basic_modem on a given target")
$(call echo_help, " * make all : build all targets")
$(call echo_help, "")
$(call echo_help_b, "---------------------- Optional build parameters ---------------------------")
$(call echo_help, " * REGION=xxx : choose which region should be compiled (default: all)")
$(call echo_help, " * Combinations also work (i.e. REGION=EU_868,US_915 )")
$(call echo_help, " * - AS_923")
$(call echo_help, " * - AU_915")
$(call echo_help, " * - CN_470")
$(call echo_help, " * - CN_470_RP_1_0")
$(call echo_help, " * - EU_868")
$(call echo_help, " * - IN_865")
$(call echo_help, " * - KR_920")
$(call echo_help, " * - RU_864")
$(call echo_help, " * - US_915")
$(call echo_help, " * CRYPTO=xxx : choose which crypto should be compiled (default: SOFT)")
$(call echo_help, " * - SOFT")
$(call echo_help, " * - LR1110 (only for lr1110 target)")
$(call echo_help, " * - LR1110_WITH_CREDENTIALS (only for lr1110 target)")
$(call echo_help, " * MODEM_TRACE=yes/no : choose to enable or disable modem trace print (default: trace is ON)")
$(call echo_help, " * HYBRID_CHINA=yes : only for lr1110 target: build hybrid china with monochannel region")
$(call echo_help, " * CHINA_DEMO=yes : only for lr1110 target: build with full China RP_1_0 region")
$(call echo_help, " * USE_GNSS=yes/no : only for lr1110 target: choose to enable or disable use of gnss (default: gnss is ON)")
$(call echo_help, " * BYPASS=yes : build target using lorawan bypass")
$(call echo_help_b, "-------------------- Optional makefile parameters --------------------------")
$(call echo_help, " * MULTITHREAD=no : Disable multithreaded build")
$(call echo_help, " * COVERAGE=xxx : build target with coverage instrumentation for specific subsystems:")
$(call echo_help, " * - RADIO")
$(call echo_help, " * - MODEM")
$(call echo_help, " * VERBOSE=yes : Increase build verbosity")
$(call echo_help, " * SIZE=yes : Display size for all objects")



#-----------------------------------------------------------------------------
# Makefile include selection
#-----------------------------------------------------------------------------
ifeq ($(RADIO),lr1110)
-include makefiles/lr1110.mk
endif

ifeq ($(RADIO),sx1261)
-include makefiles/sx126x.mk
endif

ifeq ($(RADIO),sx1262)
-include makefiles/sx126x.mk
endif

ifeq ($(RADIO),sx128x)
-include makefiles/sx128x.mk
endif

#-----------------------------------------------------------------------------
-include makefiles/common.mk

.PHONY: clean_all all help
.PHONY: FORCE
FORCE:

all: basic_modem_sx128x basic_modem_lr1110 basic_modem_sx1261 basic_modem_sx1262

#-----------------------------------------------------------------------------
# Clean
#-----------------------------------------------------------------------------
clean_all:
-rm -rf $(BUILD_ROOT)

clean_sx128x:
$(MAKE) clean_target RADIO=sx128x

clean_lr1110:
$(MAKE) clean_target RADIO=lr1110

clean_sx1261:
$(MAKE) clean_target RADIO=sx1261

clean_sx1262:
$(MAKE) clean_target RADIO=sx1262

#-----------------------------------------------------------------------------
# Compilation
#-----------------------------------------------------------------------------
basic_modem_sx128x:
$(MAKE) basic_modem RADIO=sx128x $(MTHREAD_FLAG)

basic_modem_lr1110:
$(MAKE) basic_modem RADIO=lr1110 $(MTHREAD_FLAG)

basic_modem_sx1261:
$(MAKE) basic_modem RADIO=sx1261 $(MTHREAD_FLAG)

basic_modem_sx1262:
$(MAKE) basic_modem RADIO=sx1262 $(MTHREAD_FLAG)

61 changes: 61 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# LoRa Basics Modem

## LoRaWAN parameters

### LoRaWAN version

The LoRaWAN version that is currently implemented in LoRa Basics Modem is v1.0.4.

### LoRaWAN region

LoRa Basics Modem supports the following LoRaWAN regions:

* EU868
* US915
* CN470_RP_1_0

### LoRaWAN class

LoRa Basics Modem supports the following LoRaWAN classes:

* Class A
* Class C

## LoRa Basics Modem services

LoRa Basics Modem supports the following services:

* Large files upload
* ROSE Streaming
* Application-Layer Clock synchronization
* Almanac Update

## LoRa Basics Modem API

The Application Programming Interface of LoRa Basics Modem is defined in `smtc_modem_api/smtc_modem_api.h` header file.

## LoRa Basics Modem engine

LoRa Basics Modem has to be initialized first by calling `smtc_modem_init()`. Then, calling periodically `smtc_modem_run_engine()` is required to make the state machine move forward.

These functions can be found in `smtc_modem_api/smtc_modem_utilities.h`

## LoRa Basics Modem HAL

The Hardware Abstraction Layer of LoRa Basics Modem is defined in the `smtc_modem_hal/smtc_modem_hal.h` header file. Porting LoRa Basics Modem to a new architecture requires one to implement the functions described by the prototypes in it.

## Transceiver

LoRa Basics Modem supports the following transceivers:

* LR1110 with firmware 0x0307.

## Disclaimer

This software has been extensively tested when targeting LR1110 for the EU868, US915, and CN470_RP_1_0 LoRaWAN regions. For all other combinations of features this software shall be considered an Engineering Sample.

All customers wanting to leverage LoRa Basics Modem for 2.4GHz running with SX1280 transceiver must still refer to the [release v1.0.1](https://github.com/lorabasics/lorabasicsmodem/releases/tag/v1.0.1) for which Semtech provides technical customer support.

### Disclaimer for Engineering Samples

Information relating to this product and the application or design described herein is believed to be reliable, however such information is provided as a guide only and Semtech assumes no liability for any errors related to the product, documentation, or for the application or design described herein. Semtech reserves the right to make changes to the product or this document at any time without notice.
73 changes: 73 additions & 0 deletions lora_basics_modem_version.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*!
* \file lora_basics_modem_version.h
*
* \brief Defines the Lora Basics Modem firmware version
*
* Revised BSD License
* Copyright Semtech Corporation 2021. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the Semtech corporation nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL SEMTECH CORPORATION BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef LORA_BASICS_MODEM_VERSION_H__
#define LORA_BASICS_MODEM_VERSION_H__

#ifdef __cplusplus
extern "C" {
#endif

/*
* -----------------------------------------------------------------------------
* --- DEPENDENCIES ------------------------------------------------------------
*/

/*
* -----------------------------------------------------------------------------
* --- PUBLIC MACROS -----------------------------------------------------------
*/

/*
* -----------------------------------------------------------------------------
* --- PUBLIC CONSTANTS --------------------------------------------------------
*/

/*
* -----------------------------------------------------------------------------
* --- PUBLIC TYPES ------------------------------------------------------------
*/
#define LORA_BASICS_MODEM_FW_VERSION_MAJOR 2
#define LORA_BASICS_MODEM_FW_VERSION_MINOR 1
#define LORA_BASICS_MODEM_FW_VERSION_PATCH 0

/*
* -----------------------------------------------------------------------------
* --- PUBLIC FUNCTIONS PROTOTYPES ---------------------------------------------
*/

#ifdef __cplusplus
}
#endif

#endif // LORA_BASICS_MODEM_VERSION_H__

/* --- EOF ------------------------------------------------------------------ */
80 changes: 80 additions & 0 deletions makefiles/board_L476.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
##############################################################################
# Definitions for the STM32 L476 board
##############################################################################


#-----------------------------------------------------------------------------
# Compilation flags
#-----------------------------------------------------------------------------
CPU = -mcpu=cortex-m4
FPU = -mfpu=fpv4-sp-d16
FLOAT-ABI = -mfloat-abi=hard

MCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI)

BOARD_C_DEFS = \
-DUSE_HAL_DRIVER \
-DSTM32L476xx

BOARD_LDSCRIPT = user_app/mcu_drivers/core/stm32l476rgtx_flash.ld

#-----------------------------------------------------------------------------
# Hardware-specific sources
#-----------------------------------------------------------------------------
BOARD_C_SOURCES = \
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rng.c\
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c.c \
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c_ex.c \
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_lptim.c \
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rtc.c \
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rtc_ex.c \
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_spi.c \
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim.c \
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim_ex.c \
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c \
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart_ex.c \
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_wwdg.c \
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_iwdg.c \
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.c \
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc.c \
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc_ex.c \
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash.c \
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ex.c \
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ramfunc.c \
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_gpio.c \
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma.c \
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr.c \
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr_ex.c \
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.c \
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_adc.c \
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_adc_ex.c\
user_app/smtc_modem_hal/smtc_modem_hal.c\
user_app/mcu_drivers/core/system_stm32l4xx.c\
user_app/smtc_hal_l4/smtc_hal_adc.c\
user_app/smtc_hal_l4/smtc_hal_flash.c\
user_app/smtc_hal_l4/smtc_hal_gpio.c\
user_app/smtc_hal_l4/smtc_hal_mcu.c\
user_app/smtc_hal_l4/smtc_hal_rtc.c\
user_app/smtc_hal_l4/smtc_hal_rng.c\
user_app/smtc_hal_l4/smtc_hal_spi.c\
user_app/smtc_hal_l4/smtc_hal_lp_timer.c\
user_app/smtc_hal_l4/smtc_hal_trace.c\
user_app/smtc_hal_l4/smtc_hal_uart.c\
user_app/smtc_hal_l4/smtc_hal_watchdog.c

BOARD_ASM_SOURCES = \
user_app/mcu_drivers/core/startup_stm32l476xx.s

BOARD_C_INCLUDES = \
-Iuser_app/mcu_drivers/cmsis/Core/Include\
-Iuser_app/mcu_drivers/cmsis/Device/ST/STM32L4xx/Include\
-Iuser_app/mcu_drivers/STM32L4xx_HAL_Driver/Inc\
-Iuser_app/mcu_drivers/STM32L4xx_HAL_Driver/Inc/Legacy\
-Ismtc_modem_hal\
-Iuser_app\
-Iuser_app/littlefs\
-Iuser_app/mcu_drivers/core\
-Iuser_app/smtc_modem_hal\
-Iuser_app/modem_config\
-Iuser_app/smtc_hal_l4

Loading

0 comments on commit 4274349

Please sign in to comment.