Skip to content

Commit 4274349

Browse files
author
mantoine
committed
Release v2.1.0
0 parents  commit 4274349

File tree

221 files changed

+82912
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

221 files changed

+82912
-0
lines changed

Makefile

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
##############################################################################
2+
# Main makefile for basic_modem
3+
##############################################################################
4+
5+
-include makefiles/printing.mk
6+
7+
#-----------------------------------------------------------------------------
8+
# Global configuration options
9+
#-----------------------------------------------------------------------------
10+
# Prefix for all build directories
11+
BUILD_ROOT = build
12+
13+
# Prefix for all binaries names
14+
TARGET_ROOT = basic_modem
15+
16+
BYPASS=no
17+
18+
PERF_TEST=no
19+
20+
# Crypto management
21+
CRYPTO ?= SOFT
22+
23+
# For LR1110 tranceiver
24+
# - CHINA_DEMO -> Use Regional Parameters 1.0
25+
# - HYBRID_CHINA -> RP 1.0, single channel
26+
CHINA_DEMO ?= no
27+
HYBRID_CHINA ?= no
28+
29+
ifeq ($(HYBRID_CHINA),yes)
30+
CHINA_DEMO = yes
31+
endif
32+
33+
# Compile with coverage analysis support
34+
COVERAGE ?= no
35+
36+
# Use multithreaded build (make -j)
37+
MULTITHREAD ?= yes
38+
39+
# Print each object file size
40+
SIZE ?= no
41+
42+
# Save memory usage to log file
43+
LOG_MEM ?= yes
44+
45+
# Tranceiver
46+
RADIO ?= nc
47+
48+
# Trace prints
49+
MODEM_TRACE ?= yes
50+
51+
# GNSS
52+
USE_GNSS ?= yes
53+
54+
55+
56+
ifeq ($(MODEM_APP),EXAMPLE_LR1110_DEMO)
57+
override USE_GNSS = yes
58+
endif
59+
60+
61+
#-----------------------------------------------------------------------------
62+
# default action: print help
63+
#-----------------------------------------------------------------------------
64+
help:
65+
$(call echo_help_b, "Available TARGETs: sx128x lr1110 sx1261 sx1262")
66+
$(call echo_help, "")
67+
$(call echo_help_b, "-------------------------------- Clean -------------------------------------")
68+
$(call echo_help, " * make clean_<TARGET> : clean basic_modem for a given target")
69+
$(call echo_help, " * make clean_all : clean all")
70+
$(call echo_help, "")
71+
$(call echo_help_b, "----------------------------- Compilation ----------------------------------")
72+
$(call echo_help, " * make basic_modem_<TARGET> : build basic_modem on a given target")
73+
$(call echo_help, " * make all : build all targets")
74+
$(call echo_help, "")
75+
$(call echo_help_b, "---------------------- Optional build parameters ---------------------------")
76+
$(call echo_help, " * REGION=xxx : choose which region should be compiled (default: all)")
77+
$(call echo_help, " * Combinations also work (i.e. REGION=EU_868,US_915 )")
78+
$(call echo_help, " * - AS_923")
79+
$(call echo_help, " * - AU_915")
80+
$(call echo_help, " * - CN_470")
81+
$(call echo_help, " * - CN_470_RP_1_0")
82+
$(call echo_help, " * - EU_868")
83+
$(call echo_help, " * - IN_865")
84+
$(call echo_help, " * - KR_920")
85+
$(call echo_help, " * - RU_864")
86+
$(call echo_help, " * - US_915")
87+
$(call echo_help, " * CRYPTO=xxx : choose which crypto should be compiled (default: SOFT)")
88+
$(call echo_help, " * - SOFT")
89+
$(call echo_help, " * - LR1110 (only for lr1110 target)")
90+
$(call echo_help, " * - LR1110_WITH_CREDENTIALS (only for lr1110 target)")
91+
$(call echo_help, " * MODEM_TRACE=yes/no : choose to enable or disable modem trace print (default: trace is ON)")
92+
$(call echo_help, " * HYBRID_CHINA=yes : only for lr1110 target: build hybrid china with monochannel region")
93+
$(call echo_help, " * CHINA_DEMO=yes : only for lr1110 target: build with full China RP_1_0 region")
94+
$(call echo_help, " * USE_GNSS=yes/no : only for lr1110 target: choose to enable or disable use of gnss (default: gnss is ON)")
95+
$(call echo_help, " * BYPASS=yes : build target using lorawan bypass")
96+
$(call echo_help_b, "-------------------- Optional makefile parameters --------------------------")
97+
$(call echo_help, " * MULTITHREAD=no : Disable multithreaded build")
98+
$(call echo_help, " * COVERAGE=xxx : build target with coverage instrumentation for specific subsystems:")
99+
$(call echo_help, " * - RADIO")
100+
$(call echo_help, " * - MODEM")
101+
$(call echo_help, " * VERBOSE=yes : Increase build verbosity")
102+
$(call echo_help, " * SIZE=yes : Display size for all objects")
103+
104+
105+
106+
#-----------------------------------------------------------------------------
107+
# Makefile include selection
108+
#-----------------------------------------------------------------------------
109+
ifeq ($(RADIO),lr1110)
110+
-include makefiles/lr1110.mk
111+
endif
112+
113+
ifeq ($(RADIO),sx1261)
114+
-include makefiles/sx126x.mk
115+
endif
116+
117+
ifeq ($(RADIO),sx1262)
118+
-include makefiles/sx126x.mk
119+
endif
120+
121+
ifeq ($(RADIO),sx128x)
122+
-include makefiles/sx128x.mk
123+
endif
124+
125+
#-----------------------------------------------------------------------------
126+
-include makefiles/common.mk
127+
128+
.PHONY: clean_all all help
129+
.PHONY: FORCE
130+
FORCE:
131+
132+
all: basic_modem_sx128x basic_modem_lr1110 basic_modem_sx1261 basic_modem_sx1262
133+
134+
#-----------------------------------------------------------------------------
135+
# Clean
136+
#-----------------------------------------------------------------------------
137+
clean_all:
138+
-rm -rf $(BUILD_ROOT)
139+
140+
clean_sx128x:
141+
$(MAKE) clean_target RADIO=sx128x
142+
143+
clean_lr1110:
144+
$(MAKE) clean_target RADIO=lr1110
145+
146+
clean_sx1261:
147+
$(MAKE) clean_target RADIO=sx1261
148+
149+
clean_sx1262:
150+
$(MAKE) clean_target RADIO=sx1262
151+
152+
#-----------------------------------------------------------------------------
153+
# Compilation
154+
#-----------------------------------------------------------------------------
155+
basic_modem_sx128x:
156+
$(MAKE) basic_modem RADIO=sx128x $(MTHREAD_FLAG)
157+
158+
basic_modem_lr1110:
159+
$(MAKE) basic_modem RADIO=lr1110 $(MTHREAD_FLAG)
160+
161+
basic_modem_sx1261:
162+
$(MAKE) basic_modem RADIO=sx1261 $(MTHREAD_FLAG)
163+
164+
basic_modem_sx1262:
165+
$(MAKE) basic_modem RADIO=sx1262 $(MTHREAD_FLAG)
166+

README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# LoRa Basics Modem
2+
3+
## LoRaWAN parameters
4+
5+
### LoRaWAN version
6+
7+
The LoRaWAN version that is currently implemented in LoRa Basics Modem is v1.0.4.
8+
9+
### LoRaWAN region
10+
11+
LoRa Basics Modem supports the following LoRaWAN regions:
12+
13+
* EU868
14+
* US915
15+
* CN470_RP_1_0
16+
17+
### LoRaWAN class
18+
19+
LoRa Basics Modem supports the following LoRaWAN classes:
20+
21+
* Class A
22+
* Class C
23+
24+
## LoRa Basics Modem services
25+
26+
LoRa Basics Modem supports the following services:
27+
28+
* Large files upload
29+
* ROSE Streaming
30+
* Application-Layer Clock synchronization
31+
* Almanac Update
32+
33+
## LoRa Basics Modem API
34+
35+
The Application Programming Interface of LoRa Basics Modem is defined in `smtc_modem_api/smtc_modem_api.h` header file.
36+
37+
## LoRa Basics Modem engine
38+
39+
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.
40+
41+
These functions can be found in `smtc_modem_api/smtc_modem_utilities.h`
42+
43+
## LoRa Basics Modem HAL
44+
45+
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.
46+
47+
## Transceiver
48+
49+
LoRa Basics Modem supports the following transceivers:
50+
51+
* LR1110 with firmware 0x0307.
52+
53+
## Disclaimer
54+
55+
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.
56+
57+
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.
58+
59+
### Disclaimer for Engineering Samples
60+
61+
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.

lora_basics_modem_version.h

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/*!
2+
* \file lora_basics_modem_version.h
3+
*
4+
* \brief Defines the Lora Basics Modem firmware version
5+
*
6+
* Revised BSD License
7+
* Copyright Semtech Corporation 2021. All rights reserved.
8+
*
9+
* Redistribution and use in source and binary forms, with or without
10+
* modification, are permitted provided that the following conditions are met:
11+
* * Redistributions of source code must retain the above copyright
12+
* notice, this list of conditions and the following disclaimer.
13+
* * Redistributions in binary form must reproduce the above copyright
14+
* notice, this list of conditions and the following disclaimer in the
15+
* documentation and/or other materials provided with the distribution.
16+
* * Neither the name of the Semtech corporation nor the
17+
* names of its contributors may be used to endorse or promote products
18+
* derived from this software without specific prior written permission.
19+
*
20+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23+
* ARE DISCLAIMED. IN NO EVENT SHALL SEMTECH CORPORATION BE LIABLE FOR ANY
24+
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
27+
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30+
*/
31+
32+
#ifndef LORA_BASICS_MODEM_VERSION_H__
33+
#define LORA_BASICS_MODEM_VERSION_H__
34+
35+
#ifdef __cplusplus
36+
extern "C" {
37+
#endif
38+
39+
/*
40+
* -----------------------------------------------------------------------------
41+
* --- DEPENDENCIES ------------------------------------------------------------
42+
*/
43+
44+
/*
45+
* -----------------------------------------------------------------------------
46+
* --- PUBLIC MACROS -----------------------------------------------------------
47+
*/
48+
49+
/*
50+
* -----------------------------------------------------------------------------
51+
* --- PUBLIC CONSTANTS --------------------------------------------------------
52+
*/
53+
54+
/*
55+
* -----------------------------------------------------------------------------
56+
* --- PUBLIC TYPES ------------------------------------------------------------
57+
*/
58+
#define LORA_BASICS_MODEM_FW_VERSION_MAJOR 2
59+
#define LORA_BASICS_MODEM_FW_VERSION_MINOR 1
60+
#define LORA_BASICS_MODEM_FW_VERSION_PATCH 0
61+
62+
/*
63+
* -----------------------------------------------------------------------------
64+
* --- PUBLIC FUNCTIONS PROTOTYPES ---------------------------------------------
65+
*/
66+
67+
#ifdef __cplusplus
68+
}
69+
#endif
70+
71+
#endif // LORA_BASICS_MODEM_VERSION_H__
72+
73+
/* --- EOF ------------------------------------------------------------------ */

makefiles/board_L476.mk

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
##############################################################################
2+
# Definitions for the STM32 L476 board
3+
##############################################################################
4+
5+
6+
#-----------------------------------------------------------------------------
7+
# Compilation flags
8+
#-----------------------------------------------------------------------------
9+
CPU = -mcpu=cortex-m4
10+
FPU = -mfpu=fpv4-sp-d16
11+
FLOAT-ABI = -mfloat-abi=hard
12+
13+
MCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI)
14+
15+
BOARD_C_DEFS = \
16+
-DUSE_HAL_DRIVER \
17+
-DSTM32L476xx
18+
19+
BOARD_LDSCRIPT = user_app/mcu_drivers/core/stm32l476rgtx_flash.ld
20+
21+
#-----------------------------------------------------------------------------
22+
# Hardware-specific sources
23+
#-----------------------------------------------------------------------------
24+
BOARD_C_SOURCES = \
25+
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rng.c\
26+
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c.c \
27+
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c_ex.c \
28+
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_lptim.c \
29+
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rtc.c \
30+
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rtc_ex.c \
31+
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_spi.c \
32+
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim.c \
33+
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim_ex.c \
34+
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c \
35+
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart_ex.c \
36+
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_wwdg.c \
37+
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_iwdg.c \
38+
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.c \
39+
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc.c \
40+
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc_ex.c \
41+
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash.c \
42+
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ex.c \
43+
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ramfunc.c \
44+
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_gpio.c \
45+
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma.c \
46+
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr.c \
47+
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr_ex.c \
48+
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.c \
49+
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_adc.c \
50+
user_app/mcu_drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_adc_ex.c\
51+
user_app/smtc_modem_hal/smtc_modem_hal.c\
52+
user_app/mcu_drivers/core/system_stm32l4xx.c\
53+
user_app/smtc_hal_l4/smtc_hal_adc.c\
54+
user_app/smtc_hal_l4/smtc_hal_flash.c\
55+
user_app/smtc_hal_l4/smtc_hal_gpio.c\
56+
user_app/smtc_hal_l4/smtc_hal_mcu.c\
57+
user_app/smtc_hal_l4/smtc_hal_rtc.c\
58+
user_app/smtc_hal_l4/smtc_hal_rng.c\
59+
user_app/smtc_hal_l4/smtc_hal_spi.c\
60+
user_app/smtc_hal_l4/smtc_hal_lp_timer.c\
61+
user_app/smtc_hal_l4/smtc_hal_trace.c\
62+
user_app/smtc_hal_l4/smtc_hal_uart.c\
63+
user_app/smtc_hal_l4/smtc_hal_watchdog.c
64+
65+
BOARD_ASM_SOURCES = \
66+
user_app/mcu_drivers/core/startup_stm32l476xx.s
67+
68+
BOARD_C_INCLUDES = \
69+
-Iuser_app/mcu_drivers/cmsis/Core/Include\
70+
-Iuser_app/mcu_drivers/cmsis/Device/ST/STM32L4xx/Include\
71+
-Iuser_app/mcu_drivers/STM32L4xx_HAL_Driver/Inc\
72+
-Iuser_app/mcu_drivers/STM32L4xx_HAL_Driver/Inc/Legacy\
73+
-Ismtc_modem_hal\
74+
-Iuser_app\
75+
-Iuser_app/littlefs\
76+
-Iuser_app/mcu_drivers/core\
77+
-Iuser_app/smtc_modem_hal\
78+
-Iuser_app/modem_config\
79+
-Iuser_app/smtc_hal_l4
80+

0 commit comments

Comments
 (0)