Murata ABR User manual

Version :
Author :
Document ID :
Release Date :
0.2.0
SyChip Engineering
S10204
August 11, 2020
Notice
Murata reserves the right to make changes in specifications at anytime and without notice. The information
furnished in this data sheet is believed to be accurate and reliable. However, no responsibility is assumed by
Murata for its use,no any infringements of patents or other rights of third parties resulting from its use.
No license is generated under any rights of Murata or its supporters unless specifically agreed.
Preliminary & Public
Murata Manufacturing Co., Ltd.
TypeABR AWS FreeRTOS SDK
Getting Started Guide
Document ID : S10204
User manual

i
CONTENTS
1
Introduction 2
1.1
Scope......................................................................................................................................................2
1.2
Audience.................................................................................................................................................2
1.3
Contact Information and Support...........................................................................................................2
1.4
Text Conventions....................................................................................................................................2
1.5
Acronyms ...............................................................................................................................................3
1.6
Related Documents.................................................................................................................................3
2
Overview 4
2.1
System Diagram .....................................................................................................................................4
2.2
Preparation .............................................................................................................................................5
2.2.1
Hardware Preparation...............................................................................................................5
2.2.2
Software Preparation ................................................................................................................5
2.3
AWS IoT Settings...................................................................................................................................5
2.3.1
AWS account and permissions..................................................................................................5
2.3.2
Register with AWS IoT.............................................................................................................5
3
Build The AWS FreeeRTOS SDK 6
3.1
Set up development environment............................................................................................................6
3.2
Get the AWS FreeeRTOS SDK ..............................................................................................................6
3.3
AWS FreeeRTOS SDK Modifications....................................................................................................7
3.4
Build the AWS demos firmware .............................................................................................................8
4
Run the Firmware 9
4.1
Download the firmwares.........................................................................................................................9
4.2
Run the FreeRTOS demo project............................................................................................................9
4.3
Monitoring MQTT messages on the cloud........................................................................................... 10
5
LastWillAndTestament 11
5.1
Reference Solution ...............................................................................................................................11
5.2
Reference Patches................................................................................................................................. 13
5.3
Reference Running Logs......................................................................................................................13
6
PRECONDITION TO USE OUR PRODUCTS 14

CONTENTS
1
TypeABR AWS FreeRTOS SDK Getting Started Guide
Revision History
Revision
Date
Description
V0.1.0
2020-06-17
•
Initial version.
V0.2.0
2020-08-11
•
Add the section for LastWillAndTestament test case.
•
Revise for public release.

2
CHAPTER
ONE
INTRODUCTION
1.1
Scope
This document provides instructions about how to use AWS FreeRTOS SDK to build the AWS Demo and Run the
AWS Demo on Murata TypeABR module.
1.2
Audience
This document is intended for software/firmware engineers to evaluate AWS IOT with Murata TypeABR module.
1.3
Contact Information and Support
For general contact, technical support services, technical questions and report documentation errors contact Mu-
rata Technical Support window. Please keep us informed of your comments and suggestions for improvements.
Murata will take into consideration any and all feedback from the users of this information.
1.4
Text Conventions
Tip: Provides advice and suggestions that may be useful when using the product.
Note: Provides note admonitions that should be took into considerations when using the product.
Caution: Alerts the user to important points about using the product; if these points are not followed, the
product and end user equipment may fail or malfunction.
Danger: This information MUST be followed or catastrophic equipment failure or bodily injury may occur.

1.5. Acronyms
3
TypeABR AWS FreeRTOS SDK Getting Started Guide
1.5
Acronyms
Abbr.
Description
EVB
EvaluationBoard
1.6
Related Documents
•
[DS]TypeABR_Module_Datasheet.pdf,Murata
•
[UG] CMWC1ZZABR EVB Hardware Manual.pdf, Murata
•
[AN]S10093-TypeABR_Firmware_Upgrade_Guide.pdf,Murata

4
CHAPTER
TWO
OVERVIEW
This tutorial contains instructions for the following getting started steps:
1.
Required preparation materials.
2.
Connecting your board to a host machine.
3.
Installing software on the host machine for developing and debugging embedded applications.
4.
Cross-compiling a FreeRTOS demo application to a binary image.
5.
Loading the application binary image to your board and then running the application.
6.
Interacting with the application running on your board across a serial connection for monitoring and debug-
ging purposes.
2.1
System Diagram
The typical system diagram shown as below:
Fig. 2.1: System Diagram

2.2. Preparation
5
TypeABR AWS FreeRTOS SDK Getting Started Guide
2.2
Preparation
2.2.1
HardwarePreparation
Table 2.1: Hardware Preparation
Name
Quantity
Comment
TypeABR EVB
1
TypeABR Evaluation Kit
USB-to-UART adaptor& cable
1
Monitoring the log
J-Link
1
JTAG adaptor for loading image
Laptop with Ubuntu/Linux OS
1
Host machine for cross-compiling and load image
AP Router
1
Provide Internet access to AWS Cloud Server
2.2.2
SoftwarePreparation
Table 2.2: Software Preparation
Name
Quantity
Comment
Tera Term
1
Or similar serial terminals.
2.3
AWS IoT Settings
2.3.1
AWS account and permissions
You need an AWS account, an IAM user with permission to access AWS IoT and FreeRTOS cloud services.
Please complete the instructions in Setting up your AWS account and permissions .
2.3.2
Register with AWS IoT
To register your board with AWS IoT, you need the following:
An AWS IoT policy The AWS IoT policy grants your device permissions to access AWS IoT resources. It is
stored on the AWS Cloud.
An AWS IoT thing An AWS IoT thing allows you to manage your devices in AWS IoT. It is stored on the AWS
Cloud.
A private key and X.509 certificate The private key and certificate allow your device to authenticate with AWS
IoT.
Please follow the procedures in Registering your MCU board with AWS IoT to register your board manually.

6
CHAPTER
THREE
BUILD THE AWS FREEERTOS SDK
The below steps were verified on Ubuntu x86_64 GNU/Linux OS.
3.1
Set up development environment
1.
Install the required packages
2.
Install the gcc-arm-none-eabi toolchain.
3.
make sure that the cmake version is after 3.15 and python version is 2.7
Note: You can download the latest version of CMake from CMake.org . Both source and binary distributions are
available.
You can download the specific release of Python from Python.org .
3.2
Get the AWS FreeeRTOS SDK
Clone the amazon-freertos from gitub
cd amazon-freertos
git checkout origin/202002.00 -b 202002.00
git submodule update --init --recursive
cd ..
python --version
Python 2.7.17
cmake --version
cmake version 3.15.3
wget https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q3-update/+download/gcc-
C→arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2
tar -vxf gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2
# Add gcc-arm-none-eabi-gcc toolchain to System PATH
PATH="$PATH:~/gcc-arm-none-eabit-4_9_2015_q3/bin"
sudo apt-get install lib32ncursesw5 lib32z1 lib32ncurses5 libbz2-1.0:i386
C→
libncurses5-dev lib32ncurses5-dev libncursesw5-dev

3.3. AWS FreeeRTOS SDK Modifications
7
TypeABR AWS FreeRTOS SDK Getting Started Guide
3.3
AWS FreeeRTOS SDK Modifications
1.
Modify board file for TypeABR module
Modifybelowsettingsinmw300_rd.clocatedinaws_freertos/vendors/marvell/WMSDK/mw320/sdk/src/boards
51
52
53
54
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
2.
Modify the WiFi AP SSID and PASSWORD in SDK
Modifybelowsettingsinamazon-freertos/demos/include/aws_clientcredential.h
58 #define clientcredentialWIFI_SSID
"TestAP"
64 #define clientcredentialWIFI_PASSWORD "12345678"
Modify the security if needed.
74 #define clientcredentialWIFI_SECURITY
eWiFiSecurityWPA2
3.
Modify the AWS Ting Name and endpoint in SDK
Modifybelowsettingsinamazon-freertos/demos/include/aws_clientcredential.h
34
41
4.
Modify AWS Thing cert and private key
modify below setting in amazon-freertos/demos/include/aws_clientcredential_keys.h with the cert and private
key download from AWS-IoT.
39
#define keyCLIENT_CERTIFICATE_PEM
"-----BEGIN CERTIFICATE-----\n"\
40
"...base64 data...\n"\
41
"-----END CERTIFICATE-----\n"
void
board_uart_pin_config(
int
id)
{ switch (id)
{ case UART0_ID:
GPIO_PinMuxFun(GPIO_2, GPIO2_UART0_TXD);
GPIO_PinMuxFun(GPIO_3, GPIO3_UART0_RXD);
GPIO_PinMuxFun(GPIO_0, GPIO0_UART0_CTSn);
GPIO_PinMuxFun(GPIO_1, GPIO1_UART0_RTSn);
break;
case UART1_ID:
break;
case UART2_ID:
break;
}
}
#define clientcredentialMQTT_BROKER_ENDPOINT
C→
ap-northeast-1.amazonaws.com"
"xxxxxxxxxxxxxx-ats.iot.
return false;
int
board_32k_osc()
{
}
/* Not implemented yet */
GPIO_PinMuxFun(GPIO_48, GPIO48_UART2_TXD);
GPIO_PinMuxFun(GPIO_49, GPIO49_UART2_RXD);
#define clientcredentialIOT_THING_NAME "aws_demo_led"

8
3.4. Build the AWS demos firmware
TypeABR AWS FreeRTOS SDK Getting Started Guide
60
#define keyCLIENT_PRIVATE_KEY_PEM
"-----BEGIN CERTIFICATE-----\n"\
61
"...base64 data...\n"\
62
"-----END CERTIFICATE-----\n"
3.4
Build the AWS demos firmware
The firmware file aws_demos.bin is located in build after below commands.
cd amazon-freertos
cmake -DVENDOR=marvell -DBOARD=mw320 -DCOMPILER=arm-gcc -S . -B build -DAFR_ENABLE_
C→
TESTS=0
cd build
make all -j4

9
CHAPTER
FOUR
RUN THE FIRMWARE
4.1
Download the firmwares
Using below commands to download the firmwares into TypeABR module.
4.2
Run the FreeRTOS demo project
Press the RST button to reset the device and start booting the application. Some logs will output on UART0.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
export DEBUG_INTERFACE=jlink
./vendors/marvell/WMSDK/mw320/sdk/tools/OpenOCD/flashprog.py -l ./vendors/marvell/
C→WMSDK/mw320/sdk/tools/OpenOCD/mw300/layout.txt --boot2 ./vendors/marvell/WMSDK/
C→mw320/boot2/bin/boot2.bin
./vendors/marvell/WMSDK/mw320/sdk/tools/OpenOCD/flashprog.py --wififw ./vendors/
C→marvell/WMSDK/mw320/wifi-firmware/mw30x/mw30x_uapsta_W14.88.36.p135.bin
./vendors/marvell/WMSDK/mw320/sdk/tools/OpenOCD/flashprog.py --mcufw ./build/
C→marvell/mw320/aws_demos.bin -r
FreeRTOS Started
Application Daemon Startup
Will attempt to start wlan
Wi-Fi module initialized. Connecting to AP...
Registered seed_handler
0 21045 [IP-task] vDHCPProcess: offer c0a8328cip
1
30045 [IP-task] vDHCPProcess: offer c0a8328cip
Network connection successful.
Wi-Fi Connected to AP. Creating tasks which use network...
2
30107 [Startup Hook] Write certificate...
3 30113 [iot_thread] [INFO ][DEMO][30113] ---------STARTING DEMO---------
4
30113 [iot_thread] [INFO ][INIT][30113] SDK successfully initialized.
5
38303 [IP-task] vDHCPProcess: offer c0a8328cip
6
38313 [IP-task] vDHCPProcess: offer c0a8328cip
Network connection successful.
...........
163
42458 [iot_thread] [INFO ][DEMO][42458] Demo completed successfully.
164
42508 [iot_thread] [INFO ][INIT][42508] SDK cleanup done.
165 42508 [iot_thread] [INFO ][DEMO][42508] -------DEMO FINISHED-------

10
4.3. Monitoring MQTT messages on the cloud
TypeABR AWS FreeRTOS SDK Getting Started Guide
4.3
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.
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.
Fig. 4.1: AWS-IoT Cloud Device connection status

11
CHAPTER
FIVE
LASTWILLANDTESTAMENT
TypeABR module have passed all of the required FreeRTOS qualification tests. However, some modifications are
required to pass the LastWillAndTestament test case.
This test case requires plenty of heap memory for two MQTT connection, so the default configuration needs to be
modified to reduce the firmware size and release more memory.
5.1
Reference Solution
Here is a solution for reference.
Note: This LastWillAndTestament should be tested alone.
1.
Modify the AWS Iot Test configuration files
•
tests/common/aws_test_runner.c updated/tests/common/aws_test_runner.c
103
104
105
106
107
108
109
110
•
libraries/c_sdk/standard/mqtt/test/system/iot_tests_mqtt_system.c
716
717
718
719
720
721
722
723
724
725
726
•
vendors/marvell/boards/mw300_rd/aws_tests/config_files/aws_test_runner_config.h
TEST(MQTT_System, LastWillAndTestament)/libraries/c_sdk/standard/mqtt/test/system/
C
→
io
//RUN_TEST_GROUP( MQTT_Unit_Validate );
//RUN_TEST_GROUP( MQTT_Unit_Subscription );
//RUN_TEST_GROUP( MQTT_Unit_Receive );
//RUN_TEST_GROUP( MQTT_Unit_API );
//RUN_TEST_GROUP( MQTT_Unit_Metrics );
#if ( testrunnerFULL_MQTTv4_ENABLED == 1 )
RUN_TEST_GROUP( MQTT_System );
#endif /* if ( testrunnerFULL_MQTTv4_ENABLED == 1 ) */
//RUN_TEST_CASE( MQTT_System, SubscribePublishWaitQoS0 );
//RUN_TEST_CASE( MQTT_System, SubscribePublishWaitQoS1 );
//RUN_TEST_CASE( MQTT_System, SubscribePublishAsync );
//RUN_TEST_CASE( MQTT_System, RestorePreviousSession );
//RUN_TEST_CASE( MQTT_System, WaitAfterDisconnect );
//RUN_TEST_CASE( MQTT_System, SubscribeCompleteReentrancy );
//RUN_TEST_CASE( MQTT_System, IncomingPublishReentrancy )
TEST_GROUP_RUNNER( MQTT_System )
{
RUN_TEST_CASE( MQTT_System, LastWillAndTestament );
}

12
5.1. Reference Solution
TypeABR AWS FreeRTOS SDK Getting Started Guide
35
#define
testrunnerFULL_OTA_CBOR_ENABLED
0
36
#define
testrunnerFULL_OTA_AGENT_ENABLED
0
37
#define
testrunnerFULL_OTA_PAL_ENABLED
0
38
#define
testrunnerFULL_MQTT_ALPN_ENABLED
0
39
#define
testrunnerFULL_PKCS11_ENABLED
0
40
#define
testrunnerFULL_CRYPTO_ENABLED
0
41
#define
testrunnerFULL_MQTT_STRESS_TEST_ENABLED
0
42
#define
testrunnerFULL_MQTT_AGENT_ENABLED
0
43
#define
testrunnerFULL_TCP_ENABLED
0
44
#define
testrunnerFULL_GGD_ENABLED
0
45
#define
testrunnerFULL_GGD_HELPER_ENABLED
0
46
#define
testrunnerFULL_SHADOW_ENABLED
0
47
#define
testrunnerFULL_MQTTv4_ENABLED
1
48
#define
testrunnerFULL_WIFI_ENABLED
0
49
#define
testrunnerFULL_MEMORYLEAK_ENABLED
0
50
#define
testrunnerFULL_TLS_ENABLED
0
51
#define
testrunnerFULL_HTTPS_CLIENT_ENABLED
0
2.
Modifythe MbedTLS Configuration in libraries/3rdparty/mbedtls/include/mbedtls/config.h.
579
586
593
687
720
966
1180
1250
1570
3.
ModifyFreeRTOSConfigurationsinvendors/marvell/boards/mw300_rd/aws_tests/config_files/FreeRTOSConfig.h.
54
115
3. ModifyIoT Configurations invendors/marvell/boards/mw300_rd/aws_tests/config_files/iot_config.h.
28
//#define MBEDTLS_CIPHER_MODE_CBC
//#define MBEDTLS_CIPHER_MODE_CFB
//#define MBEDTLS_CIPHER_MODE_CTR
//#define MBEDTLS_REMOVE_ARC4_CIPHERSUITES
//#define MBEDTLS_ECP_NIST_OPTIM
//#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
//#define MBEDTLS_PK_RSA_ALT_SUPPORT
//#define MBEDTLS_SSL_ALL_ALERT_MESSAGES
//#define MBEDTLS_SSL_SERVER_NAME_INDICATION
#define configMAX_PRIORITIES ( 5 )
#define configTIMER_QUEUE_LENGTH 3
#define IOT_THREAD_DEFAULT_STACK_SIZE 2840

5.2. Reference Patches
13
TypeABR AWS FreeRTOS SDK Getting Started Guide
5.2
Reference Patches
The provided patch files can also be used to complete the above reference solution for code changes.
•
murata_typeabr_module_board_for_amazon-freertos.patch: This patch file is used for
modifying the board file for murata TypeABR module.
•
murata_typeabr_fixs_LastWillAndTestament_for_amazon-freertos.patch
: This
patch file is used for modifying the SDK files to pass the LastWillAndTestament test.
Note: The above patch files were generated based on amazon-freertos released tag 202002.00.
To apply the patch, follow these steps:
Apply the first patch to run all the Amazon Freertos certification test. Then all the test results will be shown PASS
exceptLastWillAndTestament.
Apply the second patch, and this LastWillAndTestament will be tested alone, then test result for LastWil-
lAndTestament will be PASS .
5.3
Reference Running Logs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
~# cd /path/to/amazon-freertos-202002.00
~
# cat /path/to/murata_typeabr_xxx.patch | patch -p1
FreeRTOS Started
Application Daemon Startup
Registered seed_handler
0 328 [Startup Hook] Write certificate...
Will attempt to start wlan
Wi-Fi module initialized. Connecting to AP...
1
24000 [IP-task] vDHCPProcess: offer c0a8328cip
2
33004 [IP-task] vDHCPProcess: offer c0a8328cip
Network connection successful.
Wi-Fi Connected to AP. Creating tasks which use network...
---------STARTING TESTS---------
3
36022 [IP-task] vDHCPProcess: offer c0a8328cip
4
36031 [IP-task] vDHCPProcess: offer c0a8328cip
Network connection successful.
5
41102 [RunTests_task] DNS[0x1525B8]: The answer to Node (36f92182ip) will be
C→
stored
6
41102 [RunTests_task] DNS[0x1525B8]: The answer to Node (34c40b9cip) will be
C→
stored
TEST(MQTT_System, LastWillAndTestament) PASS
-----------------------
1 Tests 0 Failures 0 Ignored
OK
-------ALL TESTS FINISHED-------

14
CHAPTER
SIX
PRECONDITION TO USE OUR PRODUCTS
PLEASE READ THIS NOTICE BEFORE USING OUR PRODUCTS.
Please make sure that your product has been evaluated and confirmed from the aspect of the fitness for the speci-
fications of our product when our product is mounted to your product.
All the items and parameters in this product specification/datasheet/catalog have been prescribed on the premise
that our product is used for the purpose, under the condition and in the environment specified in this specification.
You are requested not to use our product deviating from the condition and the environment specified in this
specification.Please note that the only warranty that we provide regarding the products is its conformance to the
specifications provided herein.Accordingly, we shall not be responsible for any defects in products or equipment
incorporating such products, which are caused under the conditions other than those specified in this specification.
WE HEREBY DISCLAIMS ALL OTHER WARRANTIES REGARDING THE PRODUCTS, EXPRESS OR
IMPLIED, INCLUDING WITHOUT LIMITATION ANY WARRANTY OF FITNESS FOR A PARTICULAR
PURPOSE, THAT THEY ARE DEFECT-FREE, OR AGAINST INFRINGEMENT OF INTELLECTUAL PROP-
ERTY RIGHTS.
The product shall not be used in any application listed below which requires especially high reliability for the
prevention of such defect as may directly cause damage to the third partys life, body or property. You acknowledge
and agree that, if you use our products in such applications, we will not be responsible for any failure to meet
such requirements. Furthermore, YOU AGREE TO INDEMNIFY AND DEFEND US AND OUR AFFILIATES
AGAINST ALL CLAIMS, DAMAGES, COSTS, AND EXPENSES THAT MAY BE INCURRED, INCLUDING
WITHOUT LIMITATION, ATTORNEY FEES AND COSTS, DUE TO THE USE OF OUR PRODUCTS IN
SUCHAPPLICATIONS.
•
Aircraftequipment.
•
Aerospaceequipment
•
Underseaequipment.
•
Power plant control equipment
•
Medicalequipment.
•
Transportation equipment (vehicles, trains, ships, elevator, etc.).
•
Traffic signal equipment.
•
Disaster prevention / crime prevention equipment.
•
Burning / explosion control equipment
•
Application of similar complexity and/ or reliability requirements to the applications listed in the above.
We expressly prohibit you from analyzing, breaking, reverse-engineering, remodeling altering, and reproducing
our product. Our product cannot be used for the product which is prohibited from being manufactured, used, and
sold by the regulations and laws in the world. We do not warrant or represent that any license, either express
or implied, is granted under any our patent right, copyright, mask work right, or our other intellectual property
right relating to any combination, machine, or process in which our products or services are used. Information
provided by us regarding third-party products or services does not constitute a license from us to use such products
or services or a warranty or endorsement thereof. Use of such information may require a license from a third party
under the patents or other intellectual property of the third party, or a license from us under our patents or other

TypeABR AWS FreeRTOS SDK Getting Started Guide
intellectual property. Please do not use our products, our technical information and other data provided by us
for the purpose of developing of mass-destruction weapons and the purpose of military use. Moreover, you must
comply with foreign exchange and foreign trade law, the U.S. export administration regulations, etc. Please note
that we may discontinue the manufacture of our products, due to reasons such as end of supply of materials and/or
components from our suppliers. By signing on specification sheet or approval sheet, you acknowledge that you
are the legal representative for your company and that you understand and accept the validity of the contents
herein. When you are not able to return the signed version of specification sheet or approval sheet within 30
days from receiving date of specification sheet or approval sheet, it shall be deemed to be your consent on the
content of specification sheet or approval sheet. Customer acknowledges that engineering samples may deviate
from specifications and may contain defects due to their development status. We reject any liability or product
warranty for engineering samples. In particular we disclaim liability for damages caused by
•
the use of the engineering sample other than for evaluation purposes, particularly the installation or integra-
tion in the product to be sold by you,
•
deviation or lapse in function of engineering sample,
•
improper use of engineering samples.
We disclaim any liability for consequential and incidental damages. If you cant agree the above contents, you
should inquire our sales.
15
This manual suits for next models
1
Table of contents
Other Murata Control Unit manuals

Murata
Murata LBAD0ZZ1SE User manual

Murata
Murata LBAD0ZZ1SE-743 User manual

Murata
Murata 1PJ User manual

Murata
Murata LBAA0QB1SJ User manual

Murata
Murata SEM2411D User manual

Murata
Murata PKGX-14-4010 User manual

Murata
Murata LBEE5HY2DU User manual

Murata
Murata LBEE5PK2AE User manual

Murata
Murata Type1LD User manual

Murata
Murata LBUA5QJ2AB User manual