20
FMLR Development Board High Performance LoRaWAN ® Development Board Quickstart Guide Miromico AG - Gallusstrasse 4 - CH-8006 Zurich – Switzerland Revision 1.0 1/20

FMLR Development Board - Miromico · Over the USB serial connection the development board provides access to the on-chip boot loader of the STM32 on the FMLR module. Using tools from

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: FMLR Development Board - Miromico · Over the USB serial connection the development board provides access to the on-chip boot loader of the STM32 on the FMLR module. Using tools from

FMLR Development BoardHigh Performance LoRaWAN® Development Board

Quickstart Guide

Miromico AG - Gallusstrasse 4 - CH-8006 Zurich – Switzerland

Revision 1.0

1/20

Page 2: FMLR Development Board - Miromico · Over the USB serial connection the development board provides access to the on-chip boot loader of the STM32 on the FMLR module. Using tools from

About this Document

Title FMLR Development Board

Subtitle High Performance LoRaWAN® Development Board

Document Type Quickstart Guide

Revision 1.06

Date 2020/02/07

Document Status Preliminary

Contents

1 Overview.................................................................................................................................................. 31.1 Connectors and UI................................................................................................................................ 31.2 Pin-out................................................................................................................................................... 42 First steps................................................................................................................................................. 52.1 Powering on the Device........................................................................................................................52.2 Programming the Device......................................................................................................................52.3 Access Serial Port of the Device by USB (UART)...................................................................................63 Application Development and Debugging..............................................................................................73.1 Prerequisites.......................................................................................................................................... 73.2 Connecting the Development Board using SWD Programmer............................................................83.3 Getting the Sources.............................................................................................................................. 93.4 Setting LoRaWAN Configuration........................................................................................................103.5 Download and Debugging..................................................................................................................113.6 Connection to a LoRaWAN Network Server.......................................................................................144 Additional Information........................................................................................................................... 20

We reserve the right to make technical changes, which serve to improve the product, without prior notification.

SAFETY-CRITICAL, MILITARY, AND AUTOMOTIVE APPLICATIONS DISCLAIMER: Miromico products are not designed for and will not be used in connection with any applications where the failure of such products would reasonably be expected to result in significant personal injury or death (“Safety-Critical Applications”) without an Miromico officer's specific written consent. Safety-Critical Applications include, without limitation, life support devices and systems, equipment or systems for the operation of nuclear facilities and weapons systems. Miromico products are not designed nor intended for use in military or aerospace applications or environments. Miromico products are not designed nor intended for use in automotive applications unless specifically designated by Miromico as automotive-grade.

Miromico AG - Gallusstrasse 4 - CH-8006 Zurich – Switzerland

Revision 1.0

2/20

Page 3: FMLR Development Board - Miromico · Over the USB serial connection the development board provides access to the on-chip boot loader of the STM32 on the FMLR module. Using tools from

1 Overview

1.1 Connectors and UI

Function DescriptionFMLR Module FMLR Module

LED User RGB LED for debugging or user purpose

TAG Connect Programming Interface for Tag Connect and Miromico programming adapter

Sensor SHT21 I2C environmental sensor

JTAG Connector Programming Interface for JTAG programmer

User Button For debugging or user purpose connected to PA0 of the MCU

Boot Mode Button Sets the Boot Mode of the FMLR Module

Micro-USB Port DC Input and debugging interface

Reset Button Resets and restarts the FMLR Module

LEDs Power and UART RX / TX LED

For more information on the FMLR Module please refer the the respective data sheets found on the Miromico website:

• General information about Modules and Products

• FMLR-72-x-STL0 Datasheet

Miromico AG - Gallusstrasse 4 - CH-8006 Zurich – Switzerland

Revision 1.0

3/20

Page 4: FMLR Development Board - Miromico · Over the USB serial connection the development board provides access to the on-chip boot loader of the STM32 on the FMLR module. Using tools from

1.2 Pin-out

Pin Details Min Max Unit

All Min / Max Voltage on All Pins -0.3 3.6 V

3V3 Input / Output Voltage Pin -0.3 3.6 V

VBUS Input / Output Voltage Pin -0.3 5.5 V

Warning:

Do not exceed the above mentioned max. voltage values

Miromico AG - Gallusstrasse 4 - CH-8006 Zurich – Switzerland

Revision 1.0

4/20

Function MCU Pad Pin FMLR-xx-STLx-xx Development Board – Pinout Pin MCU Pad Function Alternate Function

GND B01 PB0 TIM3_CH3 ADC_IN8

NRST RES# B02 PA0 WKUP1 ADC_IN0

WKUP2 PC13 A03 B03 PB1 TIM3_CH4 ADC_IN9

I2C1_SDA PB9 A04 B04 PA2 USART2_TX TIM2_CH3

I2C1_SCL PB8 A05 B05 PA3 USART2_RX ADC_IN3

BOOT0 BM B06 PA5 SPI1_SCK ADC_IN5

USART1_RX PA10 A07 B07 PB5 SPI1_MOSI

USART1_TX PA9 A08 B08 PB4 SPI1_MISO

I/O PA14 SWCLK B09 PB3 SPI1_SCK

I/O PA13 SWDIO B10 PB2 I/O

USB_DP PA12 A11 GND

USB_DM PA11 A12 B11 PA8 I2C3_SCL

3V3 B12 PC1 I2C3_SDA

TIM3_CH2 PC7 A14 B13 PH1 OSC_OUT

TIM3_CH1 PC6 A15 B14 PH0 OSC_IN

USART4_TX PC10 A16 B15 PB7 I/O

USART4_RX PC11 A17 B16 PC12 I/O

TIM2_CH1 PA15 A18 GND

I/O PD2 A19 GND

VUSB GND

Page 5: FMLR Development Board - Miromico · Over the USB serial connection the development board provides access to the on-chip boot loader of the STM32 on the FMLR module. Using tools from

2 First stepsThis section will guide you through the initial setup of the FMLR Development Board. You only need a Micro-USB cable to power and load precompiled binaries. Using more advanced tools, you can directly develop, download and debug your own application on the development board

2.1 Powering on the Device

The FMLR Development Board uses a standard Micro-USB connection to power and provide access to the serial port of the MCU.

1. Plug the USB cable to Micro-USB connector.

2. Plug the other end of the Micro-USB cable to the USB port of your computer.

3. The green power LED comes up. – you are ready to go

2.2 Programming the Device

Over the USB serial connection the development board provides access to the on-chip boot loader of the STM32 on the FMLR module. Using tools from ST you can upload precompiled “ready-to-go” firmware (intel-hex files) into the module.

To program the device using the on-chip boot-loader you need to download and install “FLASHER-STM32” Software from the STMicroelectronics website.

1. Plug in the USB cable

2. Press and hold the Bootmode button (BM).

3. Press and release the Reset button (RES) while still holding the Bootmode button

4. Release the Bootmode button

5. Start the «FLASHER-STM32» software as administrator

6. Set the serial port name for your device

7. Click “Next”

8. You should see the following message as the tool recognizes the used ST-Microcontroller onthe Module

9. Click “Next” in the next window that shows up and do not change any parameters

10. Check the “Download to device” option and select your .hex file you want to flash onto the device

11. Check the “Erase necessary pages” option and click “Next”

Miromico AG - Gallusstrasse 4 - CH-8006 Zurich – Switzerland

Revision 1.0

5/20

Page 6: FMLR Development Board - Miromico · Over the USB serial connection the development board provides access to the on-chip boot loader of the STM32 on the FMLR module. Using tools from

12. The flash progress is complete once the following message appears

2.3 Access Serial Port of the Device by USB (UART)

In order to view the debugging output of the FMLR Module, you need a suitable terminal application. We recommend YAT. Connect to the device using your terminal program using the following settings:

Baud-rate 115200

Data-bits 8

Parity Even

Stop-bits 1

Flow Control None

You should now be able to see the debug output of the FMLR Module.

Miromico AG - Gallusstrasse 4 - CH-8006 Zurich – Switzerland

Revision 1.0

6/20

Page 7: FMLR Development Board - Miromico · Over the USB serial connection the development board provides access to the on-chip boot loader of the STM32 on the FMLR module. Using tools from

3 Application Development and Debugging

3.1 Prerequisites

You can use the development board to develop and debug your own application. You will need the following prerequisites to do so.

• Download and install Atollic TrueSTUDIO ® for STM32

• STLink V2 or similar SWD programmer (e.g. SEGGER J-Link)

• FTDI-Cable (TTL-232R-3V3)

• Tag connect cable (TC2050-IDC-NL)

• Clip for tag connect (TC2050-CLIP)

• Miromico interconnect board

• Git version control

To successfully run the example LoRaWAN sensor application, you will also need a LoRaWAN gateway connected to a LoRaWAN network server.

3.2 Connecting the Development Board using SWD Programmer

In this configuration the development board is powered by its own USB connector. No power is supplied throuhg the FTDI cable.

• Power the development board by its own USB connector.

• Remove jumper P2 from the interconnect board.

• Plug the FTDI cable into your computers USB port.

• Plug the FTDI cable into the interconnect board.Make sure the black cable is on the side of P2.

• Connect the TAG-connect cable at connector J2 to the interconnect board.

• Connect the TAG-connect cable to the FMLR Breakout Board

Miromico AG - Gallusstrasse 4 - CH-8006 Zurich – Switzerland

Revision 1.0

7/20

Page 8: FMLR Development Board - Miromico · Over the USB serial connection the development board provides access to the on-chip boot loader of the STM32 on the FMLR module. Using tools from

The other end of the TAG-connect cable connects to the Development Boardvia the 10 pin JTAG connector an is secured by the TAG-connect TC2050-Clip.

Miromico AG - Gallusstrasse 4 - CH-8006 Zurich – Switzerland

Revision 1.0

8/20

Page 9: FMLR Development Board - Miromico · Over the USB serial connection the development board provides access to the on-chip boot loader of the STM32 on the FMLR module. Using tools from

3.3 Getting the Sources

Clone the sources of the FMLR LoRaWAN L0 project from Gitlab into a directory on your hard-disk.

In Atollic TrueSTUIDO navigate to File Import and select «Existing Projects into Workspace»

On the next screen click on «Browse» and navigate to the directory where you checked out your sources. TrueSTUDIO will find your project. Click «Finish» to import the project into your workspace.

Miromico AG - Gallusstrasse 4 - CH-8006 Zurich – Switzerland

Revision 1.0

9/20

Page 10: FMLR Development Board - Miromico · Over the USB serial connection the development board provides access to the on-chip boot loader of the STM32 on the FMLR module. Using tools from

3.4 Setting LoRaWAN Configuration

Once the application is loaded into the workspace, you need to set your LoRaWAN DevEUI, AppEUI and AppKey configuration in the program. In the project tree navigate to main.c and open the file in TrueSTUDIO. You will find a struct lora_config. Set your network configuration within the struct.

If you use TheThingsNetwork LoRaWAN (TTN) to join your device as recommended below, you need to acquire a unique DevEUI first. The AppEUI and the AppKey will be created in a random way by the TTNWeb Application. The DevEUI, AppEUI and AppKey need to be configured in you LoRaWAN networkserver backend before you can configure them in the application. See chapter “Connection to aLoRaWAN Network Server” to learn how to register a device with TTN. Please note the AppEUI is sometimes also called JoinEUI. EUIs are 8 bytes long whereas the AppKey is 16 bytes long.

• Defining EUIs and keys in the program.

Now your application is ready to build. Select Project Build Project to compile the project.

Miromico AG - Gallusstrasse 4 - CH-8006 Zurich – Switzerland

Revision 1.0

10/20

Page 11: FMLR Development Board - Miromico · Over the USB serial connection the development board provides access to the on-chip boot loader of the STM32 on the FMLR module. Using tools from

3.5 Download and Debugging

To download and run your application on the development board, select Run Debug Configurations to create and configure your application for debugging.

In the Debug Configurations window create a new «Embedded C/C++ Application».

If you have never set a target before you will get the target Settings Window at this point.If it does not pop up because some target is already set then you can open it by right clicking theMiromico_LoRaWAN project in the Project Explorer and selecting properties. In the properties Window select “C/C++ Build” sub-menu Settings.

• Creating and managing applications “Main” tag.

On the Main tab set the application by clicking «Search Project» and select the compiled ELF file.

Miromico AG - Gallusstrasse 4 - CH-8006 Zurich – Switzerland

Revision 1.0

11/20

Page 12: FMLR Development Board - Miromico · Over the USB serial connection the development board provides access to the on-chip boot loader of the STM32 on the FMLR module. Using tools from

• Creating and managing applications “Debugger” tag.

On the Debugger Tab select your Debug probe and set the Interface to SWD.

IMPORTANT:

• Make sure Debug Probe matches the device you are using• Set the Interface to SWD• Check that Device matches your target MCU.

Miromico AG - Gallusstrasse 4 - CH-8006 Zurich – Switzerland

Revision 1.0

12/20

Page 13: FMLR Development Board - Miromico · Over the USB serial connection the development board provides access to the on-chip boot loader of the STM32 on the FMLR module. Using tools from

• Adjusting the target configuration.

IMPORTANT:

Cancel the following popup windows if TrueStudio tries to generate a new linker script.

Miromico AG - Gallusstrasse 4 - CH-8006 Zurich – Switzerland

Revision 1.0

13/20

Page 14: FMLR Development Board - Miromico · Over the USB serial connection the development board provides access to the on-chip boot loader of the STM32 on the FMLR module. Using tools from

Now click «Debug» to start your debug session. Your code will be downloaded to the device and execution will stop at the main function.

3.6 Connection to a LoRaWAN Network Server

To run and test a LoRaWAN sensor node you need to connect it to a LoRaWAN network server. For your first steps we recommend to use TheThingsNetwork LoRaWAN (TTN). You need to setup and connect your gateway in TTN. This chapter is a step-by-step guide on how to on-board a new sensor device on TTN. Similar steps need to be taken with any other LoRaWAN network server.

1. Log in to your TTN account and navigate to the console

Miromico AG - Gallusstrasse 4 - CH-8006 Zurich – Switzerland

Revision 1.0

14/20

Page 15: FMLR Development Board - Miromico · Over the USB serial connection the development board provides access to the on-chip boot loader of the STM32 on the FMLR module. Using tools from

2. Select «Applications»

3. Fill the form and press Add application.The AppEUI is automatically generated by the Things Network

4. Your application will be created and is ready to add some devices.

Miromico AG - Gallusstrasse 4 - CH-8006 Zurich – Switzerland

Revision 1.0

15/20

Page 16: FMLR Development Board - Miromico · Over the USB serial connection the development board provides access to the on-chip boot loader of the STM32 on the FMLR module. Using tools from

5. Take note of your new Application EUI

6. To register your device select «register device»

Miromico AG - Gallusstrasse 4 - CH-8006 Zurich – Switzerland

Revision 1.0

16/20

Page 17: FMLR Development Board - Miromico · Over the USB serial connection the development board provides access to the on-chip boot loader of the STM32 on the FMLR module. Using tools from

7. On the next screen enter a Device ID, your unique Device EUI. Note the App Key will be created automatically. Then press «Register» to complete the device registration.

Miromico AG - Gallusstrasse 4 - CH-8006 Zurich – Switzerland

Revision 1.0

17/20

Page 18: FMLR Development Board - Miromico · Over the USB serial connection the development board provides access to the on-chip boot loader of the STM32 on the FMLR module. Using tools from

8. In the device overview you will see the device EUIs and the key you need to copy over into the applications LoRaWAN configuration. By clicking the “<>“ icons you can switchthe view between hex and C-stile display. By clicking the clipboard icon you can copy the displayed value to the clipboard for later copy&paste operation.

9. You are now ready to set the LoRaWAN configuration and build the application.Copy the EUIs and the key and continue at chapter „Setting LoRaWAN Configuration“. Then return here to start and join the device.

10. Build and download the application into the development board and click run.

Miromico AG - Gallusstrasse 4 - CH-8006 Zurich – Switzerland

Revision 1.0

18/20

Page 19: FMLR Development Board - Miromico · Over the USB serial connection the development board provides access to the on-chip boot loader of the STM32 on the FMLR module. Using tools from

11. TTN data display of LoRaWan Application

The message without payload (marked with an orange marker) is the join message.There is only one join message because the device joined at the first try.

By default the payload data is just displayed in hex format. If you want to decode the hex data you need to change Payload Format under Payloads Formats from “Custom” to “Cayenne LPP”.

Miromico AG - Gallusstrasse 4 - CH-8006 Zurich – Switzerland

Revision 1.0

19/20

Page 20: FMLR Development Board - Miromico · Over the USB serial connection the development board provides access to the on-chip boot loader of the STM32 on the FMLR module. Using tools from

12. Console log of the Miromico LoRaWan Application

The FTDI-Cable (TTL-232R-3V3) creates a virtual COM device on Windows PCs.Connecting a console program to the COM device allows to log the UART messages logged by the LoRaWan application.See chapter “Access Serial Port of the Device by USB (UART)” for correct settings.

Below you can see:boot-messages, successful joining messages (JOINED) and data transfer messages

4 Additional InformationThis chapter is a collection of additional information once the first steps of bringing up your first LoRaWAN sensor node have successfully been completed.

• With most operators LoRaWAN DevEUI need to be unique and from an official IEEE number range.

Miromico AG - Gallusstrasse 4 - CH-8006 Zurich – Switzerland

Revision 1.0

20/20