miro
Evaluation Kit for SX1261
DEV-FMLR-RSEVK2
Evaluation Kit Quick Start Guide
This document provides a step-by-step guide on how to use this board with LoRaWAN®
This documentation is work in progress and not yet up to date |
EVKit pinout
Connecting the development board
1. Powering on the EVK
-
Plug the USB cable into the micro-USB connector
-
Plug the other end of the USB cable to the USB port of your computer
-
The green power LED comes up. - you are ready to go
2. Access the serial port of the EVK
In order to view the debugging output of the FMLR Module, you can use your preferred terminal application. (example: https://sourceforge.net/projects/y-a-terminal/)
Use the following setting:
setting | value |
---|---|
baud-rate |
2000000 |
data-bits |
8 |
parity |
even |
stop-bits |
1 |
flow control |
none |
You can now see the debug output of the pre-installed application. Now let’s develop your own LoRaWAN® application…
Working with WSL under Windows
Basic MAC is developed under Linux, but it runs similarly under Mac or under Windows with a Linux subsystem. In this paragraph, the use of WSL (Windows Subsystem for Linux is explained) is explained.
As WSL does not have a graphical interface. So, if you want to use your IDE (e.g. Eclipse) you normally use in Windows, make sure the source files for your project are installed on a path supported by Windows. You cannot access files within WSL from windows (e.g., your WSL home directory is not accessible!). WSL is mounting your windows drive(s) in /mnt. Your windows user directory is therefore accessible from WSL at /mnt/c/Users/<yourwinuser>. To avoid line ending and other issues (such as case sensitive file names), it is recommended to do important git operations such as checkout and commits directly from within WSL. Working with windows based Git tools does work, but extra care is needed.
1. Install WSL
-
Follow Microsoft online documentation to install WSL (e.g. Ubuntu 20.04.1 LTS from Microsoft Store)
-
Open Power Shell as Administrator.
-
Run the following command:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
2. Update Ubuntu for WSL
After installation update Ubuntu:
$ sudo apt-get update $ sudo apt-get upgrade $ sudo apt-get dist-upgrade
Install development tools
Referenced from: https://doc.sm.tc/mac/gettingstarted.html
1. Git, Python, OpenOcd, GDB
Install the following tools in your Ubuntu WSL
$ sudo apt-get install git gitk make python3.8 python3-pip openocd gdb-multiarch
You might need to do a reboot of the system and continue here.
2. GCC-ARM
Do not use the gcc-arm provided by Ubuntu, use the PPA packet.
$ sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa $ sudo apt-get update $ sudo apt-get upgrade $ sudo apt-get install gcc-arm-embedded
Or, alternatively:
$ wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2 $ sudo tar xjf gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2 -C /usr/share/ $ sudo ln -s /usr/share/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gcc /usr/bin/arm-none-eabi-gcc $ sudo ln -s /usr/share/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-g++ /usr/bin/arm-none-eabi-g++ $ sudo ln -s /usr/share/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gdb /usr/bin/arm-none-eabi-gdb $ sudo ln -s /usr/share/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-size /usr/bin/arm-none-eabi-size $ sudo ln -s /usr/lib/x86_64-linux-gnu/libncurses.so.6 /usr/lib/x86_64-linux-gnu/libncurses.so.5 $ sudo ln -s /usr/lib/x86_64-linux-gnu/libtinfo.so.6 /usr/lib/x86_64-linux-gnu/libtinfo.so.5 $ sudo apt-get install gdb-multiarch binutils-arm-none-eabi
3. Install Python packages
Install the following python packages
$ pip3 install lz4 pycryptodome intelhex PyYAML
Getting the source code
Get Semtech’s LoRaWAN® implementation "Basic MAC". Get the latest example "ex-join" to show how to join a LoRaWAN® server at: https://gitlab.com/fmlr/fmlr-basicmac This is a fork of the official release from Semtech, but ported to the MAX32625/6 microcontroller (by miromico.ch) The official STM32 based release from Semtech can be found at https://github.com/lorabasics/basicmac More information about architecture and installation is at: https://doc.sm.tc/mac/ https://lora-developers.semtech.com/resources/tools/basic-mac/welcome-basic-mac/
1. Cloning the repository
$ git clone https://gitlab.com/fmlr/fmlr-basicmac/ex-join $ cd ex-join $ git submodule update --init --recursive
2. Building the projects
To build the Basic Loader, change to the basicloader directory and type make:
$ cd basicmac/basicloader/build/boards/FMLR-60-X-MAX32625/ $ make
To build the application, change to the application directory
$ cd application
Change the Makefile as shown below: Comment out the STM32L0 target, uncomment the Maxim target
#TARGET := fmlr_72_x_stl0 TARGET := fmlr_61_x_ma625
Build the project:
$ make
Concatenate the bootloader and the application by:
$ make combinebl
In the build-eu868 folder you can fi nd the build-output and executables.
Downloading your code to the EVKit
There are different ways how to download your code to your EVKit.
1. Downloading over DAP link using the MAX32725PICO board
The LoRaWAN® StarterKit comes with the MAX32625PICO debugger probe.
-
Connect the MAX32625PICO board over the ribbon cable to the DevBoard, which is already connected over another USB cable to the PC.
-
Connect the MAX32625PICO board over USB intto the PC
-
A new Explorer Window appears
-
The "ex-join_combined.bin" can be drag-and-dropped to this new Explorer Window.
-
The new Explorer Window disappears for a second and reappears after downloading.
-
If the download failed the file named FAIL.TXT contains the error message
-
If the download succeeded there is not file named FAIL.TXT
-
More information about the DAP link project:
2. Downloading using J-Link
This example uses J-Link (https://www.segger.com/downloads/jlink/ ) under Windows:
-
Connect the DevBoard to the Debugger Probe. Note you can leave the USB cable connected
-
Start J-Flash Lite
-
Choose Device "MAX32625IWY", SWD, 4000kHz and click "OK"
-
Erase Chip
-
Choose your basicloader hex file and click "Program Device"
-
Choose your application hex file and click "Program Device" Miromico also provides break-out boards to easily connect the J-Link programmer and the FTDI cable over TagConnect to your target.
Comissioning your Device
In LoRaWAN® a device needs to be identified:
-
DevEUI: The Devices Extended Unique Identifier
-
JoinEUI (Or AppKey): links the device to back-end-application
-
NwKey: security key known by the the device and the back-end to encode/decode the messages.
In BasicsMac this is hard coded in the persodata.c file.
void pd_init (void) { persodata_v1* ppd = pd_check_v1((void*) PERSODATA_BASE); if( ppd ) { pd = *ppd; } else { uint64_t eui; eui = 0x1aa72bf228286c1bULL; memcpy(pd.deveui, &eui, 8); eui = 0xC41BF8F9B18348DAULL; memcpy(pd.joineui, &eui, 8); uint8_t nwkkey[16] = {0xc3, 0x7f, 0xdd, 0xee, 0x5c, 0xce, 0x29, 0x88, 0xdf, 0x84, 0xea, 0xe3, 0x41, 0xd1, 0xbe, 0x4a}; memcpy(pd.nwkkey, nwkkey, 16); memcpy(pd.appkey, nwkkey, 16); } }
DevEUIs are provided by the Manufacturer.