Getting Started with MQX RTOS for Kinetis SDK

Similar documents
MQX RTOS Release Notes for Kinetis SDK v1.2.0 for KL33Z64 for FRDM-KL43Z Freescale Freedom Development Platform

MQX RTOS Release Notes for Kinetis SDK FRDM- KV10Z Freescale Freedom Development Platform

Kinetis SDK v Release Notes for KV5x Derivatives

Getting Started with Freescale MQX RTOS for Kinetis SDK and MDK-ARM Keil

Kinetis SDK Release Notes for the TWR-K24F120M Tower System Module

Getting Started with Freescale MQX RTOS for Kinetis SDK and ARM GCC

Getting Started with Freescale MQX RTOS for Kinetis SDK and Kinetis Design Studio IDE

Kinetis SDK v Release Notes for the MK21DA5 and MKW24D5 Devices

Freescale Kinetis Software Development Kit Release Notes

Freescale MQX RTOS for Kinetis SDK Release Notes version beta

Kinetis SDK Freescale Freedom FRDM-KL03Z Platform User s Guide

FRDM-K64F Board Errata

Freescale MQX USB Stack for TWR-K24F120M GA User s Guide

Kinetis KE1xF512 MCUs

Getting Started with MCUXpresso SDK CMSIS Packs

Getting Started with FreeRTOS BSP for i.mx 7Dual

Building U-Boot in CodeWarrior ARMv8

Kinetis Bootloader v1.2.0 Release Notes

Adding a run control interface into an existing CodeWarrior for MCU v10.x project

Freescale MKW40Z IEEE Software Quick Start Guide

Emulating Dual SPI Using FlexIO

Getting Started with the MCU Flashloader

TWR-KV10Z32 Sample Code Guide for IAR Board configuration, software, and development tools

Freescale MQX RTOS TWR-K64F120M Release Notes

Keil uvision 4 Kinetis Support for Freescale MQX RTOS Release Notes

Processor Expert Software for i.mx Processors Version 1.0

Freedom FRDM-MC-LVBLDC Development Platform User s Guide

Load Position-Independent Code (PIC) on a Kinetis Platform Using the IAR EWARM Compiler

Offline Flash Programmer for Kinetis K- and L-series MCUs

Collecting Linux Trace without using CodeWarrior

Kinetis USB-KW41Z Wireless Protocol Sniffer Quick Start Guide

Three-Phase Power Meter Hardware Design Reference Manual

OpenSDA on TWR-KW2x. User s Guide Rev 1.1

Working around ERR7026 according to application needs

Intelligent Sensing Framework 2.1 for Kinetis Errata Sheet

HVP-KV10Z32 User s Guide

TWR-KV10Z32 Sample Code Guide for CodeWarrior Board configuration, software, and development tools

i.mx 7 Dual/Solo Product Lifetime Usage

DDR Validation Tool Getting Started Guide

General C Functions for the etpu Covers the MCF523x, MPC5500, MPC5600, MPC5700, MPX40 and all etpu-equipped Devices

MCUXpresso SDK USB Power Delivery

Component Development Environment Getting Started Guide

Kinetis Updater User's Guide

Kinetis KV5x Real-Time Control MCUs with Ethernet Up to 1 MB Flash and 256 KB SRAM

MQX RTOS for Kinetis SDK Release Notes

Quick Start Guide for FRDM-FXS-MULTI-B

i.mx 6Solo/6DualLite Product Lifetime Usage Estimates

CodeWarrior Development Studio Processor Expert RTOS Adapter User Guide

WPR1500-LDO MP Receiver V2.1 Reference Design User s Guide

i.mxrt1050 Product Lifetime Usage Estimates

Getting Started with Kinetis SDK (KSDK) v.1.3

TWR-LS1021A Getting Started

Integrate TWR-EPD Software with MQX RTOS Based on the TWR-K21F120M Platform

Getting Started with Kinetis SDK (KSDK) v.1.2

i.mx 6ULL Product Usage Lifetime Estimates

HVP-KV31F120M User s Guide

Kinetis KL1x General-Purpose Ultra-Low- Power MCUs Up to 256 KB Flash and 32 KB SRAM

How to setup pre-build steps in CodeWarrior for Microcontrollers v10.x

MCU Bootloader Release Notes

Using an External GCC Toolchain with CodeWarrior for Power Architecture

Emulating I2C Bus Master by using FlexIO

Kinetis KM3x Metrology MCUs based on ARM Cortex -M0+ Core

i.mx 6UltraLite Product Usage Lifetime Estimates

i.mx 6 Android JB 4.3_1.1.1 Patch Release Notes

TWR-LS1021A Getting Started

PMSM Field-Oriented Control Using MC56F84789 DSC With Encoders Demo Guide

Kinetis Bootloader to Update Multiple Devices in a Field Bus Network

FRDM-KL03Z User s Guide

UM1727 User manual. Getting started with STM32 Nucleo board software development tools. Introduction

Quick Start Guide for the Freescale Freedom Development Platform FRDM-KL43Z

Configuring DDR in U-Boot using QCVS

Quick Start Guide for FRDM-KL05Z

Installing Service Pack Updater Archive for CodeWarrior Tools (Windows and Linux) Quick Start

Hands-On Workshop: Developing with the Kinetis Software Development Kit

Single Chip Module (SCM) Package-on- Package (PoP) Assembly Guide

Using DMA for Pulse Counting on S32K

FRDM-KE02Z User s Manual

Kinetis Motor Suite v1.2.0 Release Notes

Generating a Quick and Controlled Waveform With the DAC

Watt Saver Software Component (WSC)

How to use FlexMemory as D-Flash and EEPROM in KE1xF

Getting started with X-CUBE-LED channel LED driver software expansion based on LED1642GW for STM32Cube

UM1853 User manual. STM32CubeF1 Nucleo demonstration firmware. Introduction

Kinetis Bootloader Demo Application User's Guide

P1010RDB-PB Quick Start Guide

NXP Semiconductors MCU Bootloader Demo Applications User's Guide

MQX RTOS for Kinetis SDK Release Notes

FRDM-KE04Z User s Guide User Guide

How to Enable Boot from QSPI Flash

QN9080 QN908x RF Certification Guide

i.mx 6 Yocto Project Patch Release Notes

Kinetis Flash Tool User's Guide

MCUXpresso SDK CMSIS Packs Release Notes

Smart Plug Software Design Reference Manual

Quick Start Guide for FRDM-KL46Z Rev 1

Power Consumption and Measurement of i.mx RT1020

Kinetis Flash Tool User's Guide

Quick Start Guide. TWR-KV10Z32 Development Kit for Kinetis KV1x Family TOWER SYSTEM

Getting started with the X-CUBE-IKA02A1 multifunctional software expansion for STM32Cube

CodeWarrior Development Studio for StarCore 3900FP DSP v SP3 Release Notes

Transcription:

Freescale Semiconductor Document Number: MQXKSDKGSUG User's Guide Rev. 1, 04/2015 Getting Started with MQX RTOS for Kinetis SDK 1 Introduction This document describes the steps required to configure supported development tools used to build, run, and debug applications with the Freescale MQX RTOS operating system targeted for Kinetis Software Development Kit (KSDK). 2 MQX RTOS role in the KSDK Contents 1 Introduction...1 2 MQX RTOS role in the KSDK......1 3 Building the MQX RTOS libraries...2 4 MQX RTOS Example Application...3 5 Building MFS or RTCS library......5 6 The I/O subsystem NIO...... 5 7 Differences between MFS and FatFS...6 The Kinetis Software Development Kit (KSDK) is a software framework for developing applications on Kinetis MCUs. The software components in the framework include hardware abstraction layers (HAL), peripheral drivers, libraries, middleware, and more. The Kinetis SDK also includes an operating system abstraction (OSA) layer for application developers to extend the capabilities of the KSDK with the addition of a supported real time operating system (RTOS). This version of Freescale MQX RTOS adopts the Kinetis SDK architecture for the platform features that the KSDK provides, and adds additional components that have traditionally been available within standard MQX RTOS release packages. 2015 Freescale Semiconductor, Inc.

Building the MQX RTOS libraries Application developers can now use MQX RTOS, communication stacks, file system, and other components with KSDK libraries and peripheral drivers. 3 Building the MQX RTOS libraries Basic MQX RTOS based user application is created from application code itself and from set of libraries. Text below will provide a guide describing build process and basic configuration: MQX RTOS Kernel and core components mqx.a (mandatory) KSDK HAL and driver library built in the MQX RTOS configuration libksdk_platform_mqx.a (mandatory) MQX STDLIB - Subset of Standard C-Library - mqx_stdlib.a (optional) MFS - FAT12/16/32 filesystem mfs.a (optional) RTCS TCPIPv4/v6 stack rtcs.a (optional) USB Host and Device stack (optional) This document assumes the Kinetis SDK and MQX RTOS are installed on your computer. It also assumes: <KSDK_DIR> is the directory where the Kinetis SDK package is installed on your hardware. <MQX_DIR> is the directory where MQX RTOS is located within KSDK, specifically <KSDK_DIR>/rtos/mqx. <board> replaces the name of the board (e.g., twrk64f120m). <mcu> replaces the name of the processor (e.g., mk64f120m). <tool> replaces the name of the toolchain (e.g., IAR). <target> replaces the name of the project target (e.g., Debug). <library> replaces the name of the library (e.g., mqx_stdlib). 3.1 Build targets in libraries Each build project in Freescale MQX RTOS contains multiple compiler/linker configurations called build targets. Two different types of build targets exist for different compiler optimization settings: Debug the compiler optimizations are turned off or set to low. The compiled code is easy to debug but may be less effective and much larger than the release build. Release the compiler optimizations are set to maximum. The compiled code is very hard to debug and should be used for final applications only. 3.2 Compile-time configuration The configuration of the board for the MQX RTOS application is specified in the configuration header files. Major compiletime configuration options for specific supported boards are grouped in the user configuration file located in: <MQX_DIR>/config/board/<board>/user_config.h Some of the board configuration settings are taken from the KSDK's board.h settings located in <KSDK_DIR>/boards/ <board>/board.h The processor and architecture specific configuration for MQX RTOS and KSDK MQX RTOS library is in the user configuration file located in: <MQX_DIR>/config/mcu/<mcu>/mqx_sdk_config.h 2 Freescale Semiconductor, Inc.

MQX RTOS Example Application The user configuration files are included internally from the libraries. The configuration for the board or processor can be retrieved from the files. 3.3 Library build process After either the compile-time user configuration file or MQX kernel source files are changed, rebuild the MQX RTOS libraries. The minimalistic application use the MQX Kernel and KSDK Platform libraries, but most of the applications require additional components such as MQX RTOS stdlib library, MFS FAT32 Filesystem or RTCS TCPIP stack. Example application workspaces located next to the application projects contains all libraries required by given application. After successful compilation of each MQX library all header files describing library API are copied to one directory: <MQX_DIR>/lib/<board>.<tool>/<board>/debug/<library>. The necessary header files required for the application consist of: user_config.h mqx_sdk_config.h device driver public headers kernel public headers KSDK Platform library consisting of device drivers and HAL is located in following directory: <KSDK_DIR>/lib/ksdk_mqx_lib/<tool>/<mcu> 4 MQX RTOS Example Application MQX RTOS software provides a broad set of example applications. The examples are written to demonstrate the most frequently used features of the MQX RTOS and other components. Examples for RTOS kernel features are available in <MQX_DIR>/mqx/examples directory, RTCS TCPIP stack examples in <KSDK_DIR>/middleware/tcpip/rtcs/examples directory and MFS examples in <KSDK_DIR>/middleware/filesystem/mfs/examples directory. 4.1 Build targets in applications Similary as Library projects, Example projects in Freescale MQX RTOS contains multiple compiler/linker configurations called build targets. Two different types of build targets exist for different compiler optimization settings: Debug the compiler optimizations are turned off or set to low. The compiled code is easy to debug but may be less effective and much larger than the release build. Application code is linked with libraries build with Debug setting: <MQX_DIR>/lib/<board>.<tool>/<board>/debug/<library>/*.* <KSDK_DIR>/lib/ksdk_mqx_lib/<tool>/<mcu>/debug/*.* Release the compiler optimizations are set to maximum. The compiled code is very hard to debug and should be used for final applications only. Application code is linked with libraries build with Release setting: <MQX_DIR>/lib/<board>.<tool>/<board>/release/<library>/*.* <KSDK_DIR>/lib/ksdk_mqx_lib/<tool>/<mcu>/release/*.* 4.2 Building your first MQX RTOS application Freescale Semiconductor, Inc. 3

MQX RTOS Example Application To build one specific example application, use the workspace which contains all project files (library and application) for that specific example. 1. Open the workspace file for a specific example located in the <MQX_DIR>/mqx/examples/<example>/build/<tool>/ <example>_<board>/<example>_<board>.* 2. Build the required targets (e.g., Debug) in all library projects contained in the workspace. 3. Build the required targets (e.g., Debug) in example application projects contained in the workspace. 4. Run the application. 4.3 Building your first MQX application with IAR EWARM IDE For detailed information about the MQX RTOS support and building process in IAR tool, see Getting Started with Freescale MQX RTOS and IAR Embedded Workbench (document MQXGSIAR). The document is located in <KSDK_dir>/doc/ rtos/mqx/mqx RTOS IDE Guides/. 4.4 Building your first MQX RTOS application with Freescale KDS IDE For detailed information about the MQX RTOS support and building process in KDS IDE tool, see Getting Started with Kinetis Design Studio IDE and Freescale MQX RTOS (document MQXKDSUG). The document is located in <mqx_install_dir>/doc/rtos/mqx/mqx RTOS IDE Guides/. 4.5 Building your first MQX RTOS application with Keil µvision 4 For detailed information about the MQX RTOS support and building process in Keil μvision4 tool, see Getting Started with Freescale MQX RTOS and MDK-ARM Keil μvision4 (document MQXGSKEIL). The document is located in <mqx_install_dir>/doc/rtos/mqx RTOS IDE Guides/MQX-KSDK-uVision4-Getting-Started.pdf document. 4.6 Building your first MQX RTOS application with Atollic TrueSTUDIO For detailed information about the MQX RTOS support and building process in Atollic TrueSTUDIO tool, see Getting Started with Freescale MQX RTOS for Kinetis SDK and Atollic TrueSTUDIO for ARM (document KSDKGSATLUG) <mqx_install_dir>/doc/rtos/mqx/mqx-ksdk-atollic-getting-started.pdf document. 4.7 Building your first MQX RTOS application with cmake and GCC compiler For detailed information about the MQX RTOS support and building process in cmake and GCC tool see <mqx_install_dir>/doc/rtos/mqx/mqx RTOS IDE Guides/MQX-KSDK-ARMGCC-Getting-Started.pdf document. 4 Freescale Semiconductor, Inc.

Building MFS or RTCS library 5 Building MFS or RTCS library This section describes the build process for the MFS and RTCS libraries. The MFS library implements Microsoft FAT file systems, specifically FAT12, FAT16, and FAT32. The RTCS library is a library for the POSIX-like TCP/IP stack. In the subsequent sections, these placeholders are used: <MFS_DIR> is the location of MFS directory, specifically <KSDK_DIR>/filesystem/middleware/mfs <RTCS_DIR> is the location of RTCS directory, specifically <KSDK_DIR>/middleware/tcpip/rtcs 5.1 MFS/RTCS library build process After the compile-time user configuration file or MFS/ RTCS configuration files are changed, rebuild the MFS/ RTCS library. The workspace with library can be found at this location: MFS library: <MFS_DIR>/build/<tool>/mfs_<board> RTCS library: <RTCS_DIR>/build/<tool>/rtcs_<board> 5.2 Building your first MFS application This example of a build procedure is based on IAR Embedded Workbench. 1. Build the MQX RTOS libraries as described in section 4. 2. Open the IAR EWARM workspace file. An example is located at: <MFS_DIR>/examples/<example_name>/build/ <tool>/<example_name>_<board> e.g., <MFS_DIR>/examples/ramdisk/build/iar/ramdisk_twrk64f120m/ramdisk_twrk64f120m.eww. The workspace contains the necessary library projects which should be built before the example. In this case, the MFS library mfs_twrk64f120m.ewp. 3. After building the MFS library, build the Debug target of the application project. 4. Run the application. 6 The I/O subsystem NIO The file streaming functionality was moved from the MQX RTOS PSP library into MQX RTOS stdlib library. The NIO covers only the I/O file descriptor handling. The MQX RTOS for KSDK 1.2.0 comes with new I/O subsystem called NIO. The NIO subsystem was designed for application developers and device driver developers to handle variety of devices with POSIX-compliant API. The application developer should refer to the POSIX standard to use the device drivers registered in the NIO. Freescale Semiconductor, Inc. 5

Differences between MFS and FatFS 7 Differences between MFS and FatFS In the basic KSDK installation, you can find the open source FatFS filesystem library located in <KSDK_DIR>/middleware/ filesystem/fatfs. The MQX RTOS uses its own specific MFS filesystem library, installed in <KSDK_DIR>/middleware/filesystem/mfs. It is up to the application developer to choose which package to use. This table addresses most questions regarding file systems contained in KSDK. Table 1. File systems in KSDK Criteria MFS FatFS Measurement conditions, remarks Reentrancy YES NO The FatFS supports reentrancy with _FS_REENTRANT, but it is set to 0 by default. No adaptation for supported RTOS in KSDK is provided. API compliancy POSIX ANSI-C The FatFS uses its own API. The POSIX-compliant API provided by MFS simplifies porting applications to/from other POSIX systems. Multiple partitions YES NO Multiple instances YES NO SDCARD driver YES YES USB MSD driver YES YES RAMDISK driver YES NO 8 Revision History This table summarizes revisions to this document. Table 1 Revision History Revision number Date Substantial changes 1 04/2015 Kinetis SDK 1.2.0 release 0 12/2014 Kinetis SDK 1.1.0 release 6 Freescale Semiconductor, Inc.

How to Reach Us: Home Page: freescale.com Web Support: freescale.com/support Information in this document is provided solely to enable system and software implementers to use Freescale products. There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits based on the information in this document. Freescale reserves the right to make changes without further notice to any products herein. Freescale makes no warranty, representation, or guarantee regarding the suitability of its products for any particular purpose, nor does Freescale assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. Typical parameters that may be provided in Freescale data sheets and/or specifications can and do vary in different applications, and actual performance may vary over time. All operating parameters, including typicals, must be validated for each customer application by customer's technical experts. Freescale does not convey any license under its patent rights nor the rights of others. Freescale sells products pursuant to standard terms and conditions of sale, which can be found at the following address: freescale.com/ SalesTermsandConditions. Freescale, the Freescale logo, Kinetis, Processor Expert are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. Tower is a trademark of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. ARM, ARM Powered logo, Keil, and Cortex are registered trademarks of ARM Limited (or its subsidiaries) in the EU and/or elsewhere. All rights reserved. 2015 Freescale Semiconductor, Inc. Document Number MQXKSDKGSUG Revision 1, 04/2015