Skip to content

Commit 1af11bf

Browse files
committed
Add NucleoL476RG platform support.
The SX126x development kit is based on a NucleoL476 board plus one of the mbed shields.
1 parent 24f9b2f commit 1af11bf

File tree

249 files changed

+289917
-2
lines changed

Some content is hidden

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

249 files changed

+289917
-2
lines changed

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"MODULATION":"LORA",
4545

4646
// Target board, the following boards are supported:
47-
// NAMote72, NucleoL073 (Default), NucleoL152, SAML21, SKiM880B, SKiM980A, SKiM881AXL and B-L072Z-LRWAN1.
47+
// NAMote72, NucleoL073 (Default), NucleoL152, NucleoL476, SAML21, SKiM880B, SKiM980A, SKiM881AXL and B-L072Z-LRWAN1.
4848
"BOARD":"NucleoL073",
4949

5050
// MBED Radio shield selection. (Applies only to Nucleo platforms)

Doc/NucleoLxxx-platform.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
* [NucleoL073RZ](https://os.mbed.com/platforms/ST-Nucleo-L073RZ/)
44
* [NucleoL152RE](https://os.mbed.com/platforms/ST-Nucleo-L152RE/)
5+
* [NucleoL476RG](https://os.mbed.com/platforms/ST-Nucleo-L476RG/)
56

67
The following mbed shields may be used with NucleoLxxx platforms:
78

Doc/development-environment.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ Alternatively one can use a graphical interface to configure CMake, drop down me
113113
* NAMote72
114114
* NucleoL073 (default)
115115
* NucleoL152
116+
* NucleoL476
116117
* SAML21
117118
* SKiM880B
118119
* SKiM980A

cmake/gdb-helper.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ function(generate_vscode_launch_openocd TARGET)
8282
elseif(BOARD STREQUAL NucleoL073 OR BOARD STREQUAL B-L072Z-LRWAN1)
8383
set(OPENOCD_INTERFACE stlink-v2-1.cfg)
8484
set(OPENOCD_TARGET stm32l0.cfg)
85+
elseif(BOARD STREQUAL NucleoL476)
86+
set(OPENOCD_INTERFACE stlink-v2-1.cfg)
87+
set(OPENOCD_TARGET stm32l4x.cfg)
8588
elseif(BOARD STREQUAL SKiM880B OR BOARD STREQUAL SKiM980A)
8689
set(OPENOCD_INTERFACE stlink-v2.cfg)
8790
set(OPENOCD_TARGET stm32l1.cfg)

cmake/stm32l4.cmake

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
##
2+
## ______ _
3+
## / _____) _ | |
4+
## ( (____ _____ ____ _| |_ _____ ____| |__
5+
## \____ \| ___ | (_ _) ___ |/ ___) _ \
6+
## _____) ) ____| | | || |_| ____( (___| | | |
7+
## (______/|_____)_|_|_| \__)_____)\____)_| |_|
8+
## (C)2013-2018 Semtech
9+
## ___ _____ _ ___ _ _____ ___ ___ ___ ___
10+
## / __|_ _/_\ / __| |/ / __/ _ \| _ \/ __| __|
11+
## \__ \ | |/ _ \ (__| ' <| _| (_) | / (__| _|
12+
## |___/ |_/_/ \_\___|_|\_\_| \___/|_|_\\___|___|
13+
## embedded.connectivity.solutions.==============
14+
##
15+
## License: Revised BSD License, see LICENSE.TXT file included in the project
16+
## Authors: Johannes Bruder ( STACKFORCE ), Miguel Luis ( Semtech )
17+
##
18+
##
19+
## STM32L4 target specific CMake file
20+
##
21+
22+
if(NOT DEFINED LINKER_SCRIPT)
23+
message(FATAL_ERROR "No linker script defined")
24+
endif(NOT DEFINED LINKER_SCRIPT)
25+
message("Linker script: ${LINKER_SCRIPT}")
26+
27+
28+
#---------------------------------------------------------------------------------------
29+
# Set compiler/linker flags
30+
#---------------------------------------------------------------------------------------
31+
32+
# Object build options
33+
set(OBJECT_GEN_FLAGS "-Og -g -mthumb -g2 -fno-builtin -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -Wall -Wextra -pedantic -Wno-unused-parameter -ffunction-sections -fdata-sections -fomit-frame-pointer -mabi=aapcs -fno-unroll-loops -ffast-math -ftree-vectorize")
34+
35+
set(CMAKE_C_FLAGS "${OBJECT_GEN_FLAGS} -std=gnu99 " CACHE INTERNAL "C Compiler options")
36+
set(CMAKE_CXX_FLAGS "${OBJECT_GEN_FLAGS} -std=c++11 " CACHE INTERNAL "C++ Compiler options")
37+
set(CMAKE_ASM_FLAGS "${OBJECT_GEN_FLAGS} -x assembler-with-cpp " CACHE INTERNAL "ASM Compiler options")
38+
39+
# Linker flags
40+
set(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections --specs=nano.specs --specs=nosys.specs -mthumb -g2 -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mabi=aapcs -T${LINKER_SCRIPT} -Wl,-Map=${CMAKE_PROJECT_NAME}.map" CACHE INTERNAL "Linker options")

src/CMakeLists.txt

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

2525
# Allow switching of target platform
26-
set(BOARD_LIST NAMote72 NucleoL073 NucleoL152 SAML21 SKiM880B SKiM980A SKiM881AXL B-L072Z-LRWAN1)
26+
set(BOARD_LIST NAMote72 NucleoL073 NucleoL152 NucleoL476 SAML21 SKiM880B SKiM980A SKiM881AXL B-L072Z-LRWAN1)
2727
set(BOARD NucleoL073 CACHE STRING "Default target platform is NucleoL073")
2828
set_property(CACHE BOARD PROPERTY STRINGS ${BOARD_LIST})
2929

@@ -102,6 +102,25 @@ elseif(BOARD STREQUAL NucleoL152)
102102
message(STATUS "Please specify the MBED_RADIO_SHIELD!\nPossible values are: SX1272MB2DAS, SX1276MB1LAS, SX1276MB1MAS, SX1261MBXBAS, SX1262MBXCAS and SX1262MBXDAS.")
103103
endif()
104104

105+
elseif(BOARD STREQUAL NucleoL476)
106+
# Configure toolchain for NucleoL476
107+
set(LINKER_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/boards/NucleoL476/cmsis/arm-gcc/stm32l476rgtx_flash.ld)
108+
include(stm32l4)
109+
110+
# Build platform specific board implementation
111+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/boards/NucleoL476)
112+
113+
# Configure radio
114+
if(MBED_RADIO_SHIELD STREQUAL SX1272MB2DAS)
115+
set(RADIO sx1272 CACHE INTERNAL "Radio sx1272 selected")
116+
elseif(MBED_RADIO_SHIELD STREQUAL SX1276MB1LAS OR MBED_RADIO_SHIELD STREQUAL SX1276MB1MAS)
117+
set(RADIO sx1276 CACHE INTERNAL "Radio sx1276 selected")
118+
elseif(MBED_RADIO_SHIELD STREQUAL SX1261MBXBAS OR MBED_RADIO_SHIELD STREQUAL SX1262MBXCAS OR MBED_RADIO_SHIELD STREQUAL SX1262MBXDAS)
119+
set(RADIO sx126x CACHE INTERNAL "Radio sx126x selected")
120+
else()
121+
message(STATUS "Please specify the MBED_RADIO_SHIELD!\nPossible values are: SX1272MB2DAS, SX1276MB1LAS, SX1276MB1MAS, SX1261MBXBAS, SX1262MBXCAS and SX1262MBXDAS.")
122+
endif()
123+
105124
elseif(BOARD STREQUAL SAML21)
106125
# Configure toolchain for SAML21
107126
set(LINKER_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/boards/mcu/saml21/saml21b/gcc/gcc/saml21j18b_flash.ld)
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
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+
******************************************************************************
28+
********************************** WARNING ***********************************
29+
******************************************************************************
30+
The crypto-element implementation supports both 1.0.x and 1.1.x LoRaWAN
31+
versions of the specification.
32+
Thus it has been decided to use the 1.1.x keys and EUI name definitions.
33+
The below table shows the names equivalence between versions:
34+
+-------------------+-------------------------+
35+
| 1.0.x | 1.1.x |
36+
+===================+=========================+
37+
| LORAWAN_DEVICE_EUI| LORAWAN_DEVICE_EUI |
38+
+-------------------+-------------------------+
39+
| LORAWAN_APP_EUI | LORAWAN_JOIN_EUI |
40+
+-------------------+-------------------------+
41+
| N/A | LORAWAN_APP_KEY |
42+
+-------------------+-------------------------+
43+
| LORAWAN_APP_KEY | LORAWAN_NWK_KEY |
44+
+-------------------+-------------------------+
45+
| LORAWAN_NWK_S_KEY | LORAWAN_F_NWK_S_INT_KEY |
46+
+-------------------+-------------------------+
47+
| LORAWAN_NWK_S_KEY | LORAWAN_S_NWK_S_INT_KEY |
48+
+-------------------+-------------------------+
49+
| LORAWAN_NWK_S_KEY | LORAWAN_NWK_S_ENC_KEY |
50+
+-------------------+-------------------------+
51+
| LORAWAN_APP_S_KEY | LORAWAN_APP_S_KEY |
52+
+-------------------+-------------------------+
53+
******************************************************************************
54+
******************************************************************************
55+
******************************************************************************
56+
*/
57+
58+
/*!
59+
* When set to 1 the application uses the Over-the-Air activation procedure
60+
* When set to 0 the application uses the Personalization activation procedure
61+
*/
62+
#define OVER_THE_AIR_ACTIVATION 0
63+
64+
/*!
65+
* When using ABP activation the MAC layer must know in advance to which server
66+
* version it will be connected.
67+
*/
68+
#define ABP_ACTIVATION_LRWAN_VERSION_V10x 0x01000300 // 1.0.3.0
69+
70+
#define ABP_ACTIVATION_LRWAN_VERSION ABP_ACTIVATION_LRWAN_VERSION_V10x
71+
72+
/*!
73+
* Indicates if the end-device is to be connected to a private or public network
74+
*/
75+
#define LORAWAN_PUBLIC_NETWORK true
76+
77+
/*!
78+
* IEEE Organizationally Unique Identifier ( OUI ) (big endian)
79+
* \remark This is unique to a company or organization
80+
*/
81+
#define IEEE_OUI 0x00, 0x00, 0x00
82+
83+
/*!
84+
* Mote device IEEE EUI (big endian)
85+
*
86+
* \remark In this application the value is automatically generated by calling
87+
* BoardGetUniqueId function
88+
*/
89+
#define LORAWAN_DEVICE_EUI { IEEE_OUI, 0x00, 0x00, 0x00, 0x00, 0x00 }
90+
91+
/*!
92+
* App/Join server IEEE EUI (big endian)
93+
*/
94+
#define LORAWAN_JOIN_EUI { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
95+
96+
/*!
97+
* Application root key
98+
* WARNING: NOT USED FOR 1.0.x DEVICES
99+
*/
100+
#define LORAWAN_APP_KEY { 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C }
101+
102+
/*!
103+
* Network root key
104+
* WARNING: FOR 1.0.x DEVICES IT IS THE \ref LORAWAN_APP_KEY
105+
*/
106+
#define LORAWAN_NWK_KEY { 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C }
107+
108+
/*!
109+
* Current network ID
110+
*/
111+
#define LORAWAN_NETWORK_ID ( uint32_t )0
112+
113+
/*!
114+
* Device address on the network (big endian)
115+
*
116+
* \remark In this application the value is automatically generated using
117+
* a pseudo random generator seeded with a value derived from
118+
* BoardUniqueId value if LORAWAN_DEVICE_ADDRESS is set to 0
119+
*/
120+
#define LORAWAN_DEVICE_ADDRESS ( uint32_t )0x00000000
121+
122+
/*!
123+
* Forwarding Network session integrity key
124+
* WARNING: NWK_S_KEY FOR 1.0.x DEVICES
125+
*/
126+
#define LORAWAN_F_NWK_S_INT_KEY { 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C }
127+
128+
/*!
129+
* Serving Network session integrity key
130+
* WARNING: NOT USED FOR 1.0.x DEVICES. MUST BE THE SAME AS \ref LORAWAN_F_NWK_S_INT_KEY
131+
*/
132+
#define LORAWAN_S_NWK_S_INT_KEY { 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C }
133+
134+
/*!
135+
* Network session encryption key
136+
* WARNING: NOT USED FOR 1.0.x DEVICES. MUST BE THE SAME AS \ref LORAWAN_F_NWK_S_INT_KEY
137+
*/
138+
#define LORAWAN_NWK_S_ENC_KEY { 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C }
139+
140+
/*!
141+
* Application session key
142+
*/
143+
#define LORAWAN_APP_S_KEY { 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C }
144+
145+
#endif // __LORA_COMMISSIONING_H__

0 commit comments

Comments
 (0)