Skip to content

Commit 94ac529

Browse files
committed
Added SX126x radio support.
Added NucleoL073 and NucleoL152 board platforms support.
1 parent b532a2b commit 94ac529

File tree

89 files changed

+39790
-28
lines changed

Some content is hidden

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

89 files changed

+39790
-28
lines changed

.vscode/settings.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,14 @@
4141
"MODULATION":"LORA",
4242

4343
// Target board, the following boards are supported:
44-
// LoRaMote (Default), MoteII, NAMote72, SAML21, SensorNode and SK-iM880A.
44+
// LoRaMote (Default), MoteII, NAMote72, NucleoL073, NucleoL152, SAML21, SensorNode and SK-iM880A.
4545
"BOARD":"LoRaMote",
4646

47+
// MBED Radio shield selection. (Applies only to Nucleo platforms)
48+
// The following shields are supported:
49+
// SX1272MB2DAS, SX1276MB1LAS, SX1276MB1MAS, SX1261DVK1BAS(Default), SX1262DVK1CAS, SX1262DVK1DAS.
50+
"MBED_RADIO_SHIELD":"SX1261DVK1BAS",
51+
4752
// Region support activation, Select the ones you want to support.
4853
// By default only REGION_EU868 support is enabled.
4954
"REGION_EU868":"ON",

Doc/sx1261dvk1bas-e406v03a.pdf

1.28 MB
Binary file not shown.

Doc/sx1262dvk1cas-e428v03a.pdf

1.94 MB
Binary file not shown.

Doc/sx1262dvk1das-e449v01a.pdf

2.01 MB
Binary file not shown.

Doc/sx1272mb2das-e364v02a.pdf

165 KB
Binary file not shown.

Doc/sx1276mb1las-e311v02a.pdf

170 KB
Binary file not shown.

Doc/sx1276mb1mas-e315v01a.pdf

169 KB
Binary file not shown.

cmake/gdb-helper.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ function(generate_vscode_launch_openocd TARGET)
7979
if(BOARD STREQUAL LoRaMote OR BOARD STREQUAL SensorNode OR BOARD STREQUAL SK-iM880A)
8080
set(OPENOCD_INTERFACE stlink-v2.cfg)
8181
set(OPENOCD_TARGET stm32l1.cfg)
82-
elseif(BOARD STREQUAL NAMote72)
82+
elseif(BOARD STREQUAL NAMote72 OR BOARD STREQUAL NucleoL152)
8383
set(OPENOCD_INTERFACE stlink-v2-1.cfg)
8484
set(OPENOCD_TARGET stm32l1.cfg)
85-
elseif(BOARD STREQUAL MoteII)
85+
elseif(BOARD STREQUAL MoteII OR BOARD STREQUAL NucleoL073)
8686
set(OPENOCD_INTERFACE stlink-v2-1.cfg)
8787
set(OPENOCD_TARGET stm32l0.cfg)
8888
elseif(BOARD STREQUAL SAML21)

src/CMakeLists.txt

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,15 @@ cmake_minimum_required(VERSION 3.6)
2323
#---------------------------------------------------------------------------------------
2424

2525
# Allow switching of target platform
26-
set(BOARD_LIST LoRaMote MoteII NAMote72 SensorNode SK-iM880A SAML21)
26+
set(BOARD_LIST LoRaMote MoteII NAMote72 SensorNode SK-iM880A NucleoL073 NucleoL152 SAML21)
2727
set(BOARD LoRaMote CACHE STRING "Default target platform is LoRaMote")
2828
set_property(CACHE BOARD PROPERTY STRINGS ${BOARD_LIST})
2929

30+
# Allow switching of MBED shields
31+
set(MBED_RADIO_SHIELD_LIST SX1272MB2DAS SX1276MB1LAS SX1276MB1MAS SX1261DVK1BAS SX1262DVK1CAS SX1262DVK1DAS )
32+
set(MBED_RADIO_SHIELD SX1261DVK1BAS CACHE STRING "Default MBED radio shield is SX1261DVK1BAS")
33+
set_property(CACHE MBED_RADIO_SHIELD PROPERTY STRINGS ${MBED_RADIO_SHIELD_LIST})
34+
3035
# Allow switching of Applications
3136
set(APPLICATION_LIST LoRaMac ping-pong rx-sensi tx-cw BootLoader)
3237
set(APPLICATION LoRaMac CACHE STRING "Default Application is LoRaMac")
@@ -113,6 +118,44 @@ elseif(BOARD STREQUAL NAMote72)
113118
# Configure radio
114119
set(RADIO sx1272 CACHE INTERNAL "Radio sx1272 selected")
115120

121+
elseif(BOARD STREQUAL NucleoL073)
122+
# Configure toolchain for NucleoL073
123+
set(LINKER_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/boards/NucleoL073/cmsis/arm-gcc/stm32l073xx_flash.ld)
124+
include(stm32l0)
125+
126+
# Build platform specific board implementation
127+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/boards/NucleoL073)
128+
129+
# Configure radio
130+
if(MBED_RADIO_SHIELD STREQUAL SX1272MB2DAS)
131+
set(RADIO sx1272 CACHE INTERNAL "Radio sx1272 selected")
132+
elseif(MBED_RADIO_SHIELD STREQUAL SX1276MB1LAS OR MBED_RADIO_SHIELD STREQUAL SX1276MB1MAS)
133+
set(RADIO sx1276 CACHE INTERNAL "Radio sx1276 selected")
134+
elseif(MBED_RADIO_SHIELD STREQUAL SX1261DVK1BAS OR MBED_RADIO_SHIELD STREQUAL SX1262DVK1CAS OR MBED_RADIO_SHIELD STREQUAL SX1262DVK1DAS)
135+
set(RADIO sx126x CACHE INTERNAL "Radio sx126x selected")
136+
else()
137+
message(STATUS "Please specify the MBED_RADIO_SHIELD!\nPossible values are: SX1272MB2DAS, SX1276MB1LAS, SX1276MB1MAS, SX1261DVK1BAS, SX1262DVK1CAS and SX1262DVK1DAS.")
138+
endif()
139+
140+
elseif(BOARD STREQUAL NucleoL152)
141+
# Configure toolchain for NucleoL152
142+
set(LINKER_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/boards/NucleoL152/cmsis/arm-gcc/stm32l152xe_flash.ld)
143+
include(stm32l1)
144+
145+
# Build platform specific board implementation
146+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/boards/NucleoL152)
147+
148+
# Configure radio
149+
if(MBED_RADIO_SHIELD STREQUAL SX1272MB2DAS)
150+
set(RADIO sx1272 CACHE INTERNAL "Radio sx1272 selected")
151+
elseif(MBED_RADIO_SHIELD STREQUAL SX1276MB1LAS OR MBED_RADIO_SHIELD STREQUAL SX1276MB1MAS)
152+
set(RADIO sx1276 CACHE INTERNAL "Radio sx1276 selected")
153+
elseif(MBED_RADIO_SHIELD STREQUAL SX1261DVK1BAS OR MBED_RADIO_SHIELD STREQUAL SX1262DVK1CAS OR MBED_RADIO_SHIELD STREQUAL SX1262DVK1DAS)
154+
set(RADIO sx126x CACHE INTERNAL "Radio sx126x selected")
155+
else()
156+
message(STATUS "Please specify the MBED_RADIO_SHIELD!\nPossible values are: SX1272MB2DAS, SX1276MB1LAS, SX1276MB1MAS, SX1261DVK1BAS, SX1262DVK1CAS and SX1262DVK1DAS.")
157+
endif()
158+
116159
elseif(BOARD STREQUAL SAML21)
117160
# Configure toolchain for SAML21
118161
set(LINKER_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/boards/mcu/saml21/saml21b/gcc/gcc/saml21j18b_flash.ld)
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/*!
2+
* \file Commissioning.h
3+
*
4+
* \brief End device commissioning parameters
5+
*
6+
* \copyright Revised BSD License, see section \ref LICENSE.
7+
*
8+
* \code
9+
* ______ _
10+
* / _____) _ | |
11+
* ( (____ _____ ____ _| |_ _____ ____| |__
12+
* \____ \| ___ | (_ _) ___ |/ ___) _ \
13+
* _____) ) ____| | | || |_| ____( (___| | | |
14+
* (______/|_____)_|_|_| \__)_____)\____)_| |_|
15+
* (C)2013-2017 Semtech
16+
*
17+
* \endcode
18+
*
19+
* \author Miguel Luis ( Semtech )
20+
*
21+
* \author Gregory Cristian ( Semtech )
22+
*/
23+
#ifndef __LORA_COMMISSIONING_H__
24+
#define __LORA_COMMISSIONING_H__
25+
26+
/*!
27+
* When set to 1 the application uses the Over-the-Air activation procedure
28+
* When set to 0 the application uses the Personalization activation procedure
29+
*/
30+
#define OVER_THE_AIR_ACTIVATION 0
31+
32+
/*!
33+
* Indicates if the end-device is to be connected to a private or public network
34+
*/
35+
#define LORAWAN_PUBLIC_NETWORK true
36+
37+
/*!
38+
* IEEE Organizationally Unique Identifier ( OUI ) (big endian)
39+
* \remark This is unique to a company or organization
40+
*/
41+
#define IEEE_OUI 0x00, 0x00, 0x00
42+
43+
/*!
44+
* Mote device IEEE EUI (big endian)
45+
*
46+
* \remark In this application the value is automatically generated by calling
47+
* BoardGetUniqueId function
48+
*/
49+
#define LORAWAN_DEVICE_EUI { IEEE_OUI, 0x00, 0x00, 0x00, 0x00, 0x00 }
50+
51+
/*!
52+
* Application IEEE EUI (big endian)
53+
*/
54+
#define LORAWAN_APPLICATION_EUI { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
55+
56+
/*!
57+
* AES encryption/decryption cipher application key
58+
*/
59+
#define LORAWAN_APPLICATION_KEY { 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C }
60+
61+
/*!
62+
* Current network ID
63+
*/
64+
#define LORAWAN_NETWORK_ID ( uint32_t )0
65+
66+
/*!
67+
* Device address on the network (big endian)
68+
*
69+
* \remark In this application the value is automatically generated using
70+
* a pseudo random generator seeded with a value derived from
71+
* BoardUniqueId value if LORAWAN_DEVICE_ADDRESS is set to 0
72+
*/
73+
#define LORAWAN_DEVICE_ADDRESS ( uint32_t )0x00000000
74+
75+
/*!
76+
* AES encryption/decryption cipher network session key
77+
*/
78+
#define LORAWAN_NWKSKEY { 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C }
79+
80+
/*!
81+
* AES encryption/decryption cipher application session key
82+
*/
83+
#define LORAWAN_APPSKEY { 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C }
84+
85+
#endif // __LORA_COMMISSIONING_H__

0 commit comments

Comments
 (0)