Good Way TM51010 User manual

TM51010 Wi-Fi & BLE M.2 Wireless Module Getting Started Guide
Getting Started Guide
All information provided in this document is subject to legal disclaimers.
1
© Good Way 2020. All rights reserved.
TM51010 Wi-Fi & BLE M.2 Wireless Module
Amazon FreeRTOS Getting Started Guide
Good Way Technology Co., Ltd.
3F, No. 135, Ln. 235, Baociao Rd., Sindian Dist., New Taipei City 231, Taiwan
Tel: +886- 2-8919-1200, Fax: +886- 2-8919-1220
www.gtrend-auto.com

TM51010 Wi-Fi & BLE M.2 Wireless Module Getting Started Guide
Getting Started Guide
All information provided in this document is subject to legal disclaimers.
2
© Good Way 2020. All rights reserved.
COPYRIGHT
© 2020 Good Way Technology Co., Ltd. All rights reserved. No part of this document may be reproduced, transmitted, transcribed, stored in a
retrieval system, or translated into any language in any form or by any means without the written permission of Good Way Technology Co., Ltd.
DISCLAIMER
Please Read Carefully:
Good Way Technology Co., Ltd., (Good Way) reserves the right to make corrections, enhancements, improvements and other changes to its
products and services. Buyers should obtain the latest relevant information before placing orders and should verify that such information is
current and complete.
Reproduction of significant portions in Good Way data sheets is permissible only if reproduction is without alteration and is accompanied by all
associated warranties, conditions, limitations, and notices. Good Way is not responsible or liable for such reproduced documentation.
Information of third parties may be subject to additional restrictions.
Buyers and others who are developing systems that incorporate Good Way products (collectively, “Customers”) understand and agree that
Customers remain responsible for using their independent analysis, evaluation and judgment in designing their applications and that
Customers have full and exclusive responsibility to assure the safety of Customers' applications and compliance of their applications (and of all
Good Way products used in or for Customers’ applications) with all applicable regulations, laws and other applicable requirements. Designer
represents that, with respect to their applications, Customer has all the necessary expertise to create and implement safeguards that (1)
anticipate dangerous consequences of failures, (2) monitor failures and their consequences, and (3) lessen the likelihood of failures that might
cause harm and take appropriate actions. Customer agrees that prior to using or distributing any applications that include Good Way products,
Customer will thoroughly test such applications and the functionality of such Good Way products as used in suchapplications.
Good Way’s provision of technical, application or other design advice, quality characterization, reliability data or other services or
information, including, but not limited to, reference designs and materials relating to evaluation kits, (collectively, “Resources”) are
intended to assist designers who are developing applications that incorporate Good Way products; by downloading, accessing or using
Good Way’s Resources in any way, Customer (individually or, if Customer is acting on behalf of a company, Customer’s company) agrees to
use any particular Good Way Resources solely for this purpose and subject to the terms of this Notice.
Good Way’s provision of Good Way Resources does not expand or otherwise alter Good Way’s applicable published warranties or warranty
disclaimers for Good Way’s products, and no additional obligations or liabilities arise from Good Way providing such Good Way Resources.
Good Way reserves the right to make corrections, enhancements, improvements and other changes to its Good Way Resources. Good Way
has not conducted any testing other than that specifically described in the published documentation for a particular Good Way Resource.
Customer is authorized to use, copy and modify any individual Good Way Resource only in connection with the development of applications that
include the Good Way product(s) identified in such Good Way Resource. No other license, express or implied, by estoppel or otherwise to any
other Good Way intellectual property right, and no license to any technology or intellectual property right of Good Way or any third party is
granted herein, including but not limited to any patent right, copyright, mask work right, or other intellectual property right relating to any
combination, machine, or process in which Good Way products or services are used. Information regarding or referencing third-party products
or services does not constitute a license to use such products or services, or a warranty or endorsement thereof. Use of Good Way Resources
may require a license from a third party under the patents or other intellectual property of the third party, or a license from Good Way under
the patents or other Good Way’s intellectual property.
Good Way’s Resources are provided “as is” and with all faults. Good Way disclaims all other warranties or representations, express or implied,
regarding resources or use thereof, including but not limited to accuracy or completeness, title, any epidemic failure warranty and any implied
warranties of merchantability, fitness for a particular purpose, and non-infringement of any third party intellectual property rights.
Good Way shall not be liable for and shall not defend or indemnify Customer against any claim, including but not limited to any infringement
claim that related to or is based on any combination of products even if described in Good Way Resources or otherwise. In no event shall Good
Way be liable for any actual, direct, special, collateral, indirect, punitive, incidental, consequential or exemplary damages in connection with or
arising out of Good Way’s Resources or use thereof, and regardless of whether Good Way has been advised of the possibility of such damages.
Good Way is not responsible for any failure to meet such industry standard requirements.
Where Good Way specifically promotes products as facilitating functional safety or as compliant with industry functional safety standards, such
products are intended to help enable customers to design and create their own applications that meet applicable functional safety standards
and requirements. Using products in an application does not by itself establish any safety features in the application. Customers must ensure
compliance with safety-related requirements and standards applicable to their applications. Designer may not use any Good Way products in
life- critical medical equipment unless authorized officers of the parties have executed a special contract specifically governing such use. Life-
critical medical equipment is medical equipment where failure of such equipment would cause serious bodily injury or death. Such equipment
includes, without limitation, all medical devices identified by the U.S.FDA as Class III devices and equivalent classifications outside the U.S.

TM51010 Wi-Fi & BLE M.2 Wireless Module Getting Started Guide
Getting Started Guide
All information provided in this document is subject to legal disclaimers.
3
© Good Way 2020. All rights reserved.
Customers agree that it has the necessary expertise to select the product with the appropriate qualification designation for their applications
and that proper product selection is at Customers’ own risk. Customers are solely responsible for compliance with all legal and regulatory
requirements in connection with such selection.
Customer will fully indemnify Good Way and its representatives against any damages, costs, losses, and/or liabilities arising out of Designer’s non-
compliance with the terms and provisions of this Notice.
TRADEMARKS
Good Way is a trademark of Good Way Technology Co., Ltd. Other names mentioned in this document are trademarks/registered trademarks
of their respective owners.
USING THIS DOCUMENT
Though every effort has been made to ensure that this document is current and accurate, more information may have become available
subsequent to the production of this guide.

TM51010 Wi-Fi & BLE M.2 Wireless Module Getting Started Guide
Getting Started Guide
All information provided in this document is subject to legal disclaimers.
4
© Good Way 2020. All rights reserved.
Table of Contents
1TM51010 Wi-Fi & BLE M.2 Wireless Module ........................................................................................................ 5
1.1 Wi-Fi & BLE M.2 Wireless Module ...................................................................................................................................5
1.2 PCB Layout Overview .......................................................................................................................................................6
1.3 Pin Out..............................................................................................................................................................................6
1.4 M.2 Pin Assignment .........................................................................................................................................................7
1.5 LOGUART and SWD ..........................................................................................................................................................9
2Configure AWS IoT Core .................................................................................................................................... 10
2.1 Create a New Device ......................................................................................................................................................10
2.2 Create a policy................................................................................................................................................................13
2.3 Attach Policy...................................................................................................................................................................14
3Configure TM51010 Amazon FreeRTOS.............................................................................................................. 17
3.1 Download Source Code from github..............................................................................................................................17
3.1.1
Cloning a repository by Download ZIP ...........................................................................................................................18
3.2 Get Broker Endpoint by AWS IoT Core...........................................................................................................................19
3.4.1
Setup Thing’s Private Key and Certificate ......................................................................................................................20
3.4.2
Enable FreeRTOS demo on TM51010 ............................................................................................................................22
4Compile TM51010 Amazon FreeRTOS ................................................................................................................ 23
4.1 IAR Build Environment Setup .........................................................................................................................................23
4.2Pre-Requisite..................................................................................................................................................................23
4.3 How to Use IAR SDK .......................................................................................................................................................23
4.3.1
IAR Project Introduction.................................................................................................................................................23
4.3.2
IAR Build .........................................................................................................................................................................23
5ImageTool ........................................................................................................................................................ 27
5.1 Introduction ...................................................................................................................................................................27
5.2 Environment Setup.........................................................................................................................................................28
5.2.1
Hardware Setup .............................................................................................................................................................28
5.2.2
Software Setup...............................................................................................................................................................28
5.3 Download .......................................................................................................................................................................29
5.3.1
Image Download ............................................................................................................................................................29
6MQTT Demo ..................................................................................................................................................... 31
6.1 Get Device Log................................................................................................................................................................31
6.2 Run MQTT Demo............................................................................................................................................................32
6.3 Monitoring MQTT messages on the cloud .....................................................................................................................33
7Troubleshooting ............................................................................................................................................... 35
7.1 Flashloader download fail ..............................................................................................................................................35
7.2 ERROR: Invalid Key .........................................................................................................................................................36
7.3 Failed to establish new MQTT connection.....................................................................................................................36
7.4 TLS_Connect fail.............................................................................................................................................................36

TM51010 Wi-Fi & BLE M.2 Wireless Module Getting Started Guide
Getting Started Guide
All information provided in this document is subject to legal disclaimers.
5
© Good Way 2020. All rights reserved.
1TM51010 Wi-Fi & BLE M.2 Wireless Module
1.1 Wi-Fi & BLE M.2 Wireless Module
TM51010 Wi-Fi & BLE M.2 Wireless Module web page: http://www.gtrend-auto.com/products-M2-Mesh-Controller-Board.asp
The Wi-Fi & BLE M.2 Wireless Module is a powerful, generic Wi-Fi/BLE Board based on highly integrated Realtek RTL8720DN and Nordic nRF52832
MCU with built-in security features and ultra-low power consumption. The embedded system product developers and device makers can now
drastically shorten their development cycle and reduce time to market by using Good Way Wi-Fi & BLE M.2 Wireless Module.
Features
IPEX antenna design for Wi-Fi and BLE to ensure better RF performance
Wi-Fi MCU with Amazon FreeRTOS to support Cloud service securely
Benefits
Android SDK of BLE Mesh ready for fast installation and via Smartphone to ensure better user experience
Multi-Threading optimization to speed up network distribution process by saving time 1.5x than SIG Mesh
Specifications
Wi-Fi
Network Standards
IEEE 802.11 a/b/g/n 1x1
Operating Frequency
2.4GHz & 5GHz
Data Rate
Up to 150Mbps
Antenna
IPEX connector for external antenna
Bluetooth LE
RF Protocol
BLE SIG Mesh
Operating Frequency
2.4GHz
Operation Range
30m (indoor open space)
Antenna
IPEX connector for external antenna
M.2 Interface
VCC
support 3.3V
USB
x1
I2C
x1
GPIO
x15
Others
Dimensions (L x W x H)
45 x 32 x 5.8mm
Operating Temp.
-20°C to +85°C

TM51010 Wi-Fi & BLE M.2 Wireless Module Getting Started Guide
Getting Started Guide
All information provided in this document is subject to legal disclaimers.
6
© Good Way 2020. All rights reserved.
1.2 PCB Layout Overview
The PCB layout is shown in Fig 1-1
Fig 1-1 PCB layout
1.3 Pin Out
The pin out board is shown in Fig 1-2.
Fig 1-2 pin out
There are two rows of pins on the board.
The pins in the red box are include VCC, GND, GPIO, I2C and USB.
The pins in the gray box are include programmable and debug.

TM51010 Wi-Fi & BLE M.2 Wireless Module Getting Started Guide
Getting Started Guide
All information provided in this document is subject to legal disclaimers.
7
© Good Way 2020. All rights reserved.
1.4 M.2 Pin Assignment
The M.2 pin number mapping is shown in Fig 1-3.
Fig 1-3 M.2 pin number mapping
TOP View
Bottom View
TOP View
Bottom View

TM51010 Wi-Fi & BLE M.2 Wireless Module Getting Started Guide
Getting Started Guide
All information provided in this document is subject to legal disclaimers.
8
© Good Way 2020. All rights reserved.
Pin Assignment
Pin No.
Pin Name
Pin Description
Pin No.
Pin Name
Pin Description
1
GND
Power Ground
39
GND
Ground
2
VDD_3V3
Power supply voltage 3.3V
40
GPIO
General Purpose Input/Output
3
GND
Power Ground
41
NC
No Connection
4
VDD_3V3
Power supply voltage 3.3V
42
GPIO
General Purpose Input/Output
5
NC
No Connection
43
NC
No Connection
6
USB_DP
USB_DP
44
GPIO
General Purpose Input/Output
7
NC
No Connection
45
GND
Power Ground
8
USB_DN
USB_DN
46
GPIO
General Purpose Input/Output
9
GND
Power Ground
47
NC
No Connection
10
NC
No Connection
48
GPIO
General Purpose Input/Output
11
NC
No Connection
49
NC
No Connection
12
VDD_3V3
Power supply voltage 3.3V
50
GPIO
General Purpose Input/Output
13
NC
No Connection
51
GND
Power Ground
14
VDD_3V3
Power supply voltage 3.3V
52
GPIO
General Purpose Input/Output
15
GND
Power Ground
53
NC
No Connection
16
VDD_3V3
Power supply voltage 3.3V
54
GPIO
General Purpose Input/Output
17
NC
No Connection
55
NC
No Connection
18
VDD_3V3
Power supply voltage 3.3V
56
GPIO
General Purpose Input/Output
19
NC
No Connection
57
GND
Power Ground
20
I2C_SCL
I2C Clock
58
NC
No Connection
21
GND
Power Ground
59
Notch
22
I2C_SDA
I2C DATA
60
Notch
23
NC
No Connection
61
Notch
24
GPIO
General Purpose Input/Output
62
Notch
25
NC
No Connection
63
Notch
26
GPIO
General Purpose Input/Output
64
Notch
27
GND
Ground
65
Notch
28
GPIO
General Purpose Input/Output
66
Notch
29
NC
No Connection
67
NC
No Connection
30
GPIO
General Purpose Input/Output
68
NC
No Connection
31
NC
No Connection
69
NC
No Connection
32
GPIO
General Purpose Input/Output
70
VDD_3V3
Power supply voltage 3.3V
33
GND
Power Ground
71
GND
Power Ground
34
GPIO
General Purpose Input/Output
72
VDD_3V3
Power supply voltage 3.3V
35
NC
No Connection
73
GND
Power Ground
36
NC
No Connection
74
VDD_3V3
Power supply voltage 3.3V

TM51010 Wi-Fi & BLE M.2 Wireless Module Getting Started Guide
Getting Started Guide
All information provided in this document is subject to legal disclaimers.
9
© Good Way 2020. All rights reserved.
37
NC
No Connection
75
GND
Power Ground
38
GPIO
General Purpose Input/Output
1.5 LOGUART and SWD
The LOGUART and SWD board pin mapping is shown in Fig 1-4.
Fig 1-4 Pin number mapping
Pin Assignment
Pin No.
Pin Name
Pin Description
1
VDD_3V3
Power supply voltage 3.3V
2
WIFI_UART_LOG_OUT
For WIFI debug and programming, Data out.
3
WIFI_UART_LOG_IN
For WIFI debug and programming, Data in.
4
GND
Power Ground
5
WIFI_SWDIO
For WIFI debug and programming, Serial wire I/O.
6
WIFI_SWCLK
For WIFI debug and programming, Serial wire clock input.
7
WIFI_RESET
Set this pin low reset WIFI.
8
NC
No Connection
9
BLE_SWCLK
For BLE debug and programming, Serial wire clock input.
10
BLE_SWDIO
For BLE debug and programming, Serial wire I/O.
11
GND
Power Ground
12
NC
No Connection
13
NC
No Connection
14
NC
No Connection

TM51010 Wi-Fi & BLE M.2 Wireless Module Getting Started Guide
Getting Started Guide
All information provided in this document is subject to legal disclaimers.
10
© Good Way 2020. All rights reserved.
2Configure AWS IoT Core
2.1 Create a New Device
To create a new device, navigate to Manage -> Things in the left-hand navigation menu. Then click “Register a thing”.

TM51010 Wi-Fi & BLE M.2 Wireless Module Getting Started Guide
Getting Started Guide
All information provided in this document is subject to legal disclaimers.
11
© Good Way 2020. All rights reserved.
Then, name the new device. This example uses the name TestDevice.

TM51010 Wi-Fi & BLE M.2 Wireless Module Getting Started Guide
Getting Started Guide
All information provided in this document is subject to legal disclaimers.
12
© Good Way 2020. All rights reserved.
Download the certificate, public key, and private key for the device by clicking Download. Next, download the root CA for AWS IoT by clicking
to the Download link. Once all the certificate and keys have been downloaded, click Activate. Finally, click Done
1
2
3
4

TM51010 Wi-Fi & BLE M.2 Wireless Module Getting Started Guide
Getting Started Guide
All information provided in this document is subject to legal disclaimers.
13
© Good Way 2020. All rights reserved.
2.2 Create a policy
A policy defines a device’s access permissions to IoT Core. To create a policy, navigate to Secure -> Policies. Then click “Create a policy”
NOTE –this policy grants unrestricted access for all iot operations, and is to be used only in a development environment. For non-dev
environments, all devices in your fleet must have credentials with privileges that authorize intended actions only, which include (but not
limited to) AWS IoT MQTT actions such as publishing messages or subscribing to topics with specific scope and context. The specific permission
policies can vary for your use cases. Identify the permission policies that best meet your business and security requirements.
For sample policies, refer to https://docs.aws.amazon.com/iot/latest/developerguide/example-iot-policies.html.
Also refer to https://docs.aws.amazon.com/iot/latest/developerguide/security-best-practices.html

TM51010 Wi-Fi & BLE M.2 Wireless Module Getting Started Guide
Getting Started Guide
All information provided in this document is subject to legal disclaimers.
14
© Good Way 2020. All rights reserved.
2.3 Attach Policy
The last step to configuring the device is attaching a policy. To attach a policy to new device, navigate to Manage -> Things. Then click on the
device which was created.

TM51010 Wi-Fi & BLE M.2 Wireless Module Getting Started Guide
Getting Started Guide
All information provided in this document is subject to legal disclaimers.
15
© Good Way 2020. All rights reserved.
Click Security, then click the certificate create in previous step.

TM51010 Wi-Fi & BLE M.2 Wireless Module Getting Started Guide
Getting Started Guide
All information provided in this document is subject to legal disclaimers.
16
© Good Way 2020. All rights reserved.

TM51010 Wi-Fi & BLE M.2 Wireless Module Getting Started Guide
Getting Started Guide
All information provided in this document is subject to legal disclaimers.
17
© Good Way 2020. All rights reserved.
3Configure TM51010 Amazon FreeRTOS
3.1 Download Source Code from github
Open source link: https://github.com/GoodWayDev/amazon-freertos and select main to get newest source code. TM51010 also support
v202002, please find source in “TM51010-v202002” branch.

TM51010 Wi-Fi & BLE M.2 Wireless Module Getting Started Guide
Getting Started Guide
All information provided in this document is subject to legal disclaimers.
18
© Good Way 2020. All rights reserved.
3.1.1
Cloning a repository by Download ZIP
1. On GitHub, navigate to the main page of the repository.
2. Above the list of files, click Code.
3. Click Download ZIP to get source code.
For more information, please refer "Cloning a repository from GitHub to GitHub Desktop."

TM51010 Wi-Fi & BLE M.2 Wireless Module Getting Started Guide
Getting Started Guide
All information provided in this document is subject to legal disclaimers.
19
© Good Way 2020. All rights reserved.
3.2 Get Broker Endpoint by AWS IoT Core
3.3 Get Thing Name
Broker Endpoint
Thing Name

TM51010 Wi-Fi & BLE M.2 Wireless Module Getting Started Guide
Getting Started Guide
All information provided in this document is subject to legal disclaimers.
20
© Good Way 2020. All rights reserved.
3.4 Setup IoT Core Information with TM51010 Amazon FreeRTOS
Setup BROKER_ENDPOINT, THING_NAME, WIFI_SSID, PASSWORD in “amazon-
freertos/demos/include/aws_clientcredential.h”
3.4.1
Setup Thing’s Private Key and Certificate
Filled keyCLIENT_CERTIFICATE_PEM and keyCLIENT_PRIVATE_KEY_PEM in “ambd_amazon- freertos/
demos/include/aws_clientcredential_keys.h” by xxxxxxxx-certifiacte.pem and xxxxxxxx-private.pem.key.
It can done by amazon-freertos/tools/certificate_configuration/CertificateConfigurator.html
Table of contents
Other Good Way Storage manuals
Popular Storage manuals by other brands

Partners
Partners SurfRAID TRITON Mini user manual

Western Digital
Western Digital Ultrastar Serv60+8 user guide

Seagate
Seagate ST9160511NS - Constellation 7200 160 GB Hard... Product overview

Sonnen
Sonnen sonnenBatterie hybrid 8.1/6 installation instructions

HP
HP StorageWorks NAS 8000 - Version 1.6.X release note

Raidon
Raidon SafeTANK GR3680 Series user manual