Libre FreeRTOS-MAVID User manual

Libre Wireless Technologies LIBRE CONFIDENTIAL Page 1of 21
FreeRTOS-MAVID (EVB)
Quick Start Guide
Revision: 1.2

FreeRTOS-MAVID (EVB)
Libre Wireless Technologies Quick Start Guide: Ver. 1.2 Page 2of 21
LIBRE CONFIDENTIAL
Libre Wireless Technologies Private Limited
librewireless.com
Copyright © 2020 Libre Wireless Technologies. All rights reserved.
Circuit diagrams and other information relating to Libre Wireless Technologies products are included as a means
of illustrating typical applications. Consequently, complete information sufficient for construction purposes is not
necessarily given. Although the information has been checked and is believed to be accurate, no responsibility is
assumed for inaccuracies. Libre Wireless Technologies reserves the right to make changes to specifications and
product descriptions at any time without notice. Contact your local Libre Wireless Technologies sales office to
obtain the latest specifications before placing your product order. The provision of this information does not
convey to the purchaser of the described semiconductor devices any licenses under any patent rights or other
intellectual property rights of Libre Wireless Technologies or others. All sales are expressly conditional on your
agreement to the terms and conditions of the most recently dated version of Libre Wireless Technologies standard
Terms of Sale Agreement dated before the date of your order (the "Terms of Sale Agreement"). The product may
contain design defects or errors known as anomalies which may cause the product's functions to deviate from
published specifications. Anomaly sheets are available upon request. Libre Wireless Technologies products are
not designed, intended, authorized or warranted for use in any life support or other application where product
failure could cause or contribute to personal injury or severe property damage. Any and all such uses without
prior written approval of an Officer of Libre Wireless Technologies and further testing and/or modification will
be fully at the risk of the customer. Copies of this document or other Libre Wireless Technologies literature, as
well as the Terms of Sale Agreement, may be obtained by visiting Libre Wireless Technologies website.
LIBRE WIRELESS TECHNOLOGIES DISCLAIMS AND EXCLUDES ANY AND ALL WARRANTIES, INCLUDING
WITHOUT LIMITATION ANY AND ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE, TITLE, AND AGAINST INFRINGEMENT AND THE LIKE, AND ANY AND ALL
WARRANTIES ARISING FROM ANY COURSE OF DEALING OR USAGE OF TRADE. IN NO EVENT SHALL LIBRE
WIRELESS TECHNOLOGIES BE LIABLE FOR ANY DIRECT, INCIDENTAL, INDIRECT, SPECIAL, PUNITIVE, OR
CONSEQUENTIAL DAMAGES; OR FOR LOST DATA, PROFITS, SAVINGS OR REVENUES OF ANY KIND;
REGARDLESS OF THE FORM OF ACTION, WHETHER BASED ON CONTRACT; TORT; NEGLIGENCE OF LIBRE
WIRELESS TECHNOLOGIES OR OTHERS; STRICT LIABILITY; BREACH OF WARRANTY; OR OTHERWISE;
WHETHER OR NOT ANY REMEDY OF BUYER IS HELD TO HAVE FAILED OF ITS ESSENTIAL PURPOSE, AND
WHETHER OR NOT LIBRE WIRELESS TECHNOLOGIES HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES

FreeRTOS-MAVID (EVB)
Libre Wireless Technologies Quick Start Guide: Ver. 1.2 Page 3of 21
LIBRE CONFIDENTIAL
Table of Contents
1. Document Information...........................................................................................................................5
1.1. Abstract.................................................................................................................................................................... 5
1.2. Document Convention........................................................................................................................................ 5
1.3. Document Revision History............................................................................................................................. 5
2. FreeRTOS MAVID (EVB) ......................................................................................................................... 6
2.1 MAVID Evaluation Board (EVB)..................................................................................................................... 6
2.2 EVB Product UI...................................................................................................................................................... 7
3. Libre FreeRTOS IoT Application Development .............................................................................9
3.1. Hardware Requirement..................................................................................................................................... 9
3.2. Software Requirement....................................................................................................................................... 9
3.3. Hardware Setup..................................................................................................................................................10
3.3.1. UART debugging ............................................................................................................................................11
3.4. Application Project Development ...............................................................................................................11
3.4.1 Download SDK from GitHub .....................................................................................................................11
3.4.2 Launching demo project.............................................................................................................................12
3.4.3 Update Credentials .......................................................................................................................................12
3.4.4 Compiling MQTT Demo Application......................................................................................................14
3.4.4.1 Monitoring MQTT messages on the cloud......................................................................................14
3.4.5 Compiling Demo Application for Device Shadow ............................................................................15
3.4.6 Loading and Debugging Demo Application ........................................................................................16
3.4.7 Writing Custom Application .....................................................................................................................18
3.4.8 Generating customized ENV .....................................................................................................................18
4. LED Indication Status........................................................................................................................... 20
4.1 System LED...........................................................................................................................................................20
5. Troubleshooting .................................................................................................................................... 21

FreeRTOS-MAVID (EVB)
Libre Wireless Technologies Quick Start Guide: Ver. 1.2 Page 4of 21
LIBRE CONFIDENTIAL
Table of Figures
Figure 2.1-1: EVB PCBA Top View..................................................................................................................6
Figure 2.1-2: EVB PCBA Bottom View...........................................................................................................7
Figure 3.3-1: EVB PCBA Bottom View........................................................................................................ 10
Figure 3.4.2-1: IAR Project View.................................................................................................................. 12
Figure 3.4.5-1: CONFIG_SHADOW_DEMO_ENABLED........................................................................... 15
Figure 3.4.6-1: JTAG .......................................................................................................................................... 16
Figure 3.4.6-2: MQTT Demo Application logs......................................................................................... 17
Figure 3.4.6-3: Shadow Demo Application logs ..................................................................................... 18

FreeRTOS-MAVID (EVB)
Libre Wireless Technologies Quick Start Guide: Ver. 1.2 Page 5of 21
LIBRE CONFIDENTIAL
1. Document Information
1.1. Abstract
This document explains the content of MAVID package for FreeRTOS.
1.2. Document Convention
Icon
Meaning
Description
Note
Provides information good to know
Caution
Indicates situation that might result
in loss of data or hardware damage
1.3. Document Revision History
Revision
Date
Description of change
Author
1.2
July 19, 2020
Added section Update
Credentials
Sachin
1.1
June 25, 2020
Made changes to section
3.4, 3.4.1, 3.4.3, 3.4.4
Sachin
1.0
May 18, 2020
Added section 5
Ramya
0.1
May 08, 2020
Initial Draft
Ramya

FreeRTOS-MAVID (EVB)
Libre Wireless Technologies Quick Start Guide: Ver. 1.2 Page 6of 21
LIBRE CONFIDENTIAL
2. FreeRTOS MAVID (EVB)
2.1 MAVID Evaluation Board (EVB)
EVB is a MAVID device-based reference design, used for customer evaluation purpose.
Figure 2.1-1: EVB PCBA Top View

FreeRTOS-MAVID (EVB)
Libre Wireless Technologies Quick Start Guide: Ver. 1.2 Page 7of 21
LIBRE CONFIDENTIAL
Figure 2.1-2: EVB PCBA Bottom View
Refer the sections: UART debugging, Network setup, MAC ID update, and APP usage for
more details.
2.2 EVB Product UI
The MAVID EVB board has the following Switches and defined functionality as mentioned
below:
Switch#
Short press
Functionality
Long press
Functionality
MAVID MCU port
RTC GPIO
MAVID Pin#
SW11
Push-To-Talk
(Action)
SETUP
PI11
YES
P57
SW16
MIC ON/OFF
POWER ON/OFF
PA0
YES
P109
SW10
Play/Pause
BT pairing
PB4
NO
P84
SW7
VOL-
PREV
PD13
NO
P110
SW8
VOL+
NEXT
PF10
NO
P111
SW9
RESERVED
RESERVED
PD6
NO
P86
•The Top Side of EVB board there is right angled button for Reset.
•Simultaneous press of SW10 and SW11 results in Factory Default Reset (FDR) functionality.
•SW9 is reserved for user to define the functionality.

FreeRTOS-MAVID (EVB)
Libre Wireless Technologies Quick Start Guide: Ver. 1.2 Page 8of 21
LIBRE CONFIDENTIAL
Here are the supported features in Libre’s current EVB Rev 2.0.
•Micro USB for charging battery/Micro USB for powering up the EVB
•Battery charging circuit
•6 nos. of buttons + 1 reset button
-MIC mute/POWER ON-POWER OFF
-Network setup/PTT
-Play-pause/BT paring
-VOL-/PREV
-VOL+/NEXT
-Pin hole for RST
-SW11: Network setup (long press) and short press for (action –push
to talk)
-SW16: Power ON/POWER OFF (long press) and short press for Mic
mute (when the unit is ON)
-SW10: BT pair (long press) and short press for play/pause
-SW15: Only reset (to reboot MAVID device)
-J17: JTAG (it is for programming and debugging)
-CON3: Debug port connection
-J21: Zigbee Interface connector header
-J20, J16: MAVID for unused GPOIs
-TP3: AEC tuning
-TP92: D4 debug port

FreeRTOS-MAVID (EVB)
Libre Wireless Technologies Quick Start Guide: Ver. 1.2 Page 9of 21
LIBRE CONFIDENTIAL
3. Libre FreeRTOS IoT Application Development
The Libre application development platform provides the tools and development
environment for custom application development.
It is based on the latest AWS FreeRTOS kernel.
3.1. Hardware Requirement
The hardware requirements are as follows:
•MAVID Development Kit
•STlink debugger
•USB TTL Serial cable
•Power adapter of 5V /2A
for operating the device
3.2. Software Requirement
The software requirements are as follows:
•IAR version 7.70.1
Download the IAR version 7.70.1 from www.iar.com
This SDK is compatible with IAR version 7.70.1
•STM32 ST-LINK Utility v4.2.0
Download the ST-Link utility from https://stm32-st-link-
utility.software.informer.com/download/
•Teraterm/Putty/GTK-term or any similar serial port terminal application
Download Teraterm from https://tera-term.en.softonic.com/download
•Libre software development kit (contains software development SDK and ENV tool
to generate custom ENV binary)

FreeRTOS-MAVID (EVB)
Libre Wireless Technologies Quick Start Guide: Ver. 1.2 Page 10 of 21
LIBRE CONFIDENTIAL
3.3. Hardware Setup
Follow the below steps to setup the hardware components:
Step 1. Connect the USB TTL cable to the device as shown below:
Figure 3.3-1: EVB PCBA Bottom View
Step 2. Connect the micro USB power cable to the device.
Step 3. Launch the serial port terminal on the PC with the following settings:
Baud Rate
460800
Data
8 bits
Parity
none
Stop Bits
1 bit
Flow Control
none
Enable LF on the serial receive
Step 4. Press button SW15 to Power ON the device.

FreeRTOS-MAVID (EVB)
Libre Wireless Technologies Quick Start Guide: Ver. 1.2 Page 11 of 21
LIBRE CONFIDENTIAL
3.3.1. UART debugging
Libre does run command line interpreter (CLI) over UART, it includes the following
capabilities:
•Does have the boot up logs with appropriate initialization state of each module, that
point out the errors or exception with details.
•Relevant runtime debugging Information for every module, this will be looked up on
to trace bugs.
•The Command Interpreter over UART provides custom AT commands such as,
-Memory analysis -to monitor system memory
-CPU utilization - to monitor CPU load
-Modify Config parameters - To change the configuration parameters
(NV-items) to change mode
3.4. Application Project Development
3.4.1 Download SDK from GitHub
To clone using HTTPS:
git clone https://github.com/aws/amazon-freertos.git --recurse-submodules
Using SSH:
git clone git@github.com:aws/amazon-freertos.git --recurse-submodules
If you have downloaded the repo without using the --recurse-submodules argument, you
need to run:
git submodule update --init --recursive

FreeRTOS-MAVID (EVB)
Libre Wireless Technologies Quick Start Guide: Ver. 1.2 Page 12 of 21
LIBRE CONFIDENTIAL
3.4.2 Launching demo project
Launch the demo project by following the below method:
Run FREERTOS_BASE_DIR\projects\libre\mavid\iar\ aws_demos\aws_demos.eww
*FREERTOS_BASE_DIR is the root directory of the FreeRTOS source code.
Figure 3.4.2-1: IAR Project View
3.4.3 Update Credentials
•Before compiling the demo application follow the steps below to configure the Wi-Fi
and IoT Thing credentials
•Install and Configure AWS CLI as explained in
https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html

FreeRTOS-MAVID (EVB)
Libre Wireless Technologies Quick Start Guide: Ver. 1.2 Page 13 of 21
LIBRE CONFIDENTIAL
•Confirm that the AWS CLI is successfully installed:
•Edit FREERTOS_BASE_DIR\tools\aws_config_quick_start\configure.json to
update Wi-Fi credentials and thing name:
Refer to FREERTOS_BASE_DIR\tools\aws_config_quick_start\README.md for more
details.
•In the command terminal navigate to path FREERTOS_BASE_DIR\tools\
aws_config_quick_start\
•From the command shell, run the python script SetupAWS.py with setup option as
shown below:
•The script creates a thing, generates certificates and policies, attaches the
certificates and policies to the thing, and updates the aws_credentials.h and
aws_credentials_keys.h files at the path FREERTOS_BASE_DIR\demos\include\ folder,
based on the inputs in configure.json

FreeRTOS-MAVID (EVB)
Libre Wireless Technologies Quick Start Guide: Ver. 1.2 Page 14 of 21
LIBRE CONFIDENTIAL
3.4.4 Compiling MQTT Demo Application
•In the Menu bar select Project Clean to clean the project
•Create an IoT thing in AWS. Assign certificates and policies to the thing, as explained
in 3.4.3.
•To Build MQTT demo application enable CONFIG_MQTT_DEMO_ENABLED in
aws_demo_config.h
•In the Menu bar select Project Make to compile the project.
•After successful compilation, the output file aws_demos.bin_JTAG.bin is generated
at FREERTOS_BASE_DIR\ projects\libre\mavid\iar\ aws_demos\Debug\Exe \
folder.
•Load the binary file aws_demos.bin_JTAG.bin as explained in the section
3.4.6.Loading and Debugging Demo Application
3.4.4.1 Monitoring MQTT messages on the cloud
You can use the MQTT client in the AWS IoT console to monitor the messages that your
device sends to the AWS Cloud. You might want to set this up before the device runs the
demo project.
To subscribe to the MQTT topic with the AWS IoT MQTT client
1. Sign in to the AWS IoT console.
2. In the navigation pane, choose Test to open the MQTT client.
3. In Subscription topic, enter iotdemo/#, and then choose Subscribe to topic.

FreeRTOS-MAVID (EVB)
Libre Wireless Technologies Quick Start Guide: Ver. 1.2 Page 15 of 21
LIBRE CONFIDENTIAL
3.4.5 Compiling Demo Application for Device Shadow
•In the Menu bar select Project Clean to clean the project
•Create an IoT thing in AWS. Assign certificates and policies to the thing, as explained
in 3.4.3.
•To Build the Demo Application for MQTT Shadow enable the macro
CONFIG_SHADOW_DEMO_ENABLED in aws_demo_config.h
Figure 3.4.5-1: CONFIG_SHADOW_DEMO_ENABLED
•In the Menu bar select Project Make to compile the project.
•After successful compilation, the output file aws_demos.bin_JTAG.bin is generated
at FREERTOS_BASE_DIR\projects\libre\mavid\iar\ aws_demos\Debug\Exe \
folder.
•Load the binary file aws_demos.bin_JTAG.bin as explained in the section
3.4.6.Loading and Debugging Demo Application

FreeRTOS-MAVID (EVB)
Libre Wireless Technologies Quick Start Guide: Ver. 1.2 Page 16 of 21
LIBRE CONFIDENTIAL
3.4.6 Loading and Debugging Demo Application
1) Loading Demo Application image to MAVID
•Connect the ST-link debugger to the MAVID EVK as shown below:
Figure 3.4.6-1: JTAG
•Go to “FREERTOS_BASE_DIR\vendors\libre\mavid\tools\" and run loadApp.bat
and give the path of application binary aws_demos.bin_JTAG.bin generated as given
in the section 3.4.3.
E.g.:loadApp.batD:\FreeRTOS\projects\libre\mavid\iar\aws_demos\Debug\Exe\aws_
demos.bin_JTAG.bin
2) Loading ENV binary
•Connect the ST-link debugger to the MAVID EVK as shown in Figure 3.4.5-1: JTAG
•Run the bat file loadENV.bat located at “FreeRTOS\vendors\libre\mavid\tools\”
and provide the path of env.bin as input argument.
E.g.: loadENV.bat D:\freeRTOS\vendors\libre\mavid\tools\ENV_tool

FreeRTOS-MAVID (EVB)
Libre Wireless Technologies Quick Start Guide: Ver. 1.2 Page 17 of 21
LIBRE CONFIDENTIAL
ENV binary needs to be flashed only when there are any changes made to
envitem.xml
3) Debugging Application
•After the application is programmed, open the project you wish to debug in IAR.
Select Project Attach to Running Target from IAR menu bar. This opens the Debug
view.
•Select Debug Break to break and Debug Reset. This takes the execution to
main(). Select Debug Go to run.
•The MQTT Demo application runs with logs as shown below:
Figure 3.4.6-2: MQTT Demo Application logs

FreeRTOS-MAVID (EVB)
Libre Wireless Technologies Quick Start Guide: Ver. 1.2 Page 18 of 21
LIBRE CONFIDENTIAL
•The logs for the Shadow Demo application are shown below:
Figure 3.4.6-3: Shadow Demo Application logs
3.4.7 Writing Custom Application
•The application execution starts at main()
•Enable the macro configUSE_DAEMON_TASK_STARTUP_HOOK in
FreeRTOSConfig.h to start the task startup daemon and hook the custom tasks
within vApplicationDaemonTaskStartupHook().
•New files can be added to application_code group in the project folder structure or
new groups can be created.
3.4.8 Generating customized ENV
•The ENV_tool (Part of software SDK) contains the tools to modify and generate the
env.bin.
•The values of ENV can be modified and new env can be added to envitem.xml.
Refer “LibreWirelessTechNote - MAVID_NV_Items_V0.4” document for more details.
•Go to FREERTOS_BASE_DIR\vendors\libre\mavid\tools\ENV_tool\ to generate new
env.bin.

FreeRTOS-MAVID (EVB)
Libre Wireless Technologies Quick Start Guide: Ver. 1.2 Page 19 of 21
LIBRE CONFIDENTIAL
After editing the envitem.xml, run CreateENV.bat. The output env.bin and
env_uid.h are generated in the same folder.
•In case a new ENV is added to envitem.xml, replace the env_uid.h at
FREERTOS\vendors\libre\mavid\components\Inc with the newly generated
env_uid.h.
•Load the env.bin on MAVID as explained in Loading ENV binary of the section
3.4.6.Loading and Debugging Demo Application.

FreeRTOS-MAVID (EVB)
Libre Wireless Technologies Quick Start Guide: Ver. 1.2 Page 20 of 21
LIBRE CONFIDENTIAL
4. LED Indication Status
The MAVID EVB board has the following System and AVS LED as mentioned below:
4.1 System LED
State
LED Indication
Power On
RED Solid
Power OFF
No Indication
Table of contents
Popular Computer Hardware manuals by other brands

Freescale Semiconductor
Freescale Semiconductor FRDM-KL25Z user manual

Endace
Endace DAG 3.7D user guide

UTAH SCIENTIFIC
UTAH SCIENTIFIC Graphic Station 4000 System setup and operations

Renesas
Renesas H8/36037 user manual

Gigafast
Gigafast WE721-AEX user guide

HP
HP A58 0AF Series Product End-of-Life Disassembly Instructions