MediaTek LinkIt Development Platform Get Started Guide
The MediaTek LinkIt Development Platform is a software development kit (SDK) for developing applications on LinkIt 7687/7697/2523 HDKs. The SDK provides drivers for hardware abstraction layer, peripherals, connectivity like Wi-Fi, Bluetooth, GNSS, sensor subsystem, and other third party features. It also provides battery management, Firmware update Over-The-Air (FOTA) and FreeRTOS.
Advertisement
Advertisement
MediaTek LinkIt™ Development
Platform for RTOS Get Started Guide
Version: 4.2
Release date: 13 January 2017
© 2015 - 2017 MediaTek Inc.
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s). MediaTek cannot grant you permission for any material that is owned by third parties. You may only use or reproduce this document if you have agreed to and been bound by the applicable license agreement with MediaTek (“License Agreement”) and been granted explicit permission within the License
Agreement (“Permitted User”). If you are not a Permitted User, please cease any access or use of this document immediately. Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited. THIS DOCUMENT IS PROVIDED ON AN
“AS-IS” BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES OF ANY KIND AND SHALL IN NO EVENT BE LIABLE FOR ANY
CLAIMS RELATING TO OR ARISING OUT OF THIS DOCUMENT OR ANY USE OR INABILITY TO USE THEREOF. Specifications contained herein are subject to change without notice.
Document Revision History
Revision
1.0
2.0
Date
24 March 2016
17 May 2016
3.0
4.0
4.1
4.2
30 June 2016
2 September 2016
4 November 2016
13 January 2017
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Description
Initial release
•
Flash tool and building the project content is moved to the corresponding documents.
•
Added the support for Keil IDE.
•
Added the support of IAR embedded workbench IDE.
•
More details on the SDK features and usage is included.
•
Updated Section 2 to describe how to use serial emulator software, such as TeraTerm with LinkIt 7687 HDK and LinkIt
2523 HDK.
•
Updated Section 2.4, building the project using the SDK.
•
Added information about 2533D
•
Added note for GCC/KEIL/IAR debugging limitation in sleep mode.
•
Updated file system additional descriptions.
•
Added support for MT76x7 Flash Tool in Linux.
© 2015 - 2017 MediaTek Inc.
Page i of v
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
Table of contents
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Debugging with the LinkIt 7687 HDK from Microsoft Windows ..................................... 23
Debugging with the LinkIt 2523 HDK from Microsoft Windows ..................................... 37
© 2015 - 2017 MediaTek Inc.
Page ii of v
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
© 2015 - 2017 MediaTek Inc.
Page iii of v
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
Lists of tables and figures
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
© 2015 - 2017 MediaTek Inc.
Page iv of v
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
© 2015 - 2017 MediaTek Inc.
Page v of v
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
1.
Overview
MediaTek LinkIt™ software development kit (SDK) v4 provides the software and tools for your application development on LinkIt 7687/7697/2523 HDKs. The SDK includes drivers for hardware abstraction layer, peripherals, connectivity, such as Wi-Fi, Bluetooth/Bluetooth Low Energy, GNSS, sensor subsystem, lightweight IP
(lwIP) and other third party features. It also provides battery management, Firmware update Over-The-Air (FOTA) and FreeRTOS.
This get started guide provides quick steps on how to use the SDK and its supported features on three different environments; default GCC, Keil µvision IDE and IAR embedded workbench IDE.
1.1.
Architecture of the platform
The three-layer architecture of the platform including BSP, Middleware and Application with underlying
components is shown in Figure 1.
Application
(/project)
Example project Demo project Reference design Template project
…
Middleware
(/middleware)
BSP
(/driver & /kernel)
Callback manager
BLE ANCS
HFP
SPP
OBEX
BT notify BLE BAS
GATTS service
Device manager
Bluetooth service
AVRCP
GAP
SDP
Bluetooth EDR
Syslog
(/kernel/service)
PBAP
A2DP
BLE IAS
…
GATT/ATT
GAP
SM
Bluetooth
Low Energy
TFTP
IPerf
XML
DHCP
(C/S)
Open/WEP/
WPA/WPA-PSK
PING
HTTP(S) client
MQTT
TCP/IP
(IPV4/IPV6)
Network
SNTP
HTTP2 client
JSON
WPS
Wi-Fi
Smart connection
DNS client
HTTP server
TLS
AT/STA modes
GDI
HDK implementation
(/driver/board/mtxxxx_hdk )
Bootloader Backlight LED
Touch panel
…
Component
(/driver/board/component)
Physical sensor
Biosensor LCM
Board
(/driver/board)
FreeRTOS
(/kernel/rtos)
Port service
TouchGFX
Sensor subsystem
Battery management
Audio codec
GNSS
FOTA
File system ATCI
LZMA decoder
…
NVDM
…
CMSIS
(/driver/CMSIS)
ADC
EINT
NVIC
Audio
Flash
PWM
ACCDET
G2D
RTC
Crypto
GPIO
SPI
Cache
GPC
GDMA
GPT
TRNG UART
HAL
(/driver/chip)
SD
IRDA
WDT
SDIO
I2C
Keypad
DAC
I2S
USB
Display
ISINK
…
Exception handler
(/kernel/service
)
Figure 1. Architecture layout of the platform
A brief description of the layers is provided below:
•
BSP
o Hardware drivers. Provide peripheral drivers for the platform, such as ADC, I2S, I2C, SPI, RTC, GPIO,
UART, Flash, Security Engine, TRNG, GDMA, PWM, WDT and IRDA TX/RX.
© 2015 - 2017 MediaTek Inc.
Page 1 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
o Hardware Abstraction Layer (HAL). Provides the driver Application Programming Interface (API) encapsulating the low-level functions of peripheral drivers for the operating system (OS),
Middleware features and Application. o The hardware components located at <sdk_root>\driver\board\component are used by the
HDK (<sdk_root>\driver\board\mtxxxx_hdk). For example, the LCM drivers SH1107 and
ST7789H2 located under <sdk_root>\driver\board\component\lcm folder will be available when you select the ST7789H2 LCM on LinkIt 2523 HDK but the GPIO pins need to be configured at
<sdk_root>\driver\board\mt2523_hdk\lcm and also the source files should be included under the component folder. o FreeRTOS . An OS with the open source software for Middleware components and Application. o Syslog. This module implements system logging for development and debugging.
•
Middleware
o Wi-Fi. Provides OS dependent function calls, including Wi-Fi APIs that control the bridge supplicant and network processor messages. o Network. Provides OS dependent features, such as IPv4, Hyper-Text Transfer Protocol (HTTP) client and the Simple Network Time Protocol (SNTP). o Bluetooth/Bluetooth Low Energy. Provides stack and protocol-layer access profiles for data transferring and management control, such as Generic Access Profile (GAP), Serial Port Profile (SPP),
Generic Attribute Profile (GATT) and Security Manager (SM). o
Sensor subsystem. Software framework to interact with sensor drivers and fusion algorithms, including buffer and flow control.
o FOTA. Provides a mechanism to update the firmware. o GNSS. Provides APIs to control the onboard GNSS system. o Battery management. Provides the charging flow control and precise information on battery. o File system. Provides APIs to control data storage and retrieval in a file system. o Other features. Non-Volatile Data Management (NVDM), Extensible Markup Language (XML),
JavaScript Object Notation (JSON) and other features that are dependent on HAL and FreeRTOS.
The LinkIt SDK also supports AT command interface (ATCI) as an advanced feature.
•
Application o Pre-configured projects using Middleware components, such as Wi-Fi station and smart connection.
The application layer enables running the projects that are based on Middleware, FreeRTOS and HAL layers.
These layers provide rich features for application development, such as Middleware provides the network features, Wi-Fi features, and the OS provides the underlying real-time operating system.
The supported HAL features on different chipsets are listed in Table 1.
To use the HAL features, enable the compile options of the corresponding modules.
1)
Open the header file hal_feature_config.h, located under inc folder of each example project.
2)
Edit and define the compile options as needed.
3) Include the corresponding module header files, located at <sdk_root>\driver\chip\inc, in the project source files.
© 2015 - 2017 MediaTek Inc.
Page 2 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
Feature
ADC
ACCDET
AUDIO
Cache
Crypto
Clock
DAC
DVFS
EINT
Flash
GDMA
GPC
GPIO
GPT
I2C Master
I2S
ISINK
IRDA
Keypad
DISPLAY_COLO
R
DISPLAY_DSI
DISPLAY_LCD
DISPLAY_PWM
√
MPU
NVIC
PWM
RTC
SPI Master
SPI Slave
SD
SDIO
√
√
√
√
√
√
√
√
√
√
√
√
√
√
√
√
MT7687
F
√
√
√
√
√
√
√
√
√
√
√
√
√
√
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Table 1. HAL features on different chipsets
√
√
√
MT7697/
MT7697D
√
√
√
√
√
√
√
√
√
√
√
√
√
√
√
√
√
√
√
√
√
√
√
√
√
√
√
√
√
√
MT2523D/
MT2523G
MT2533D Compile option
√
√
√
√
√
√
√
HAL_ADC_MODULE_ENABLED
HAL_ACCDET_MODULE_EANBLED
HAL_AUDIO_MODULE_ENABLED
HAL_CACHE_MODULE_ENABLED
HAL_AES_MODULE_ENABLED
HAL_DES_MODULE_ENABLED
HAL_MD5_MODULE_ENABLED
HAL_SHA_MODULE_ENABLED
HAL_CLOCK_MODULE_ENABLED
HAL_DAC_MODULE_ENABLED
HAL_DVFS_MODULE_ENABLED
HAL_EINT_MODULE_ENABLED
HAL_FLASH_MODULE_ENABLED
HAL_GDMA_MODULE_ENABLED
HAL_GPC_MODULE_ENABLED
HAL_GPIO_MODULE_ENABLED
HAL_GPT_MODULE_ENABLED
HAL_I2C_MASTER_MODULE_ENABLED
HAL_I2S_MODULE_ENABLED
HAL_ISINK_MODULE_ENABLED
HAL_IRRX_MODULE_ENABLED
HAL_IRTX_MODULE_ENABLED
HAL_KEYPAD_MODULE_ENABLED
HAL_DISPLAY_COLOR_MODULE_ENABLE
D
√
√
√
√
√
√
√
√
√
√
√
√
√
√
√
√
√
√
√
√
√
√
HAL_DISPLAY_DSI_MODULE_ENABLED
HAL_DISPLAY_LCD_MODULE_ENABLED
HAL_DISPLAY_PWM_MODULE_ENABLED
HAL_MPU_MODULE_ENABLED
HAL_NVIC_MODULE_ENABLED
HAL_PWM_MODULE_ENABLED
HAL_RTC_MODULE_ENABLED
HAL_SPI_MASTER_MODULE_ENABLED
HAL_SPI_SLAVE_MODULE_ENABLED
HAL_SD_MODULE_ENABLED
HAL_SDIO_MODULE_ENABLED
© 2015 - 2017 MediaTek Inc.
Page 3 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Feature
Sleep Manager
TRNG
UART
USB
WDT
MT7687
F
√
√
√
MT7697/
MT7697D
√
√
√
√
√
√
√
MT2523D/
MT2523G
√
MT2533D Compile option
√
√
√
√
√
HAL_SLEEP_MANAGER_MODULE_ENABL
ED
HAL_TRNG_MODULE_ENABLED
HAL_UART_MODULE_ENABLED
HAL_USB_MODULE_ENABLED
HAL_WDT_MODULE_ENABLED
root directory of each middleware module. It contains the information about the module dependency, feature options, notes and brief introduction. To learn more about the usage of the middleware modules, refer to the readme.txt file under each module path.
Feature MT7687F MT7697/
Table 2. Middleware features on different chipsets
MT7697D
MT2523D/
MT2523G
√
MT2533D Module path
√ middleware\MTK\bluetooth
Bluetooth stack
Bluetooth profile
Bluetooth
Low Energy stack
Bluetooth
Low Energy profile
Wi-Fi √
√
√
√
√
√
V
√
√
√ middleware\MTK\bluetooth middleware\MTK\bluetooth middleware\MTK\bluetooth lwIP
HTTP server
HTTP2 client
IPerf
MQTT
JSON
Xml
TLS
DHCP client\server
DNS client
SNTP
PING
√
√
HTTP(S) client √
√
√
√
√
√
√
√
√
√
√
√
√
√
√
√
√
√
√
√
√
√
√
√ middleware\MTK\minisupp driver\board\mt76x7_hdk\wifi middleware\third_party\lwip middleware\third_party\httpd middleware\third_party\httpclient middleware\third_party\nghttp2 middleware\third_party\iperf3 middleware\third_party\mqtt middleware\third_party\cjson middleware\third_party\xml middleware\third_party\mbedtls middleware\third_party\dhcpd middleware\third_party\lwip middleware\third_party\sntp middleware\third_party\ping
© 2015 - 2017 MediaTek Inc.
Page 4 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Feature
TFTP
GNSS
NVDM
ATCI
File system
Battery management
FOTA
Sensor subsystem
√
MT7687F MT7697/
MT7697D
√
√
√
√
√
√
√
√
MT2523D/
MT2523G
√
√
√
√
√
√
Note, the f ile system does not work without SD/eMMC.
MT2533D Module path
√
√
√
√
√ middleware\MTK\tftp middleware\MTK\gnss middleware\MTK\nvdm middleware\MTK\atci middleware\third_party\fatfs middleware\MTK\battery_management middleware\MTK\fota middleware\MTK\sensor_subsys
1.2.
Supported key components
The platform offers rich connectivity options, such as Wi-Fi, network, Bluetooth, GNSS, peripheral drivers and other advanced components. This section introduces each of these components.
1.2.1.
Wi-Fi
Wi-Fi is a key feature included in the platform. It supports both station and access point (AP) modes. More information on the Wi-Fi APIs can be found in 7687/7697 SDK API reference manual and Wi-Fi developer’s guide under <sdk_root>\doc. More details about the module can be found in
<sdk_root>\middleware\MTK\minisupp\readme.txt.
Table 3. Wi-Fi station features
Item
Standard
Channel
Personal Security
Features
802.11 b/g/n Station (STA)
Channel 1 to 13
Open, WEP-Open, WPA, WPA2
Enterprise Security
WPS
N/A
Enrollee (PBC/PIN)
Advanced AMPDU, RX-Filter, DTIM
Table 4. Wi-Fi AP features
Item
Standard
Channel
Personal Security
Support Clients
Features
802.11 b/g/n Soft AP
Channels 1 to 13
Open, WEP-Open, WPA, WPA2
9 STAs (AP only mode)
© 2015 - 2017 MediaTek Inc.
Page 5 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
Item
WPS
Enterprise Security
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Features
Registrar (PBC/PIN) , Enrollee (PIN)
N/A
1.2.2.
Network
The internet middleware APIs can be found in the Internet Middleware API Reference Manual and LinkIt for RTOS
Open Source Components Guide under <sdk_root>\doc. Supported network features of the platform are listed
in Table 5. Learn how to include each supported protocol module from
<sdk_root>\middleware\third_party\xxx\readme.txt.
Table 5. Supported network protocols
Item
IP Stack
SNTP
HTTP
HTTPS
SSL/TLS
Features
•
IPv4 (LWIP)
•
TCP, UDP
•
ICMP
•
DHCP Client/Server
•
DNS Client
•
NETCONN
•
SOCKET
•
Simple Network Time Protocol
•
RFC4330
•
Support SNTP receive timeout
•
Support SNTP update delay
•
Support SNTP max server
•
HTTP 1.1
•
Client (POST/GET)
•
HTTP 1.1
•
Client (POST/GET)
• mbed TLS
•
Client, Server (not tested)
•
SSL3.0, TLS1.0, 1.1, 1.2
•
AES, 3DES, DES, ARC4
•
MD5, SHA-1, SHA-256
•
RSA/PKCS#1 v1.5
1.2.3.
Bluetooth/Bluetooth Low Energy
Bluetooth with Enhanced Data Rate (EDR) and Bluetooth Low Energy (LE) are key features in the LinkIt SDK for
guide and Bluetooth developer’s guides for LinkIt 2523 HDK and LinkIt 7697 HDK at <sdk_root>\doc. In addition, find more details on how to include the Bluetooth module in
<sdk_root>\middleware\MTK\bluetooth\readme.txt.
© 2015 - 2017 MediaTek Inc.
Page 6 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
Item
EDR-A2DP
EDR-AVRCP
EDR-HFP/HSP
EDR-PBAP
EDR-SPP
EDR-GAP
BLE-GAP
BLE-GATT/ATT
BLE-SMP
Multipoint Support
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Table 6. Bluetooth/Bluetooth Low Energy features
Features
Advanced Audio Distribution Profile
Audio/Video Remote Control Profile
(CT:v1.3/TG:v1.0)
Hands-Free Profile v1.7 or Headset Profile
•
The Phone Book Access Profile (PBAP)
•
Defines the procedures and protocols to exchange Phonebook objects between devices.
Serial Port Profile
Generic Access Profile
Generic Access Profile
Generic Attribute Profile
Low Energy Security Manager Protocol
•
Supports multipoint Bluetooth access in EDR. o Two HFP(HF) o Two A2DP(Sink) o Two AVRCP(CT) o Two SPP server/client
•
Supports multipoint Bluetooth access in
Bluetooth Low Energy. o Four Bluetooth Low Energy links.
1.2.4.
Sensor subsystem
subsystem SDK APIs can be found in sensor subsystem section of the 2523 API Reference Manual under
<sdk_root>\doc. In addition, find more details on how to include the sensor subsystem module in
<sdk_root>\middleware\MTK\sensor_subsys\readme.txt.
Table 7. Sensor subsystem features
Item
Physical sensor
Sensor fusion
Features
•
Accelerometer
•
Biosensors (PPG, EKG)
•
Heart rate
•
Blood pressure
1.2.5.
GNSS
reference Manual and LinkIt for RTOS GNSS Developer’s Guide under <sdk_root>\doc. In addition, find more details on how to use this module in <sdk_root>\middleware\MTK\gnss\readme.txt.
© 2015 - 2017 MediaTek Inc.
Page 7 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
Item
GNSS
Extended Prediction Orbit ( EPO)
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Table 8. GNSS features
Features
•
GPS / BeiDou / GLONASS
•
Low Power Mode
• Periodic mode
• GLP mode
•
Time Aiding / Location Aiding
•
EPO host aiding
•
EPO download using Bluetooth
1.2.6.
FOTA
SDK API Reference Manual and in LinkIt for RTOS Firmware Update Developer’s Guide under <sdk_root>\doc. In addition, find more information on how to include this module in
<sdk_root>\middleware\MTK\fota\readme.txt.
Table 9. FOTA features
Item
FOTA
Features
•
Full binary update mechanism
•
Package data compression
•
Integrity check
•
Power loss protection
•
FOTA packaging tool
1.2.7.
Peripheral drivers
API Reference Manual under <sdk_root>\doc. To include HAL module, include
<sdk_root>\driver\chip\mt2523\module.mk in project makefile for LinkIt 2523 HDK, or include
<sdk_root>\driver\chip\mt7687\module.mk in project makefile for LinkIt 7687 HDK.
Table 10. Supported peripheral drivers
Item
ACCDET
ADC(MT2523x)
CACHE
EINT
Flash
Features
•
Accessory Detector.
•
Detects plug-in/out of earphone based on the suggested circuit.
•
ADC module.
•
DAC module.
•
The maximum size of the cache is 32kB.
•
External interrupt controller.
•
Processes the interrupt request from an external source or a peripheral device.
•
Supports execute in place (XIP) and programming flash by software.
© 2015 - 2017 MediaTek Inc.
Page 8 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
GPIO
GPT
PWM
UART
ISINK
MPU
IrDA
GPC
WDT
I2S-Slave
SPI-Master
RTC
GDMA
Security
Item
I2C Master
I2S Master
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Features
•
Default 2MB system in package (SiP) flash on
LinkIt 7687 HDK
•
Default 4MB system in package (SiP) flash on
LinkIt 2523 HDK.
•
Supports external flash up to 16MB on LinkIt
•
GPIO mode (in or out)
•
Set Pull Up/Down for GPIO IN mode
•
General Purpose Timer.
•
Supports 32kHz and 1MHz clock sources, repeat and one-shot modes for timing events and delays in µs or ms.
•
Range is 256 duty cycles
•
32kHz, 2MHz, XTAL clock for PWM frequency reference
•
Two full set (TX/RX) UART support on LinkIt 7687
HDK
•
Four UART ports, two of them featuring hardware flow control on LinkIt 2523 HDK
•
Baud rate of up to 921600
•
Two I2C interfaces
•
Supports 50/100/200/400kHz transmission rate
• I2S master is capable of servicing an external codec component.
• Supports 8/11.025/12/16/22.05/24/32/44.1/48 kHz audio sampling rates in stereo mode.
•
Current sink
•
Adjustable backlight current.
• Memory Protection Unit
•
TX (NEC, RC5, RC6, pulse width)
•
RX (RC5, pulse width)
•
General Purpose Counter
•
Supports 1MHz pulse detection
•
Supports hardware, software watchdog
•
Supports system reset
•
Supports sample rate: 8/12/16/24/32/48kbits
•
Supports mono and stereo mode
•
Serial Peripheral Interface
•
Real-Time Clock
•
General Purpose DMA
•
SHA1, SHA2 (256, 384, 512), MD5, AES, 3DES
© 2015 - 2017 MediaTek Inc.
Page 9 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
Item
TRNG
Charger
Keypad
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Features
•
Truly Random Number Generator
•
Generates 32bit random number
•
Supports single-cell Li-Ion battery charging.
•
Keypad scanner
•
Supports 3x3 single/double key mode
1.2.8.
Battery management
Reference Manual under <sdk_root>\doc. Find more information on how to include this module in
<sdk_root>\middleware\MTK\battery_management\readme.txt.
Table 11. Battery management features
Item
Battery management
Features
•
Charging flow control mechanism.
•
Algorithm for battery capacity measurement.
•
Precise information on the battery, such as temperature and battery level.
1.2.9.
Advanced features and components
The advanced features and components included in the platform are listed in Table 12.
Table 12. Advanced features and components
Item
XML
JSON
Smart Connection
CLI command
ATCI
File system
Features
•
Mini-XML
•
Supports o Entity o GET/SET o Index o Search
• cJSON
•
JSON string parser
•
MediaTek LinkIt™ Smart Connection
•
CLI command parser
•
AT command parser
•
Windows compatible
•
Platform independent
•
Very small footprint for code and work area
•
Multiple volumes
•
Multiple ANSI/OEM code pages including DBCS
•
Long file name support in ANSI/OEM or Unicode
© 2015 - 2017 MediaTek Inc.
Page 10 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
Item
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Features
•
FreeRTOS support for multitasking
•
Multiple sector size support up to 4kB
•
Read-only, minimized API, I/O buffer and more
1.3.
Folder structure
The SDK is delivered as a single package organized in a folder structure, as shown in Figure 2.
Figure 2. Folder structure
© 2015 - 2017 MediaTek Inc.
Page 11 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
This package contains the source and library files of the major components, build configuration, related tools and documentation. A brief description on the layout of these files is provided below:
• config. Includes make and compile configuration files for compiling a binary project.
• doc. Includes SDK related documentation, such as developer and SDK API reference guides.
• driver. Includes common driver files, such as board drivers, peripheral and CMSIS-CORE interface drivers.
• kernel. Includes the underlying RTOS and system services for exception handling and error logging.
• middleware. Includes software features for HAL and OS, such as network and advanced features.
• project. Includes pre-configured example and demo projects using Wi-Fi, HTTP, HAL, etc.
• tools. Includes tools to compile, download and debug projects using the SDK.
The main components that belong to middleware are in the middleware folder:
•
MTK o minicli. A Command Line Interface (CLI) that provides a framework for the upper layer to register a function executed by an input command. The input command and output message streaming is communicated through the UART.
o minisupp. A supplicant is an entity at one end of a point-to-point LAN segment that seeks to be authenticated by an authenticator attached to the other end of that link. Mini-supplicant library supports this with minimum memory usage. o nvdm. NVDM is a type of memory mechanism that retains its contents when the system power is turned off. o atci. Provides the interface for a target communication using AT commands though UART. o battery_management. Includes battery monitor, charging flow control and battery capacity algorithms. o bluetooth. Bluetooth/Bluetooth Low Energy provides three profiles (GAP, GATT, SM) to discover and connect Bluetooth devices and to transfer and control data securely through a Bluetooth connection. o fota. FOTA provides firmware update functionality. o gnss. Provides APIs to receive GNSS data and control the on-board GNSS module. o sensor_subsys. Provides sensor drivers and fusion algorithms.
• third_party o cjson. JSON is an open standard format that uses human-readable text to transmit data objects consisting of attribute–value pairs. cJSON is a single file implementation in C. o dhcpd. DHCP daemon (DHCPD) is a program that operates as a daemon on a server to provide
Dynamic Host Configuration Protocol (DHCP) service to a network. Devices in a network with a DHCP server can retrieve network parameter configuration from the server. o httpclient. The HTTP client is the client implementation for requesting data from HTTP servers. o lwip. A widely used open source TCP/IP stack designed for embedded systems. The focus of the lwIP
TCP/IP implementation is to reduce resource usage while still having a full-scale TCP. o mbedtls. Transport Layer Security (TLS) and Secure Sockets Layer (SSL) are cryptographic protocols designed to provide communications security over a computer network. mbed TLS is an open source
© 2015 - 2017 MediaTek Inc.
Page 12 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
implementation for developers to include cryptographic and SSL/TLS capabilities in embedded products with a minimal coding footprint. o sntp. SNTP is a networking protocol for clock synchronization between computer systems over packet-switched, variable-latency data networks. o xml. XML is a markup language defined by the W3C's XML 1.0 Specification that defines a set of rules for encoding documents in a human-readable and machine-readable format. o fatfs.
FatFs is generic FAT file system for small embedded systems. It is used to control data storage and retrieval in a file system.
1.4.
Project source structure
The SDK provides a set of reference applications. For example, projects with a single function showing how to use drivers or other module features and others with complex functionality demonstrating how to use the middleware components.
Example applications are located in the <sdk_root>\project\<hdk>\apps and
<sdk_root>\project\<hdk>\hal_examples folder and they all have the same folder structure, as shown in
Figure 3. Project folder structure
1)
EWARM. IAR related project configuration files.
2)
GCC. GCC related project configuration files, such as a makefile.
3)
inc. Project header files.
4) MDK-ARM. Keil related project configuration files.
5)
src. Project source files.
6)
Readme.txt. A brief introduction about project behavior and the required environment.
You can apply the relevant reference applications to further your development.
© 2015 - 2017 MediaTek Inc.
Page 13 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
2.
Getting Started Using GCC
This section provides a guide to getting started with the LinkIt development platform for RTOS and covers the following items:
•
Supported environments for development.
•
Configuring the LinkIt HDK.
•
Building the project using the SDK.
•
Downloading and running the project from Microsoft Windows.
•
Debugging the project from Microsoft Windows.
•
Creating your own project.
2.1.
Environment
The SDK can be used on any edition of Microsoft Windows XP, Vista, 7 and 8, and on Linux. A GCC compiler is required to build the project.
• Download and extract the content of the SDK package on your local PC.
• Follow the instructions in the readme.txt file to download and extract the SDK toolchain package. o Copy the GCC compiler (“gcc” folder) to <sdk_root>\tools\. The compiler settings are in the
<sdk_root>\.config configuration file.
The default GCC toolchain is supported for the following versions of the Linux 32 or 64 bit hosts.
• Ubuntu 8.x or later (tarball).
• Ubuntu LTS 10.04 or later (PPA).
• RHEL 4/5/6 (tarball).
2.2.
Developing on LinkIt 7687 HDK
2.2.1.
Configuring the LinkIt 7687 HDK
LinkIt 7687 HDK includes a main board and a MT7687F stamp module. The MT7687F stamp module is mounted on
the main board. The top view of the main board is shown in Figure 4.
© 2015 - 2017 MediaTek Inc.
Page 14 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 4. Top view of the LinkIt 7687 HDK
The description of pins and their functionality is provided below.
• CON5 is a USB connector to debug through UART, transmit and receive a signal and supply power from the PC. The USB connectivity with the PC is supported by the on-board MK20DX128VFM5 .
• Set the jumpers J23, J26, J27and J30 on, if the board is powered up using the USB connector.
• Press S4 to wake up the system from the RTC mode.
• Press S1 to reset the system.
• J25 sets the flash mode. o Remove the jumper J25 to switch to FLASH Normal mode. In this mode, if the power is on, the board will load firmware from the flash and reboot. o Set the jumper J25 on to switch to FLASH Recovery mode. In this mode, if the power is on, the board will load ROM code and wait for the MT76x7 Flash Tool to initiate firmware download process.
• Wi-Fi Antenna is a PCB antenna. MT7687F stamp module is by default connected to the PCB antenna to transmit and receive RF signals.
The default configuration of the LinkIt 7687 HDK support the following functionality:
• Power supply — attach a micro-USB connector to the CON5.
• Flash mode — Recovery mode.
• Support RTC interrupt.
• Clock source — 32.768kHz source crystal clock for the RTC mode or external clock operating on
32.768kHz.
© 2015 - 2017 MediaTek Inc.
Page 15 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
• XTAL — 40MHz.
• RTC mode — supported.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
The hardware settings of the stamp module are shown below:
• XTAL — 40MHz.
• Clock source — 32.768kHz source crystal clock for the RTC mode or external clock operating on
32.768kHz.
• RTC mode — supported.
• Flash mode — Normal mode.
2.2.2.
Installing the LinkIt 7687 HDK drivers on Microsoft Windows
To configure the LinkIt 7687 HDK:
• Connect the HDK to the computer using a micro-USB cable.
• Download and install mbed Windows serial port driver from here . Open Windows Control Panel then click System and: o On Windows 7 and 8, click Device Manager. o On Windows XP, click the Hardware tab and then Device Manager.
•
In Device Manager, navigate to Ports (COM & LPT) (see Figure 5).
•
A new COM device should appear under Ports (COM & LPT) in Device Manager, as shown in Figure
5. Note the COMx port number of the serial communication port, this information is needed to send
command and receive logs from the COM port.
© 2015 - 2017 MediaTek Inc.
Page 16 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 5. COM port associated with the LinkIt 7687 HDK
2.2.3.
Installing MT76x7 Flash Tool for LinkIt 7687 HDK
The MT76x7 Flash Tool can be used on Microsoft Windows XP, Vista, 7, 8 and 10 with 32-bit and 64-bit operating systems. It’s available for Linux with 32-bit and 64-bit operating system (Ubuntu 14.04 or higher).
To install the tool:
1)
Download the LinkIt SDK v4 package from here .
On Linux OS environment:
1) Extract the content of the SDK and navigate to the MT76x7 Flash Tool’s folder (./linux32bit or ./linux64bit). The tool is a setup free package.
2)
Run the following command to establish the library environment and launch the Flash Tool: source env-setup.sh
./mt76x7-flash-tool.exe
On Microsoft Windows OS environment:
1)
Extract the content of the SDK and navigate to the MT76x7 Flash Tool’s folder (./win). The tool is a setup free package.
2)
Execute the mt76x7-flash-tool.exe to launch the Flash Tool (see Figure 6).
© 2015 - 2017 MediaTek Inc.
Page 17 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 6. Executable file in the MT76x7 Flash Tool’s destination folder
To configure the COM port and the baud rate:
• Launch the MT76x7 Flash Tool and connect the device to a PC with a micro-USB cable.
•
Reset the development board or unplug and re-plug in the micro-USB cable.
•
Click Refresh and configure the correct COM port (see section 2.2.2, “Installing the LinkIt 7687 HDK
drivers on Microsoft Windows”) and the baud rate, as shown in Figure 7.
© 2015 - 2017 MediaTek Inc.
Page 18 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 7. Setup the COM port and baud rate
2.2.4.
Flashing the image to LinkIt 7687 HDK
There are two methods on how to flash the image to the LinkIt 7687 HDK.
2.2.4.1.
Using the Flash Tool
The
Download feature flashes the images to the device. The image data can be scrambled if necessary. If scrambled, the data read back cannot be decoded.
Follow these steps to execute commands.
1)
Enable
Download Scatter File
checkbox.
2)
Click
open folder
to provide the scatter file. The scatter file, known as
Image Description File
, is located under the project binary folder, where all other binary files reside. It is usually named as flash_download.ini. The binary files could be either MediaTek released or generated during build process. The
Image Description File
includes information about the file version, project name and partition layout details. Most projects have three partitions:
•
Loader
partition that stores bootloader.
•
TargetFW
partition that stores proprietary firmware for the Wi-Fi subsystem.
•
HostFW
partition that stores the project application binary, such as mt7687_iot_sdk_demo.bin.
The partition layout details including
Name
,
Start Address
,
End Address
and the location of the files
Figure 8. Download an image to the device storage
3)
Click
Start
to execute the command. When downloading is complete, the result status is shown as in
© 2015 - 2017 MediaTek Inc.
Page 19 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 9. Downloading the image is successfully complete
2.2.4.2.
Using the LinkIt 7687 HDK as a removable storage
To update the application binary only (example project binary: mt7687_iot_sdk_demo.bin), use the HDK as a mass storage device as follows:
1)
Set the HDK to FLASH Recovery mode (see section 2.2.1, “Configuring the LinkIt 7687 HDK”).
2) Power up the board with a micro-USB cable.
3) Navigate to Computer on your PC to check if a new mass storage named MT76x7 is available under
Removable Disk, as shown in Figure 10.
4)
Open the MT76x7 removable storage, then drag and drop the binary mt7687_iot_sdk_demo.bin to complete downloading the image.
5)
Disconnect the board, set the jumper to FLASH Normal mode, and then reconnect the board to run your application.
© 2015 - 2017 MediaTek Inc.
Page 20 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 10. New removable storage detected
2.2.5.
Running the project on LinkIt 7687 HDK
Most of the example projects for the LinkIt 7687 HDK facilitate the on-board mbed serial port to output logs and accept user inputs. Therefore you’ll need to setup a terminal application that connects to the serial port, such as
TeraTerm terminal emulator software. You can use any other terminal application of your choice.
2.2.5.1.
Terminal application setup
If you already have a terminal application installed, skip to the next section to configure the serial port.
To install TeraTerm, follow the steps below:
1) Download the latest version of TeraTerm installer from here .
2) Launch installer, such as teraterm-4.91.exe, and simply follow the steps using default options to complete the installation.
2.2.5.2.
Serial port settings
All example projects use the same serial port configuration. Apply the following configuration settings in your terminal application:
If you are using TeraTerm:
1)
Launch TeraTerm and then click Setup on the top menu of the command window.
2)
Click to open Serial Port… setup.
3)
Select the COM port number that maps to the mbed serial port shown in Figure 5.
4)
Set the Baud rate, Data, Parity, Stop and Flow control parameters (see Figure 11). Leave the
Transmit delay fields with default values (0), and click OK.
© 2015 - 2017 MediaTek Inc.
Page 21 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 11. Serial port setting configuration
5)
To apply this configuration to all future serial port connections, select Setup and then Save Setup… to save the TERATERM.INI file to the TeraTerm program folder. The default location is C:\Program
Files (x86)\teraterm.
2.2.5.3.
Run the project
To run the project on LinkIt 7687 HDK:
1) Disconnect the micro-USB cable to power off the board.
2)
more details.
3) Reconnect the USB cable to power on the board.
4)
Open the terminal application and connect to the mbed serial port. If you are using TeraTerm, select File and then New Connection… from the menu bar, and then select Serial. Provide the Port
corresponding to mbed Serial Port, as shown in Figure 12, and click OK.
© 2015 - 2017 MediaTek Inc.
Page 22 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 12. Connect to mbed Serial Port
5) Press the reset button S1 (RST) on the board.
6)
Observe the output log written in project source files from UART port. A reference log example is shown below. loader init [2016-04-28 15:03:10.924]
[2016-04-28 15:03:10.924] fota: TMP is empty, skip upgrade[2016-04-28 15:03:10.939]
[2016-04-28 15:03:10.939] jump to (0x1007c000) [2016-04-28 15:03:10.939] total avail space = 13748
[2016-04-28 15:03:10.955] nvdm init finished
[2016-04-28 15:03:10.955]
[T: 52 M: common C: INFO F: system_init L: 269]: FreeRTOS Running[2016-
04-28 15:03:10.970]
2.2.6.
Debugging with the LinkIt 7687 HDK from Microsoft Windows
This section describes how to debug a project built with the GCC compiler using openOCD debugger tool.
Before commencing project debugging, install supporting software on Windows OS.
1)
Download openocd-0.9.0 from here and unzip it into <openocd_root> folder. o Download GCC toolchain from here for your Windows version, and unzip it into <gcc_root> folder.
2)
Install the mbed serial port driver , if the mbed serial port driver is not installed (see MT76x7 Flash Tool
User’s Guide).
You can debug a project once it’s already downloaded on your HDK. More details can be found in MediaTek
LinkIt™ SDK v4 GCC Build Environment Guide.
7)
Create a board configuration file named mt7687.cfg and copy the following content to the file: puts "Load MT7687(CMSIS-DAP) configuration"
# Use CMSIS-DAP debug interface source [find interface/cmsis-dap.cfg]
© 2015 - 2017 MediaTek Inc.
Page 23 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
source [find target/swj-dp.tcl]
# Setup variables set _CHIPNAME MT7687 set _TARGETNAME $_CHIPNAME.cm4 set _CPUTAPID 0x2ba01477
# Create DAP instance swj_newdap $_CHIPNAME cpu -irlen 4 -expected-id $_CPUTAPID
# Create target instance target create $_TARGETNAME cortex_m -endian little -chain-position
$_CHIPNAME.cpu
# Setup SWD frequence adapter_khz 3000
# Hook for GDB attach, to bring target into debug mode
$_TARGETNAME configure -event gdb-attach { targets $_TARGETNAME halt
}
# Hook for GDB detach, to free target from debug mode
$_TARGETNAME configure -event gdb-detach { targets $_TARGETNAME resume
}
}
# MT7687 initialization, unlock SWD lock set init_done 0 proc mt7687_init {} { global init_done global _TARGETNAME if {$init_done == 0} { echo "Initialize MT7687"
# unlock SWD targets $_TARGETNAME mww 0x8300F050 0x76371688 mww 0x8300F050 0x76371688 mww 0x8300F050 0x76371688
} set init_done 1
# Hook for reset, to clear init_done flag
$_TARGETNAME configure -event reset-start { global init_done set init_done 0
}
# Hook for reset & init, to execute initialization steps
$_TARGETNAME configure -event reset-init { mt7687_init
} puts "Load MT7687(CMSIS-DAP) configuration done"
8)
Place the board configuration file under <openocd_root>\share\openocd\scripts\board.
Start debugging with the LinkIt 7687 HDK:
1) Copy the project .elf file from project Build folder to GCC tool path, such as <gcc_root>. For example, <sdk_root>\out\mt7687_hdk\iot_sdk_demo\mt7687_iot_sdk_demo.elf.
© 2015 - 2017 MediaTek Inc.
Page 24 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
2)
Open the Windows command window to run openOCD.
3) Change the directory of command window to openOCD tool folder, such as <openocd_root>\bin.
4) Disconnect the micro-USB cable to power off the board.
5) Set the board to FLASH Normal mode.
6)
Reconnect the micro-USB cable and press the reset button to power on the board.
7)
Run the command to start the openOCD. openocd.exe –s ..\share\openocd\scripts –f board\mt7687.cfg
8)
Open the Windows command window to run openOCD GNU project debugger (GDB). .
9)
Change the directory of the command window to the tool folder, such as <gcc_root>\bin.
10) Run the command to start the GDB. arm-none-eabi-gdb.exe <gcc_root>\mt7687_iot_sdk_demo.elf
(gdb) target remote localhost:3333
(gdb) monitor reset init
(gdb) load
(gdb) info registers
(gdb) x/10i $pc
You now have an openOCD debugger running on your system.
Note, openOCD debugging cannot work if enter sleep mode, for more detail information, please refer to the document LinkIt for RTOS Power Mode Developers Guide under <sdk_root>/doc.
© 2015 - 2017 MediaTek Inc.
Page 25 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
2.3.
Developing on LinkIt 2523 HDK
2.3.1.
Configuring the LinkIt 2523 HDK
Before commencing the application development, you need to configure the HDK.
The front view of the LinkIt 2523 HDK is shown in Figure 13.
Jumpers for the Camera
Daughterboard
3 2 1
2523 USB
MK20 USB
System
Power
Figure 13. USB connectors on the LinkIt 2523 development board
The 2523 USB can be used for powering up the board and downloading the binary using the MT2523 Flash Tool.
The MK20 USB can be used for debugging with GDB and downloading the binary using Keil IDE.
To power up the board with 2523 USB, connect the system power jumper pins 3 and 2 for USB power mode.
Connect the pins 2 and 1 to power up with the battery, as shown in Figure 13.
2.3.2.
Installing MT2523 Flash Tool for LinkIt 2523 HDK
MT2523 Flash Tool is a flexible device flashing tool for application development on LinkIt 2523 HDK.
To install the MT2523 Flash Tool:
1)
If you don’t have the SDK package yet, download the LinkIt SDK v4 package from here .
2) Extract the content of the SDK package and navigate to the tools folder, and extract the
PC_tool_Win.zip package.
In the extracted PC_tool_Win folder, navigate to MT2523_FlashTool folder. The tool is a setup free package, and the FlashTool.exe inside the folder can be executed directly.
2.3.3.
Installing the LinkIt 2523 HDK drivers on Microsoft Windows
This section describes how to install LinkIt 2523 HDK drivers on PCs running Microsoft Windows. The two USB ports, 2523 USB and MK20 USB, require different drivers. Follow the instructions below to install them.
2.3.3.1.
Install 2523 USB Driver on Windows 7 or earlier
To install the MediaTek USB Port driver for 2523 USB port on the HDK on Windows 7 or earlier versions of
Windows:
© 2015 - 2017 MediaTek Inc.
Page 26 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
1)
Install the MediaTek USB Port driver from MS_USB_ComPort_Driver folder located in
MT2523_FlashTool folder.
2)
Execute InstallDriver.exe to install the driver.
3)
Connect the 2523 USB connector on the LinkIt 2523 HDK to your computer’s USB port with a USB cable.
2.3.3.2.
Install 2523 USB Driver on Windows 8 or later
If you are using Windows 8 or later, follow the instructions here:
1)
Connect the 2523 USB connector on the LinkIt 2523 HDK to your computer’s USB port with a USB cable.
2)
Open Windows Control Panel and click System, then click Device Manager.
3)
An Unknown device will show under Universal Serial Bus Controllers. Double click the Unknown
device and click Update Driver… (see Figure 14).
Figure 14. Unknown device on Windows 8 or later
4)
Click Browse my computer for driver software, as shown in Figure 15.
© 2015 - 2017 MediaTek Inc.
Page 27 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 15. Browse my computer for driver software
5) Browse to the driver installation path, such as MS_USB_ComPort_Driver\v1.1032.1\Win7, then click
Next. After a few seconds, the driver software and MTK USB Port device should be installed, as shown in
© 2015 - 2017 MediaTek Inc.
Page 28 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 16. MTK USB Port on Windows 8 or later
2.3.3.3.
Confirm COM port number of MTK USB Port
To determine the COM port number of the installed device:
1)
Open Windows Control Panel and click System then a)
On Windows 7 and 8, click Device Manager. b) On Windows XP, click the Hardware tab and then Device Manager.
2)
In Device Manager, navigate to Ports (COM & LPT) and locate MTK USB Port (COMx), as shown in
© 2015 - 2017 MediaTek Inc.
Page 29 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 17. Debug and modem ports for MTK USB port
© 2015 - 2017 MediaTek Inc.
Page 30 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 18. MTK USB driver version in MTK USB Debug Port Properties
Note, the driver version must be 1.1032.0 or later; an older driver doesn’t guarantee successful download and operation. If the driver is before 1.1032.0, upgrade your SDK.
2.3.3.4.
Install MK20 USB Driver
The MK20 USB port provides 3 different USB devices:
• CMSIS-DAP debug device. Keil and IAR IDEs use this device to download and debug programs.
• mbed serial port (COM port) that connects the UART2 of the board. This serial port relays to the UART2 interface of the board and serves as the primary system log output interface for most of the SDK example projects.
• A virtual mass storage device to download a binary image to the board by simply copying the binary file to the storage device.
Only the mbed serial port requires additional driver installation. Install mbed serial port driver to use the USB serial port on Windows OS for debugging:
1) Download and install the Windows serial port driver from here .
© 2015 - 2017 MediaTek Inc.
Page 31 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
2)
Connect the board to the computer through MK20 USB.
3) Open Windows Control Panel, click System and:
• On Windows 7 and 8, click Device Manager.
• On Windows XP, click the Hardware tab and then Device Manager.
4)
In Device Manager, navigate to Ports (COM & LPT) (see Figure 19).
© 2015 - 2017 MediaTek Inc.
Page 32 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
5)
A new COM device should appear under Ports (COM & LPT), as shown in the figure below. Note the
COMx port number of the mbed Serial Port. Use this port to receive system logs from the LinkIt 2523
HDK.
Figure 19. mbed Serial Port
2.3.4.
Flashing the image to LinkIt 2523 HDK
Before using the MT2523 Flash Tool, make sure you have a pre-build project file (.cfg) or build your own project
to get one (see 2.4, “Building the project using the SDK”).
There are two methods to flash the image to LinkIt HDK: using the MT2523 Flash Tool or using the device as a removable storage device.
2.3.4.1.
Using the Flash tool
To download the firmware to the target device, use the 2523 USB interface (see Figure 20):
1)
Power off the target (USB cable must be unplugged).
2)
Launch MT2523 Flash Tool, and click Download on the left panel of the main GUI.
3) Select USB from the COM Port drop down menu. If you don’t have the adapter or battery, click the
Enable Download without Battery option.
© 2015 - 2017 MediaTek Inc.
Page 33 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Click Open to provide the configuration file, which is usually named as flash_download.cfg and is generated after build process. If it loads successfully, Download Information will be displayed, including Name, Length
and File Path of the firmware binary, as shown in Figure 20.
4)
Click Start to start downloading.
5)
Plug in the USB cable to power on the HDK through the 2523 USB connector and then the process will start automatically.
Figure 20. Download the firmware to a target device using USB connection
2.3.4.2.
Using the LinkIt 2523 HDK as a removable storage device
1)
Connect the LinkIt 2523 HDK to your PC with a micro-USB cable to MK20 USB connector.
2)
Navigate to Computer on your PC to check if a new mass storage named MT2523 is available under
Devices with Removable Storage, as shown in Figure 21.
© 2015 - 2017 MediaTek Inc.
Page 34 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 21. LinkIt 2523 HDK connected as removable disk storage
3) Open the MT2523 removable storage, then drag and drop the project image, for example iot_sdk_demo.bin, from the original image folder to complete the update of the project image on the flash.
4) Wait for the mass storage device to disappear and re-appear again. After it reappears, check if there is no fail.txt in the 2523 mass storage. If there is no such file, the download has completed successfully. If fail.txt exists and its content is SWD ERROR, disconnect the MK20 USB port first, and make sure that you copy the iot_sdk_demo.bin file within 15 seconds after re-connecting to the MK20 USB port.
2.3.5.
Running the project on LinkIt 2523 HDK
Most of the example projects for the LinkIt 2523 HDK facilitate the on-board mbed serial port to output logs and accept user inputs. Therefore, you’ll need to setup a terminal application that connects to the serial port, such as
TeraTerm terminal emulator software. You can use any other terminal application of your choice.
2.3.5.1.
Terminal application setup
If you already have a terminal application installed, skip to the next section to configure the serial port.
To install TeraTerm, follow the steps below:
1)
Download the latest version of TeraTerm installer from here .
2)
Launch installer, such as teraterm-4.91.exe, and simply follow the steps using default options to complete the installation.
2.3.5.2.
Serial port settings
All example projects use the same serial port configuration. Apply the following configuration settings in your terminal application:
If you are using TeraTerm:
© 2015 - 2017 MediaTek Inc.
Page 35 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
1)
Launch TeraTerm and then click Setup on the top menu of the command window.
2) Click to open Serial Port… setup.
3)
Select the COM port number that maps to the mbed serial port shown in Figure 5.
4)
Set the Baud rate, Data, Parity, Stop and Flow control parameters (see Figure 22). Leave the
Transmit delay fields with default values (0), and click OK.
Figure 22. Serial port setup
5)
To apply this setting to all future serial port connections, select Setup and then Save Setup…, and save the TERATERM.INI file to the TeraTerm program folder, the default location is at C:\Program Files
(x86)\teraterm.
2.3.5.3.
Run the project
To run the project on LinkIt 2523 HDK after downloading a project binary, reboot the board:
1)
Disconnect the micro-USB cable to power off the LinkIt 2523 HDK.
2)
Reconnect the USB cable to MK20 USB port to power on the LinkIt 2523 HDK.
Note, pressing the on-board Reset key won't reboot the board completely. After downloading a new firmware, you must un-plug the micro USB cable and plug it back to perform a complete reboot.
3)
Open the terminal application and connect to the mbed serial port. If you are using TeraTerm, select File and then New Connection… from the menu bar, and then select Serial. Provide the Port
corresponding to mbed Serial Port, as shown in Figure 23, and click OK.
© 2015 - 2017 MediaTek Inc.
Page 36 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 23. Connect to mbed Serial Port
4) Wait for 15 seconds and the board will boot up. Then observe the system log output from the terminal window, such as:
[2016-04-28 15:01:11.365]
PSRAM Memory Test Pass!!custom_setSFIExt
[2016-04-28 15:01:11.365]
NOR_init
[2016-04-28 15:01:11.365] hal_flash_init
[2016-04-28 15:01:11.365] gpdac_sram_power_down
[2016-04-28 15:01:11.365] config bonding io register
2.3.6.
Debugging with the LinkIt 2523 HDK from Microsoft Windows
This section describes how to debug a project built with the GCC compiler using openOCD debugger tool.
Before commencing project debugging on your LinkIt 2523 HDK, install supporting software on Windows OS.
1)
Download openocd-0.9.0 from here and unzip it into <openocd_root> folder. a)
Download the GCC toolchain from here for your Windows version and unzip it into <gcc_root> folder.
2) Install the mbed serial port driver , if the serial port driver is not installed (see MT2523 Flash Tool User’s
Guide).
3) Get a patched openocd.exe. a) Create a board configuration file named build_openocd_patch.sh and copy the following content to the file.
#!/bin/bash sudo apt-get update sudo apt-get -y install wget
© 2015 - 2017 MediaTek Inc.
Page 37 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
sudo apt-get -y install git sudo apt-get -y install build-essential sudo apt-get -y install autoconf sudo apt-get -y install automake sudo apt-get -y install libtool sudo apt-get -y install texinfo sudo apt-get -y install mingw-w64-i686-dev sudo apt-get -y install mingw-w64 sudo apt-get -y install pkg-config mkdir -p $HOME/source cd $HOME/source && wget http://sourceforge.net/projects/libusb/files/libusb-1.0/libusb-
1.0.20/libusb-1.0.20.tar.bz2 && \ tar xjvf libusb-1.0.20.tar.bz2 cd $HOME/source && git clone http://github.com/signal11/hidapi.git cd $HOME/source/hidapi && ./bootstrap cd $HOME/source && git clone http://git.code.sf.net/p/openocd/code openocd cd $HOME/source/openocd && git checkout v0.9.0 && ./bootstrap && \ sed -i 's/dap_ap_select(dap, 0)/dap_ap_select(dap, 3)/g' src/target/arm_adi_v5.c mkdir -p $HOME/build/libusb mkdir -p $HOME/build/hidapi mkdir -p $HOME/build/openocd cd $HOME/build/libusb && $HOME/source/libusb-1.0.20/configure -prefix=$HOME/mingw --host=i686-w64-mingw32 && make && make install cd $HOME/build/hidapi && $HOME/source/hidapi/configure -prefix=$HOME/mingw --host=i686-w64-mingw32 && make && make install export PKG_CONFIG_PATH=$HOME/mingw/lib/pkgconfig cd $HOME/build/openocd && $HOME/source/openocd/configure -prefix=$HOME/mingw --host=i686-w64-mingw32 --disable-internal-libjaylink
MAKEINFO=true && \ make && make install cd $HOME && tar czvf mingw.tgz mingw b)
Run the shell script on Linux OS to get the mingw.tgz. c)
Copy the mingw.tgz to Windows OS and unzip it to <mingw_root> folder, then copy the files
<mingw_root>\bin to <openocd_root>\bin folder. d)
Download a dynamic linked library (dll) file and copy it into <openocd_root>\bin folder.
You can debug a project once it’s built and downloaded to your HDK.
1) Create a board configuration file named mt2523.cfg and copy the following content to the file. puts "Load MT2523(CMSIS-DAP) configuration"
# Use CMSIS-DAP debug interface source [find interface/cmsis-dap.cfg] source [find target/swj-dp.tcl]
# Setup variables set _CPUTAPID 0x3ba02477
© 2015 - 2017 MediaTek Inc.
Page 38 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
set _CHIPNAME MT2523 set _TARGETNAME $_CHIPNAME.cm4
# Create DAP instance swj_newdap $_CHIPNAME cpu -irlen 4 -expected-id $_CPUTAPID
# Create target instance target create $_TARGETNAME cortex_m -endian little -chain-position
$_CHIPNAME.cpu
$_TARGETNAME configure -event gdb-attach { targets $_TARGETNAME halt
}
}
$_TARGETNAME configure -event gdb-detach { targets $_TARGETNAME resume
# Setup SWD frequence adapter_khz 1000 puts "Load MT2523(CMSIS-DAP) configuration done."
2)
Save the board configuration file into <openocd_root>\share\openocd\scripts\board folder.
Start debugging with LinkIt 2523 HDK:
1)
Copy the project .elf file from project Build folder to GCC tool path, such as <gcc_root>, for example, <sdk_root>\out\mt2523_hdk\iot_sdk_demo\iot_sdk_demo.elf.
2)
Open the command window for openOCD.
3)
Change the directory in the command window to openOCD tool folder, such as <openocd_root>\bin.
4) Remove the micro-USB cables to completely power off the board.
5) Reconnect the micro-USB cable to MK20 USB port to power on the board.
6)
Run the command to start the openOCD. openocd.exe -s ..\share\openocd\scripts -f board\mt2523.cfg
7)
Open the command window for
GNU project debugger (GDB) .
8)
Change the directory in the command window to tool folder, such as <gcc_root>\bin.
9)
Run the command to start the GDB. arm-none-eabi-gdb.exe <gcc_root>\iot_sdk_demo.elf
(gdb) target remote localhost:3333
(gdb) monitor reset init
(gdb) load
(gdb) info registers
(gdb) x/10i $pc
You now have an openOCD debugger running on your system.
© 2015 - 2017 MediaTek Inc.
Page 39 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Note, openOCD is a free third-party debugging tool (GPL license), for any issues or troubleshooting refer to openOCD official forum . In addition, openOCD debugging cannot work if the system enters into sleep mode, for more detail information, please refer to the document LinkIt for RTOS Power Mode Developers Guide under
<sdk_root>/doc.
2.4.
Building the project using the SDK
This section provides detailed guideline on how to set up the SDK build environment with default GCC on Linux OS and on Microsoft Windows using the MinGW cross-compilation tool and describes two methods on how to build a project.
2.4.1.
Installing the SDK build environment on Linux
The default GCC compiler provided in the SDK is required to run on Linux OS. The following description is based on the Ubuntu 14.04 LTS environment.
Note: The LinkIt SDK can be used on any edition of Linux OS. The default GCC compiler provided in the SDK is based on the 32-bit architecture.
Before building the project, verify that you’ve installed the required toolchain for your build environment, as
Table 13. Recommended build environment
Item
OS
Description
Linux OS
make
GNU make 3.81
Compiler
Linaro GCC Toolchain for ARM Embedded Processors 4.8.4
The following command downloads and installs the basic building tools on Ubuntu. sudo apt-get install build-essential
Note, a compilation error occurs when building the LinkIt SDK with the default GCC cross compiler on a 64-bit system without installing the package to support the 32-bit executable binary, as shown below.
/bin/sh: 4: tools/gcc/gcc-arm-none-eabi/bin/arm-none-eabi-gcc: not found
The commands to install the basic build tools and the package for supporting 32-bit binary executable on the
Ubuntu 14.04 are shown below. sudo dpkg --add-architecture i386 sudo apt-get update sudo apt-get install libc6-i386
The watch projects using TouchGFX framework require installing Ruby to generate resource files. Find more information on how to install Ruby in
<sdk_root>\project\mt2523_watch\apps\watch_demo\readme.txt
Install the SDK package according to the instructions at <sdk_root>\readme.txt. The default installation path of the GCC compiler is <sdk_root>\tools\gcc, and the compiler settings are in the <sdk_root>\.config configuration file.
© 2015 - 2017 MediaTek Inc.
Page 40 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Setup the BINPATH in the .config file, as shown below.
BINPATH = $(SOURCE_DIR)/tools/gcc/gcc-arm-none-eabi/bin
2.4.2.
Installing the SDK build environment on Microsoft Windows
To build the project on Windows OS, install MinGW cross-compiler and integrate ARM GCC Toolchain for Windows with already installed LinkIt SDK.
1)
Download mingw-get-setup.exe from here .
2)
Launch the installer, and click Install (see Figure 24).
Figure 24. MinGW Installation Manager Setup Tool
3) Follow the on screen instructions and keep the default settings, then click Continue to download the tool
to C:\MinGW installation directory (see Figure 25).
© 2015 - 2017 MediaTek Inc.
Page 41 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 25. Keep default installation preferences
4)
Click Continue on the MinGW Installation Manager Setup Tool, after the download is complete
© 2015 - 2017 MediaTek Inc.
Page 42 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 26. Download and set up MinGW Installation Manager
5)
Select msys-base and mingw32-base from Basic Setup package list, and right click to bring up the
menu options. Click Mark for Installation from the menu (see Figure 27).
Figure 27. Basic setup on MinGW Installation Manager
6)
Click Apply Changes from the Installation menu (see Figure 28).
© 2015 - 2017 MediaTek Inc.
Page 43 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 28. A basic MinGW installation
7)
Click Apply on the pop-up dialog window (see Figure 29).
Figure 29. Schedule of pending actions
8)
Click Close to close the dialog window once the operation is complete (see Figure 30).
Figure 30. Applying scheduled changes
© 2015 - 2017 MediaTek Inc.
Page 44 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
9)
Navigate to C:\MinGW\msys\1.0 folder and launch the MinGW terminal by running msys.bat to create home/<user_name>
folder.
10)
Copy the SDK to MinGW home\<user_name>
folder, as shown in Figure 31 .
Figure 31. MinGW folder structure
11)
Download ARM-GCC-win32 from here . a) Create a new folder named win under <sdk_root>\ tools\gcc. b) Unzip the content of gcc-arm-none-eabi-4_8-2014q3-20140805-win32.zip to
<sdk_root>\ tools\gcc\win\ folder. c) Rename the unzipped gcc-arm-none-eabi-4_8-2014q3-20140805-win32 folder to gcc-arm-noneeabi
, as shown in
© 2015 - 2017 MediaTek Inc.
Page 45 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 32. tools\gcc folder structure
12)
Use build.sh to compile the project in MinGW32 console, as described in section 2.4.3, “
2.4.3.
Methods to build a project
This section describes two methods on how to build a project:
• Build a project from the SDK root directory.
• Build a project from the project GCC configuration directory.
2.4.3.1.
Building the project from the SDK root directory
Build the project using the script at <sdk_root>\build.sh. To find out more about the script, navigate to the
SDK’s root directory and execute the following command: cd <sdk_root>
./build.sh
The outcome is:
===============================================================
Build Project
===============================================================
Usage: ./build.sh <board> <project> [bl|clean] <argument>
Example:
./build.sh mt7687_hdk iot_sdk_demo
./build.sh mt7687_hdk iot_sdk_demo bl (build with bootloader)
./build.sh clean (clean folder: out)
./build.sh mt7687_hdk clean (clean folder: out/mt7687_hdk)
© 2015 - 2017 MediaTek Inc.
Page 46 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
./build.sh mt7687_hdk iot_sdk_demo clean (clean folder: out/mt7687_hdk/iot_sdk_demo)
Argument:
-f=<feature makefile> or --feature=<feature makefile>
Replace feature.mk with other makefile. For example,
the feature_example.mk is under project folder, f=feature_example.mk
will replace feature.mk with feature_example.mk.
-o=<make option> or --option=<make option>
Assign additional make options. For example,
to compile module sequentially, use -o=-j1;
to turn on specific feature in feature makefile, use o=<feature_name>=y;
to assign more than one options, use -o=<option_1> -o=<option_2>.
===============================================================
List Available Example Projects
===============================================================
Usage: ./build.sh list
• List all available boards and projects.
Run the command to show all available boards and projects:
./build.sh list
The available boards and projects are listed based on the related configuration files under
<sdk_root>/config/project/<board>/<project> folder. The console output is shown below.
================================================
Available Build Projects:
================================================
mt2523_hdk
accdet_detect_earphone_status
aes_encrypt_decrypt_data
atci_register_command
audio_mp3_play
audio_play_1k_tone
...
mt2523_watch
watch_demo
mt7697_hdk
bootloader
freertos_initialize_main_features
iot_sdk
• Build the project.
To build a specific project, simply run the following command.
./build.sh <board> <project>
The output files will be placed under <sdk_root>\out\<board>\<project> folder.
For example, to build a project on the LinkIt 2523 HDK, run the following build command.
./build.sh mt2523_hdk iot_sdk_demo
The standard output in the terminal window:
$ ./build.sh mt2523_hdk iot_sdk_demo
Build board:mt2523_hdk project:iot_sdk_demo
© 2015 - 2017 MediaTek Inc.
Page 47 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
platform=MINGW32_NT-6.1
/usr/home/ user_name/SDK_vn.n.n
FEATURE=feature.mk
SENSOR_FUSION_ALGO is ../../../../../middleware/MTK/sensor_subsys/fusion_algo/co mmon/lib_core make: Entering directory
`/usr/home/user_name/SDK_vn.n.n/project/mt2523_hdk/apps/ iot_sdk_demo/GCC'
...
The output files will be placed under <sdk_root>\out\mt2523_hdk\iot_sdk_demo\ folder.
• Build the project with the "bl" option.
By default, the pre-built bootloader image file is copied to the <sdk_root>\out\<board>\<project>\ folder after the project is built. The main purpose for the bootloader image is to download the Flash Tool.
Apply the "bl" option to rebuild the bootloader and use the generated bootloader image file instead of the prebuilt one, as shown below.
./build.sh <board> <project> bl
Note: The bootloader download mechanism is slightly different on LinkIt 2523 HDK from that on the LinkIt 76x7
HDK. On LinkIt 2523 HDK the bootloader image is combined with the project image file into a new image file named as flash.bin.
To build the project on the LinkIt 2523 HDK:
./build.sh mt2523_hdk iot_sdk_demo bl
The output image file of the project and the bootloader, along with the merged image file flash.bin, will be placed under <sdk_root>\out\mt2523_hdk\iot_sdk_demo folder.
To build the project on the LinkIt 76x7 HDK:
./build.sh mt7687_hdk iot_sdk_demo bl
The output image file of the project and the bootloader will be placed under
<sdk_root>\out\mt7687_hdk\iot_sdk_demo folder.
• Clean the out folder
The build script <sdk_root>\build.sh provides options to remove the generated output files as follows.
1)
Clean the <sdk_root>\out folder.
./build.sh clean
2)
Clean the <sdk_root>\out\<board> folder
./build.sh <board> clean
3) Clean the <sdk_root>\out\<board>\<projecct> folder.
./build.sh <board> <project> clean
2.4.3.2.
Building the project from the project GCC configuration directory
For this method, please follow the steps below:
1)
Change the current directory to project source directory where the SDK is located.
2) There are makefiles provided for the project build configuration. For example, the iot_sdk_demo is built by the project makefile under <sdk_root>\project\mt7687_hdk\apps\iot_sdk_demo\GCC.
© 2015 - 2017 MediaTek Inc.
Page 48 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
i)
Navigate to the example project’s location. cd <sdk_root>/project/mt7687_hdk/apps/iot_sdk_demo/GCC ii) Run the make command. make
The output folder is defined under variable BUILD_DIR in the Makefile located at
<sdk_root>\project\mt7687_hdk\apps\iot_sdk_demo\GCC:
BUILD_DIR = $(PWD)/Build
PROJ_NAME = mt7687_iot_sdk_demo
A project image mt7687_iot_sdk_demo.bin is generated under
<sdk_root>\project\mt7687_hdk\apps\iot_sdk_demo\GCC\Build.
2.5.
Create your own project
This section provides details on how to use an existing project and create your own project named my_project on LinkIt 7687 development board using iot_sdk_demo project as a reference.
2.5.1.
Using an existing project
Apply an existing project as a reference design for your own project development.
1)
Copy the folder <sdk_root>\project\mt7687_hdk\apps\iot_sdk_demo to a new directory
<sdk_root>\project\mt7687_hdk\apps\my_project.
Figure 33. Modify the Makefile under the GCC folder of my_project
2)
Modify the following settings defined in the
<sdk_root>\project\mt7687_hdk\apps\my_project\GCC\Makefile under the GCC folder (see
Figure 33) my_project, as shown below:
• SOURCE_DIR: the path to <sdk_root>.
• PROJ_NAME: project name.
• APP_PATH: project path.
…
SOURCE_DIR = ../../../../..
BINPATH = ~/gcc-arm-none-eabi/bin
PWD = $(shell pwd)
DATIME = $(shell date --iso=seconds)
© 2015 - 2017 MediaTek Inc.
Page 49 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
V ?= 0
…
# Project name
PROJ_NAME = mt7687_my_project
PROJ_PATH = $(PWD)
OUTPATH = $(PWD)/Build
APP_PATH = project/mt7687_hdk/apps/my_project
APP_PATH_SRC = $(APP_PATH)/src
…
2.5.2.
Removing a module
The copied project has modules that could be removed in order to have a clean start for your project development. After the previous steps, a project with the same features has been created. It can be built to generate image file as the original project.
To remove a module:
1)
Open the project Makefile from
<sdk_root>/project/mt7687_hdk/apps/my_project/GCC/Makefile.
2)
Locate the module include list of the project and remove any unwanted module by removing or commenting out the corresponding include statement.
…
########################################################################
######
#
# SDK source files
#
########################################################################
######
#include cjson include $(SOURCE_DIR)/middleware/third_party/cjson/module.mk
#include xml include $(SOURCE_DIR)/middleware/third_party/xml/module.mk
…
2.5.3.
Add the source and header files
User defined project source and header files should be placed under the src and the inc folder respectively, as
© 2015 - 2017 MediaTek Inc.
Page 50 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 34. Project source and header files under the project folder
To compile the added source code, simply add the .c source files to variable "C_FILES" and the header search path to variable "CFLAGS" in the project Makefile, as shown below. The corresponding variables to support compiling the source files (.cpp) of the module are CXX_FILES and CXXFLAGS).
<sdk_root>/project/mt7687_hdk/apps/my_project/GCC/Makefile
…
C_FILES += $(APP_PATH_SRC)/main.c \
$(APP_PATH)/GCC/syscalls.c \
$(APP_PATH_SRC)/detect.c \
$(APP_PATH_SRC)/detect_sensor/sensor_test.c
CXX_FILES +=
…
CFLAGS += -I$(SOURCE_DIR)/kernel/service/inc
CFLAGS += -I$(SOURCE_DIR)/$(APP_PATH)/inc/detect_sensor
CXXFLAGS +=
…
© 2015 - 2017 MediaTek Inc.
Page 51 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
3.
Getting Started Using Keil µVision IDE
This section provides a guide to getting started with the LinkIt SDK v4 with Keil µVision IDE . It covers the following items:
• The supporting environments for development.
• Installing the Microsoft Windows version of Keil.
• Building the Keil project.
• Downloading and running the Keil project.
• Debugging configuration on Keil.
• Creating a new Keil project.
3.1.
Environment
The SDK supports µVision IDE to build the project on Microsoft Windows OS. The suggested version is version 5.15.
3.2.
Installing the Microsoft Windows version of Keil
This section describes how to install the µVision IDE on PCs running Microsoft Windows.
3.2.1.
Installing the µVision IDE
The SDK is released as a package for µVision IDE . If you’ve already installed one of the supported µVision versions, you can skip this step. If you don’t have µVision installed:
1) Download the µVision IDE .
2)
Install the µVision IDE.
3.2.2.
Installing the Keil package for the SDK
Download the Keil package of the SDK from here . Double click on the file and install the package by following the
on-screen instructions, as shown in Figure 35.
© 2015 - 2017 MediaTek Inc.
Page 52 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 35. Installing LinkIt SDK with Keil IDE
finishes.
3.3.
Build the project
This section describes the required steps to build, download and run a project using the SDK with µVision IDE . The example projects are preconfigured for LinkIt 7687 HDK and LinkIt 2523 HDK, the example below is based on LinkIt
7687 HDK.
1) Launch the µVision IDE .
2)
Import the preconfigured project.
Figure 36. Importing the preconfigured project
© 2015 - 2017 MediaTek Inc.
Page 53 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
a)
Navigate to Project (see Figure 36) in the µVision IDE’s main menu, then Open Project. Click Open
to import the project. The project file is named as <project>.uvprojx, such as the one shown in
Figure 37. Project file for Keil
3)
Click Rebuild to build the project, as shown in Figure 38.
Figure 38. Building the project
4)
The Build Output window is updated with the result, as shown in Figure 39.
© 2015 - 2017 MediaTek Inc.
Page 54 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 39. Project build result
5)
The output binary iot_sdk_demo.axf is generated under project directory
<sdk_root>\out_keil\mt7687_hdk\iot_sdk_demo\iot_sdk_demo.axf.
3.4.
Download and run the project
This section describes how to download and run the project using the Keil µVision IDE on LinkIt development platform for RTOS including LinkIt 7687HDK and LinkIt 2523 HDK. The example below is based on LinkIt 7687 HDK.
The project is then built using the Keil µVision IDE.
There are three methods to download the project binary that is already built as described in Building Environment
Developer’s Guide.
1)
Download the project binary using the Keil µVision IDE.
2)
Download the project binary using MT76x7 Flash Tool. The MT2523 Flash Tool doesn’t support to download multiple binaries.
3)
Download the project binary using the LinkIt 7687 HDK as a removable storage.
3.4.1.
Downloading the project binary using the Keil µVision IDE
This method uses the µVision IDE integrated with CMSIS-DAP debugger.
© 2015 - 2017 MediaTek Inc.
Page 55 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
1)
Set the FLASH MODE (J25) jumper to FLASH Recovery mode.
2) Connect a micro-USB cable to power on the LinkIt 7687 HDK.
3) Click Options for Target or navigate to Project, then Options for … and select Target on the main
menu of the IDE (see Figure 40).
Figure 40. Set download configuration on µVision IDE
4)
Select Utilities tab, then browse for the Init File. Select the file and press Open. The configuration file for the SDK is named as flash.ini and located under <sdk_root>\tools\keil\mt7687, as shown in
Figure 41. Select configuration file
© 2015 - 2017 MediaTek Inc.
Page 56 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 42. Select flash initialization file (flash.ini)
5)
Navigate to the Debug tab to select the debug interface. The HDK supports the CMSIS-DAP interface, so
here you can select CMSIS-DAP Debugger (see Figure 43).
Figure 43. Select the CMSIS-DAP Debugger interface
6)
Click Settings to switch to Cortex-M Target Driver Setup and select Flash Download to add device
flash programming algorithm (see Figure 44).
© 2015 - 2017 MediaTek Inc.
Page 57 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 44. Select device flash programming algorithm
7)
Click Add to switch to Add Flash Programming Algorithm, then select the 7687 32Mbits SIP
Flash and click Add (see Figure 45).
Figure 45. Add device flash programming algorithm
8)
Skip this step, if downloading on the LinkIt 7687 HDK.
© 2015 - 2017 MediaTek Inc.
Page 58 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 46. Setup the parameters for downloading the project on LinkIt 2523 HDK
9)
Reset the board and then click LOAD to download the project binary to target (see Figure 47).
Figure 47. Download the project binary
3.4.2.
Downloading the project binary using Flash Tool or using HDK as a removable storage device
Before you start to download the project binary, configure the settings and rebuild the project using Keil µVision
IDE.
1)
Click Options for Target or navigate to Project, then Options for … and select Target on the
main menu of µVision IDE, as shown in Figure 40.
© 2015 - 2017 MediaTek Inc.
Page 59 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
2)
Navigate to User tab, select Run #1 and Run # 2 under After Build/Rebuild, fill fromelf.exe --
bin -o [email protected] #L, and fromelf.exe -c –[email protected] #L in User Command for Run #1 and
Run # 2, then select Beep When Complete, as shown in Figure 48.
Figure 48. User defined configurations
3)
Click Rebuild to build the project, as shown in Figure 38.
4) An output binary mt7687_iot_sdk_demo.bin will be generated in project directory
<sdk_root>\out_keil\mt7687_hdk\iot_sdk_demo\mt7687_iot_sdk_demo.bin.
Download the project binary following the details in MT76x7 Flash Tool User’s Guide or update the RTOS firmware through the removable storage based on the details in LinkIt 7687 HDK User’s Guide.
3.4.3.
Running the project
To run the project:
1)
Disconnect the USB cable to power off the board.
2)
Set FLASH MODE (J25) jumper to FLASH Normal mode.
3)
Reconnect the USB cable or reset the board to power on the board.
4) Open HyperTerminal (the default: HyperTerminal on Windows OS) program, and configure it as described in section “Host UART Configuration” of MediaTek LinkIt™ Development Platform for RTOS
System Log Developer's Guide, then observe the output log written from the project source files to ARM
Cortex-M4 UART port. The following is a reference log example.
© 2015 - 2017 MediaTek Inc.
Page 60 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
loader init [2016-04-28 15:03:10.924]
[2016-04-28 15:03:10.924] fota: TMP is empty, skip upgrade[2016-04-28 15:03:10.939]
[2016-04-28 15:03:10.939] jump to (0x1007c000) [2016-04-28 15:03:10.939] total avail space = 13748
[2016-04-28 15:03:10.955] nvdm init finished
[2016-04-28 15:03:10.955]
[T: 52 M: common C: INFO F: system_init L: 269]: FreeRTOS Running[2016-
04-28 15:03:10.970]
3.5.
Debug configuration
Keil µVision IDE uses the CMSIS-DAP/mbed debugger supported on LinkIt 7687 HDK and LinkIt 2523 HDK to debug the project. Here are the debug configurations based on LinkIt 7687 HDK after the project is built and downloaded with the IDE.
1)
Disconnect the micro-USB cable to power off the board.
2) Set the FLASH MODE (J25) jumper to FLASH Normal mode.
3) Reconnect the USB cable or reset the board to power on the board.
4)
Launch the µVision IDE.
5)
Click Options for Target or navigate to Project, then Options for … and select Target on the main
menu of, as shown in Figure 40.
6)
Navigate to Debug tab in the Options for Target to select the CMSIS-DAP Debugger, as shown in
Figure 49. Configure the debug settings
7)
Click Settings to switch to Cortex-M Target Driver Setup, then select Debug tab to set the
configuration parameters and click OK, as shown in Figure 50.
• SWJ Port: SW
•
Max Clock: 1MHz
© 2015 - 2017 MediaTek Inc.
Page 61 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 50. Setting the debug parameters on LinkIt 7687 HDK
8)
If debugging on LinkIt 2523 HDK, set AP as 0x03, as shown in Figure 51.
•
AP: 0x03
© 2015 - 2017 MediaTek Inc.
Page 62 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 51. Setting the debug parameters on LinkIt 2523 HDK
9)
Click Debug to start debugging the project, as shown in Figure 52.
© 2015 - 2017 MediaTek Inc.
Page 63 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 52. Debugging a project on Keil IDE
Note, Keil debugging is impossible in sleep mode. For more information, please refer to LinkIt for RTOS Power
Mode Developers Guide under <sdk_root>/doc.
© 2015 - 2017 MediaTek Inc.
Page 64 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
4.
Getting Started Using IAR
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
This section provides a guide to getting started with the LinkIt SDK v4 with IAR embedded workbench. It covers the following items:
• The supported environments for development.
• Installing the Microsoft Windows version of IAR.
• Building the IAR project.
• Downloading and running the IAR project.
• Configuring the debug settings on IAR.
• Creating your own IAR project.
4.1.
Environment
The SDK supports IAR Embedded Workbench (suggested version is 7.50.1.10273) to build the project on Microsoft
Window OS.
4.2.
Supported features on LinkIt HDK
4.3.
Installing the Microsoft Windows version of IAR
If you’ve already installed one of the supported IAR versions, you can skip this step. If you don’t have IAR installed:
1)
Download the iar-embedded-workbench .
2)
Install the IAR Embedded Workbench.
4.4.
Build the project
The example projects are preconfigured for LinkIt 2523 HDK and LinkIt 7687 HDK, the example below is based on
LinkIt 2523 HDK.
To build the project:
1) Launch the IAR Embedded Workbench IDE.
2)
Import the pre-configured project.
© 2015 - 2017 MediaTek Inc.
Page 65 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 53. Importing the preconfigured project
a)
Figure 54. Adding an existing project
3)
Click Rebuild to build the project, as shown in Figure 55.
© 2015 - 2017 MediaTek Inc.
Page 66 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 55. Rebuild the project
4) When the build operation is complete, the Build output window is updated with the result, as shown in
Figure 56. Project build result on IAR Embedded Workbench IDE
5) The output binary freertos_thread_creation.out is generated under project directory
<sdk_root>\out_iar\mt2523_hdk\freertos_thread_creation\freertos_thread_creatio n.out.
4.5.
Download and run the project
This section describes how to download and run the project using the IAR Embedded Workbench on LinkIt development platform for RTOS including LinkIt 2523 and LinkIt 7687. The example blew is based on LinkIt 2523
HDK. The project is then built using the IAR Embedded Workbench.
4.5.1.
Download the project
© 2015 - 2017 MediaTek Inc.
Page 67 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
This method uses the IAR IDE integrated with CMSIS DAP debugger.
To download the project:
1) Connect micro-USB connector to power on the LinkIt 2523 HDK.
2)
Click Options on IAR Embedded Workbench (see Figure 57).
Figure 57. Set download configuration on IAR IDE
3)
Choose Debugger item, then browse for the Setup. a)
Set Driver to CMSIS-DAP debugger (see Figure 58).
b) Set the Device description file to MT2523.ddf located under <sdk_root>\tools\iar\mt2523,
© 2015 - 2017 MediaTek Inc.
Page 68 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 58. Select debug driver and ddf file
© 2015 - 2017 MediaTek Inc.
Page 69 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 59. Open the MT2523.ddf file
4)
Navigate to the Download tab and configure the settings as shown in Figure 60).
a)
The board file is located under <sdk_root>\tools\iar\mt2523, as shown in Figure 61.
© 2015 - 2017 MediaTek Inc.
Page 70 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 60. Configure the download settings
© 2015 - 2017 MediaTek Inc.
Page 71 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 61. Select the board file
5)
Choose Linker and Navigate to the input tab to modify setting as below, as shown in Figure 62.
• Keep symbols: __bootloader
• File: $PROJ_DIR$\..\..\..\..\..\tools\iar\mt2523\bootloader\bootloader.bin
• Symbol: __bootloader
• Section: .bootloader
• Align: 8
© 2015 - 2017 MediaTek Inc.
Page 72 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 62. Set extra download Image
Next, configure the CMSIS-DAP settings under Category and then:
1)
Navigate to JTAG/SWD tab and provide the interface (see Figure 63).
© 2015 - 2017 MediaTek Inc.
Page 73 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 63. JTAG/SWD settings
2) Reset the board and then navigate to Project, then Download and click Download file… to download
the project binary to target (see Figure 64).
© 2015 - 2017 MediaTek Inc.
Page 74 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 64. Download the project binary
Note, if you’re using the LinkIt 7687 HDK, make sure the board is switched to Flash Recovery mode by setting
after downloading the binary file to run the project.
4.5.2.
Running the project
To run the project:
1)
Remove the USB cable to power off the board.
2)
Reconnect the USB cable or press the reset button to power on the board.
3) Open HyperTerminal (the default: HyperTerminal in Windows operation system) program, and configure it as in section “Host UART Configuration” of the MediaTek LinkIt™ Development Platform for
RTOS System Log Developer's Guide, then watch the output log written from the project source files to
ARM Cortex-M4 UART port. The following is a reference log example. loader init [2016-04-28 15:03:10.924]
[2016-04-28 15:03:10.924] fota: TMP is empty, skip upgrade[2016-04-28 15:03:10.939]
[2016-04-28 15:03:10.939] jump to (0x1007c000) [2016-04-28 15:03:10.939] total avail space = 13748
[2016-04-28 15:03:10.955] nvdm init finished
[2016-04-28 15:03:10.955]
[T: 52 M: common C: INFO F: system_init L: 269]: FreeRTOS Running[2016-04-28
15:03:10.970]
© 2015 - 2017 MediaTek Inc.
Page 75 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
4.6.
Debug configuration
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
The IAR Embedded Workbench IDE uses the CMSIS-DAP/mbed debugger supported on LinkIt 7687 HDK and LinkIt
2523 HDK to debug the project. Here are the debug configurations based on LinkIt 2523 HDK after the project is built and downloaded with IAR Embedded Workbench.
1) Remove the USB cable to power off the board.
2)
Reconnect the 2523 USB port using a micro-USB cable, as shown in Figure 13 and reset the board to
power it on.
3)
Reconnect the MK20 port using a micro-USB cable, as shown in Figure 13 to connect the CMSIS DAP
debug interface.
4)
Open the IAR Embedded Workbench tool.
5)
Navigate to Project, and click Debug without Downloading, as shown in Figure 65.
Figure 65. Debugging the project without downloading
6)
Click Debug to start debugging, as shown in Figure 66.
© 2015 - 2017 MediaTek Inc.
Page 76 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
Figure 66. Debugging a project on IAR
Note, IAR debugging is impossible in sleep mode. For more information, please refer to LinkIt for RTOS Power
Mode Developers Guide under <sdk_root>/doc.
© 2015 - 2017 MediaTek Inc.
Page 77 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
MediaTek LinkIt™ Development Platform for RTOS Get Started Guide
5.
Appendix A: Acronyms and Abbreviations
The acronyms and abbreviations used in this get started guide are listed in Table 14.
Table 14. Acronyms and Abbreviations
Abbreviation/Term
ATCI
ANSI
DBCS
FOTA
Expansion/Definition
AT command interface (ATCI), usually AT commands are used to control modems to do their specified functions, they are also used to production line test.
The American National Standards Institute
A double-byte character set (DBCS) is a character encoding in which all characters (including control characters) are encoded in two bytes.
Firmware over the air, a way to update firmware using wireless communication
GNSS
NEC
NVDM
OEM
RC5
RC6
TLS
WEP
WPS
Global Navigation Satellite System
A kind of Infrared Transmission Protocol, The NEC IR transmission protocol uses pulse distance encoding of the message bits.
Non-Volatile Data Management
Original Equipment Manufacturer (OEM) is a company that makes a part or subsystem that is used in another company's end product.
A type of infrared transmission protocol. The RC-5 protocol was developed by Philips in the late 1980s as a semi-proprietary consumer IR (infrared) remote control communication protocol for consumer electronics.
A type of infrared transmission protocol. RC-6 is, as may be expected, the successor of the RC-5 protocol. Like RC-5 the new
RC-6 protocol was also defined by Philips. It is a very versatile and well-defined protocol.
Transport Layer Security (TLS) is cryptographic protocols that provide communications security over a computer network.
Wired Equivalent Privacy
Wi-Fi Protected Setup (WPS; originally Wi-Fi Simple
Configuration) is a network security standard to create a secure wireless home network.
© 2015 - 2017 MediaTek Inc.
Page 78 of 78
This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly prohibited.
Download
Advertisement
Key features
Wi-Fi
Bluetooth/Bluetooth Low Energy
GNSS
Sensor subsystem
Battery management
FOTA
FreeRTOS
Frequently asked questions
MediaTek LinkIt Development Platform™ is a software development kit (SDK) that provides the software and tools for your application development on LinkIt 7687/7697/2523 HDKs. The SDK includes drivers for hardware abstraction layer, peripherals, connectivity, such as Wi-Fi, Bluetooth/Bluetooth Low Energy, GNSS, sensor subsystem, lightweight IP (lwIP) and other third party features. It also provides battery management, Firmware update Over-The-Air (FOTA) and FreeRTOS.
LinkIt 7687/7697/2523 HDKs are supported.
The SDK includes drivers for hardware abstraction layer, peripherals, connectivity, such as Wi-Fi, Bluetooth/Bluetooth Low Energy, GNSS, sensor subsystem, lightweight IP (lwIP) and other third party features. It also provides battery management, Firmware update Over-The-Air (FOTA) and FreeRTOS.