Skip to content

Commit 1cdd9cc

Browse files
author
Daniel Jaeckle
committed
Merge branch 'release/v4.4.1'
2 parents f42be67 + fad2ebf commit 1cdd9cc

File tree

752 files changed

+227126
-256629
lines changed

Some content is hidden

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

752 files changed

+227126
-256629
lines changed

.gitignore

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
lst/
22
obj/
33
bin/
4+
build/
5+
tmp/
6+
*.bin
7+
.kdev4
8+
*.log
49
*.dep
510
*.uvgui.*
611
*.uvgui_*.bak
@@ -16,4 +21,7 @@ bin/
1621
*.svn
1722
*.pbxproj
1823
*.cogui
19-
*.comarker
24+
*.comarker
25+
.directory
26+
launch.json
27+
.cmaketools.json

.vscode/settings.json

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
// Place your settings in this file to overwrite default and user settings.
2+
{
3+
"cmake.configureSettings": {
4+
5+
// In case your GNU ARM-Toolchain is not installed under the default
6+
// path:
7+
// Windows : No default path. Specify the path where the
8+
// toolchain is installed. i.e:
9+
// "C:/PROGRA~2/GNUTOO~1/62017-~2".
10+
// Linux : /usr
11+
// OSX : /usr/local
12+
// It is required to uncomment and to fill the following line.
13+
//"TOOLCHAIN_PREFIX":"/path/to/toolchain",
14+
15+
// In case your OpenOCD is not installed under the default path:
16+
// Windows : C:/openocd/bin/openocd.exe
17+
// Linux : /usr/bin/openocd
18+
// OSX : /usr/local/bin/openocd
19+
// Please uncomment the following line and fill it accordingly.
20+
//"OPENOCD_BIN":"C:/openocd/bin/openocd.exe",
21+
22+
// Specifies the path to the CMAKE toolchain file.
23+
"CMAKE_TOOLCHAIN_FILE":"cmake/toolchain-arm-none-eabi.cmake",
24+
25+
// Determines the application. You can choose between:
26+
// LoRaMac (Default), ping-pong, rx-sensi, tx-cw and BootLoader.
27+
"APPLICATION":"LoRaMac",
28+
29+
// Select LoRaMac sub project. You can choose between:
30+
// classA, classB or classC.
31+
"CLASS":"classA",
32+
33+
// Select the active region for which the stack will be initialized.
34+
// You can choose between:
35+
// LORAMAC_REGION_EU868, LORAMAC_REGION_US915, ..
36+
"ACTIVE_REGION":"LORAMAC_REGION_EU868",
37+
38+
// Select the type of modulation, applicable to the ping-pong or
39+
// rx-sensi applications. You can choose between:
40+
// LORA or FSK
41+
"MODULATION":"LORA",
42+
43+
// Target board, the following boards are supported:
44+
// LoRaMote (Default), MoteII, NAMote72, NucleoL073, NucleoL152, SAML21, SensorNode and SK-iM880A.
45+
"BOARD":"LoRaMote",
46+
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+
52+
// Region support activation, Select the ones you want to support.
53+
// By default only REGION_EU868 support is enabled.
54+
"REGION_EU868":"ON",
55+
"REGION_US915":"OFF",
56+
"REGION_CN779":"OFF",
57+
"REGION_EU433":"OFF",
58+
"REGION_AU915":"OFF",
59+
"REGION_AS923":"OFF",
60+
"REGION_CN470":"OFF",
61+
"REGION_KR920":"OFF",
62+
"REGION_IN865":"OFF",
63+
"REGION_US915_HYBRID":"OFF"
64+
}
65+
}

CMakeLists.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
##
2+
## ______ _
3+
## / _____) _ | |
4+
## ( (____ _____ ____ _| |_ _____ ____| |__
5+
## \____ \| ___ | (_ _) ___ |/ ___) _ \
6+
## _____) ) ____| | | || |_| ____( (___| | | |
7+
## (______/|_____)_|_|_| \__)_____)\____)_| |_|
8+
## (C)2013-2017 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+
cmake_minimum_required(VERSION 3.6)
19+
20+
21+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src)

Doc/SAML21-platform.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# SAML21 platform support documents
2+
3+
The supported SAML21 platform is composed of 2 elements:
4+
1. SAML21-XPRO-B [User Guide](http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-42405-SAML21-Xplained-Pro_User-Guide.pdf)
5+
2. SX1276 "Wing Board" [Schematic](SX1276-Wing-Board-(03-91016-RA).pdf)
6+
7+
The SAM L21 family data sheet can be found at [SAM L21 Family Data Sheet](http://www.microchip.com/mymicrochip/filehandler.aspx?ddocname=en590687)
8+
9+
Other useful resources can be found at http://www.microchip.com/ATSAML21-XPRO-B
272 KB
Binary file not shown.

Doc/development-environment.md

Lines changed: 264 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,264 @@
1+
# Introduction
2+
3+
This project uses CMake and the GNU ARM-Toolchain as build system and GDB/OpenOCD are used for debugging purposes.
4+
5+
By using these tools the development environment is platform agnostic and independent of chip manufacturer specific Integrated Development Environments.
6+
It allows to build the project either by using a command line terminal or by using IDE's like [VSCode](#vscode) or [KDevelop](#kdevelop).
7+
8+
# Prerequisites
9+
10+
* CMake >= 3.6
11+
* GNU/Linux:
12+
* Ubuntu 16.04/ Linux Mint 18: Since the official repository version is too old, one can use e.g. [PPA](https://launchpad.net/~adrozdoff/+archive/ubuntu/cmake)
13+
* Linux Arch: `pacman -S cmake`
14+
* Windows:
15+
* [CMake Download](https://cmake.org/download/)
16+
**Note**: Please ensure that CMake path is added to the system PATH variable.
17+
* OSX:
18+
* Homebrew: `brew install cmake`
19+
* GNU ARM-Toolchain
20+
* GNU/Linux:
21+
* Ubuntu 16.04/ Linux Mint 18: Since the official repository version is too old, one can use e.g. [PPA](https://launchpad.net/~team-gcc-arm-embedded/+archive/ubuntu/ppa)
22+
* Linux Arch: `pacman -S arm-none-eabi-gcc arm-none-eabi-newlib`
23+
* Windows:
24+
* [GNU Arm Embedded Toolchain](https://developer.arm.com/open-source/gnu-toolchain/gnu-rm)
25+
* The Make utility is also required, one can use e.g. [MSYS2](http://www.msys2.org)
26+
**Note**: Please ensure that both paths are added to the system PATH variable.
27+
* OSX:
28+
* Homebrew: `brew tap ARMmbed/homebrew-formulae && brew install arm-none-eabi-gcc`
29+
* OpenOCD
30+
* GNU/Linux:
31+
* Ubuntu 16.04/ Linux Mint 18: `apt-get install openocd`
32+
* Linux Arch: `pacman -S openocd`
33+
* Windows:
34+
* Unofficial binary packages are available [here](http://openocd.org/getting-openocd/) for download
35+
**Note**: The debug configuration for [VSCode](#vscode) will assume that OpenOCD is installed under `C:/openocd`. If it is not the case one must change the `OPENOCD_BIN` variable according to right location.
36+
* OSX:
37+
* Homebrew: `brew install openocd`
38+
39+
# Commandline build instructions
40+
41+
1. Go to root directory of the project
42+
43+
`cd path/to/project/directory`
44+
45+
2. Create a directory named 'build'
46+
47+
`mkdir build`
48+
49+
3. Go to the created `build` directory
50+
51+
`cd build`
52+
53+
4. run
54+
55+
`cmake -DCMAKE_TOOLCHAIN_FILE="cmake/toolchain-arm-none-eabi.cmake" ..`
56+
57+
**Note**: If the GNU ARM-Toolchain is not installed under the default path (GNU Linux:`/usr`, Mac OS `/usr/local`) a prefix has to be provided:
58+
`cmake -DCMAKE_TOOLCHAIN_FILE="cmake/toolchain-arm-none-eabi.cmake" -DTOOLCHAIN_PREFIX="/path/to/the/toolchain" ..`
59+
For Windows platforms the prefix has to be provided anyway and additionally the CMake Generator for MinGW Makefiles has to be chosen:
60+
`cmake -DCMAKE_TOOLCHAIN_FILE="cmake/toolchain-arm-none-eabi.cmake" -DTOOLCHAIN_PREFIX="/path/to/the/toolchain" -G "MinGW Makefiles" ..`
61+
62+
## Available configuration options for CMake
63+
64+
The possibility to choose the application, target board and more options can be done using the provided configuration options.
65+
66+
These configuration options can be set through additional commandline parameters, for example:
67+
`cmake -DCMAKE_TOOLCHAIN_FILE="cmake/toolchain-arm-none-eabi.cmake" -DAPPLICATION="LoRaMac" -DCLASS="classC" ..`
68+
69+
Alternatively one can use a graphical interface to configure CMake, drop down menus and check boxes will provide to the user the possible options.
70+
71+
* CMake QT GUI with `cmake-gui ..`
72+
* CMake curses interface with `ccmake ..`
73+
74+
### Options that can be choose by the user
75+
76+
* `APPLICATION` - Application example choice.
77+
The possible choices are:
78+
* LoRaMac (Default)
79+
* ping-pong
80+
* rx-sensi
81+
* tx-cw
82+
* `CLASS` - Class specific application example choice.
83+
**Note**: Only applicable to LoRaMac `APPLICATION` choice.
84+
The possible choices are:
85+
* classA
86+
* classB
87+
* classC
88+
* `ACTIVE_REGION` - Active region for which the stack will be initialized.
89+
**Note**: Only applicable to LoRaMac `APPLICATION` choice.
90+
The possible choices are:
91+
* LORAMAC_REGION_EU868
92+
* LORAMAC_REGION_US915
93+
* LORAMAC_REGION_CN779
94+
* LORAMAC_REGION_EU433
95+
* LORAMAC_REGION_AU915
96+
* LORAMAC_REGION_AS923
97+
* LORAMAC_REGION_CN470
98+
* LORAMAC_REGION_KR920
99+
* LORAMAC_REGION_IN865
100+
* LORAMAC_REGION_US915_HYBRID
101+
* `MODULATION` - Type of modulation choice.
102+
**Note**: Only applicable to ping-pong or rx-sensi `APPLICATION` choice.
103+
The possible choices are:
104+
* LORA
105+
* FSK
106+
* `USE_BOOTLOADER` - Enables Bootloader support. (Default OFF)
107+
**Note**: Only applicable to LoRaMote or SensorNode `BOARD` choice.
108+
* `USE_USB_CDC` - Enables USB-Uart support. (Default OFF)
109+
**Note**: Only applicable to LoRaMote or SensorNode `BOARD` choice.
110+
* `USE_DEBUGGER`- Enables debugger support. (Default ON)
111+
* `BOARD` - Target board choice.
112+
The possible choices are:
113+
* LoRaMote (Default)
114+
* MoteII
115+
* NAMote72
116+
* SAML21
117+
* SensorNode
118+
* SK-iM880A
119+
* `REGION_EU868` - Enables support for the Region EU868 (Default ON)
120+
* `REGION_US915` - Enables support for the Region US915 (Default OFF)
121+
* `REGION_CN779` - Enables support for the Region CN779 (Default OFF)
122+
* `REGION_EU433` - Enables support for the Region EU433 (Default OFF)
123+
* `REGION_AU915` - Enables support for the Region AU915 (Default OFF)
124+
* `REGION_AS923` - Enables support for the Region AS923 (Default OFF)
125+
* `REGION_CN470` - Enables support for the Region CN470 (Default OFF)
126+
* `REGION_KR920` - Enables support for the Region IN865 (Default OFF)
127+
* `REGION_IN865` - Enables support for the Region AS923 (Default OFF)
128+
* `REGION_US915_HYBRID` - Enables support for the Region US915 HYBRID (Default OFF)
129+
130+
### Options that are automatically set
131+
132+
* `RADIO` - Defines the radio to be used.
133+
The possible choices are:
134+
* sx1272
135+
* sx1276
136+
* `LINKER_SCRIPT` - Defines the target specific linker script path.
137+
* `OPENOCD_BIN` - Defines the OpenOCD path.
138+
* `OPENOCD_INTERFACE` - Defines the interface configuration file to be used by OpenOCD.
139+
* `OPENOCD_TARGET` - Defines the target configuration file to be used by OpenOCD.
140+
141+
# Debugging
142+
143+
1. OpenOCD
144+
OpenOCD has to be started with parameters that depend on the used debugger device and target board.
145+
Some examples are shown below:
146+
* LoRaMote + STLinkV2:
147+
`openocd -f interface/stlink-v2.cfg -f target/stm32l1.cfg`
148+
149+
* MoteII + STLinkV2-1 (On board debugger):
150+
`openocd -f interface/stlink-v2-1.cfg -f target/stm32l0.cfg`
151+
152+
* LoRaMote + JLink:
153+
`openocd -f interface/jlink.cfg -c "transport select swd" -f target/stm32l1.cfg`
154+
155+
* SAML21 Xplained Pro (On board debugger, tested with openocd 0.10, did not work with 0.9):
156+
`openocd -f interface/cmsis-dap.cfg -f target/at91samdXX.cfg`
157+
158+
2. GDB
159+
The below GDB usage example shows how to start a debug session, writing the program to the flash and run.
160+
* Run ARM-GNU GDB with:
161+
`arm-none-eabi-gdb`
162+
* Choose the program you want to debug:
163+
`file src/apps/LoRaMac/LoRaMac-classA`
164+
* Connect GDB to OpenOCD:
165+
`target extended-remote localhost:3333`
166+
* Execute a reset and halt of the target:
167+
`monitor reset halt`
168+
* Flash the program to the target Flash memory:
169+
`load`
170+
* Add a one-time break point at main:
171+
`thbreak main`
172+
* Run the program until the break point:
173+
`continue`
174+
* Finally run the program:
175+
`continue`
176+
177+
178+
# IDE Support
179+
180+
## VSCode
181+
182+
### Additional Prerequisites
183+
184+
* Visual Studio Code:
185+
* GNU/Linux, Windows and OSX:
186+
* [Download](https://code.visualstudio.com/Download)
187+
* Extensions: Open `VSCode ->EXTENSION (Crtl+Shift+x)` and search for:
188+
* C/C++
189+
* CMake
190+
* CMake Tools
191+
* Native Debug
192+
193+
### Configuration
194+
195+
For Windows platforms it is necessary to make some additional configurations. Open your settings under *File->Preferences->Settings* and add the following lines:
196+
197+
Add MinGW Makefiles as preferred Generator:
198+
199+
```json
200+
"cmake.preferredGenerators": [
201+
"MinGW Makefiles",
202+
"Ninja",
203+
"Unix Makefiles"
204+
]
205+
```
206+
207+
Set the CMake path:
208+
```json
209+
"cmake.cmakePath": "path/to/cmake.exe"
210+
```
211+
212+
### Usage
213+
214+
1. Open the directory of the cloned repository.
215+
The *CMake Tools* extension will automatically generate a *`.cmaketools.json`* file based on the CMakeLists.
216+
2. The *`settings.json`* file under `.vscode` directory is the place where one can change the build options.
217+
These are the build options that will be provided to CMake.
218+
Please see chapter [Commandline Build Instructions](#commandline-build-instructions) for information about build options.
219+
3. Click on the blue status bar of *CMake Tools* to choose a build type (`Debug` or `Release`).
220+
A CMake configuration process will be performed.
221+
4. A `Build` button will now be available.
222+
Click this button to build the target.
223+
5. The CMake build system will automatically generate a *`launch.json`* file which setups the debugging process for the given board.
224+
6. Press the `F5` key to start a debug session.
225+
This will automatically start the GDB and OpenOCD processes.
226+
227+
### Useful Hints
228+
229+
* Change CMake options: Open the Command palette (Crtl+Shift+P) and type `CMake: Edit the CMake Cache`
230+
* Execute a clean rebuild: Open the Command palette (Crtl+Shift+P) and type `CMake: Clean rebuild`
231+
232+
For detailed information about CMake Tools extension please see their [github repository](https://github.com/vector-of-bool/vscode-cmake-tools).
233+
234+
## KDevelop
235+
236+
### Additional Prerequisites
237+
238+
* KDevelop:
239+
* GNU/Linux:
240+
* Ubuntu 16.04/ Linux Mint 18: `apt-get install kdevelop`
241+
* Linux Arch: `pacman -S kdevelop`
242+
* Windows:
243+
* [KDevelop Download](https://www.kdevelop.org/download)
244+
**Note**: Currently there is no GDB support but it is planned for future releases.
245+
* OSX:
246+
* [KDevelop Download](https://www.kdevelop.org/download).
247+
No official binaries are available. Must be built from source code.
248+
249+
### Usage
250+
251+
1. To open the project click on *`Project->Open /Import Project...`* and choose the top level `CMakeLists.txt` directory of the cloned repository.
252+
Follow the indications to setup the project and add `-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-arm-none-eabi.cmake` to the *`Extra Arguments`*.
253+
2. The CMake options and variables can be changed by right-clicking on project and selecting *`Open configuration...`*.
254+
A graphical interface will pop-up.
255+
Please see chapter [Commandline Build Instructions](#commandline-build-instructions) for information about build options.
256+
3. Click on `Build` to build the project.
257+
4. Create a launch configuration for debugging:
258+
* Click on *`Run->Configure Launches...`* and add a new *`Compiled Binary Launcher`*.
259+
* Set the field *`Debugger executable`* according to your system. For example `/usr/bin/arm-none-eabi-gdb` .
260+
* Choose the `Run gdb script` according to the application you want to debug.
261+
For example: `loramac-node/build/src/apps/LoRaMac/openocd-run.gdb`.
262+
**Note**: The CMake build system will automatically generate the GDB run script.
263+
5. Start OpenOCD in a command line terminal as described on chapter [Debugging](#debugging).
264+
6. Click on "Debug" to launch a debug session.

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.

0 commit comments

Comments
 (0)