TWR-KV31F120M Sample Code Guide for IAR Board configuration, software, and development tools Rev.0



Similar documents
HVP-KV31F120M Quick Start Guide

Getting Started with Kinetis SDK (KSDK)

Building and Debugging a project using Keil MDK-ARM Eclipse plug-in

MED-AFEs Design Reference Manual

Quick Start Guide. MRB-KW01 Development Platform Radio Utility Application Demo MODULAR REFERENCE BOARD

Quick Start Guide. TWR-MECH Mechatronics Board TOWER SYSTEM

UART Boot Loader Design on the Kinetis E Series

Quick Start Guide. USB Packet Sniffer/Dongle for Kinetis MKW22D and MKW24D Wireless MCUs USB-KW24D512

How To Build A Project On An Eclipse Powerbook For Anarc (Powerbook) On An Ipa (Powerpoint) On A Microcontroller (Powerboard) On Microcontrollers (Powerstation) On Your Microcontroller 2 (Powerclock

Production Flash Programming Best Practices for Kinetis K- and L-series MCUs

USB to SPI Device Driver Installation Instructions

CodeWarrior Development Studio for Freescale S12(X) Microcontrollers Quick Start

APPLICATION NOTE. AT07175: SAM-BA Bootloader for SAM D21. Atmel SAM D21. Introduction. Features

Audio player on KwikStik

Lab Experiment 1: The LPC 2148 Education Board

Kinetis Bootloader v2.0.0 Release Notes

Processor Expert Software Microcontrollers Driver Suite Getting Started Guide

How To Use A Watt Saver On A Microcontroller (Watt Saver) On A Cell Phone Or Mp3 Player

SKP16C62P Tutorial 1 Software Development Process using HEW. Renesas Technology America Inc.

Windows 7: Using USB TAP on a Classic CodeWarrior Installation (MGT V9.2 DSC V8.3)

USER GUIDE EDBG. Description

FRDM-KL25Z User's Manual Rev. 1.0

76-77 GHz RF Transmitter Front-end for W-band Radar Applications

How To Develop A Toolstick

3. Programming the STM32F4-Discovery

Start A New Project with Keil Microcontroller Development Kit Version 5 and Freescale FRDM-KL25Z

PC Base Adapter Daughter Card UART GPIO. Figure 1. ToolStick Development Platform Block Diagram

32-bit AVR UC3 Microcontrollers. 32-bit AtmelAVR Application Note. AVR32769: How to Compile the standalone AVR32 Software Framework in AVR32 Studio V2

AN10866 LPC1700 secondary USB bootloader

Robust Over-the-Air Firmware Updates Using Program Flash Memory Swap on Kinetis Microcontrollers

How to Run the MQX RTOS on Various RAM Memories for i.mx 6SoloX

UM1680 User manual. Getting started with STM32F429 Discovery software development tools. Introduction

Designing an Induction Cooker Using the S08PT Family

Figure 1. 8-Bit USB Debug Adapter

Getting Started with the Xilinx Zynq All Programmable SoC Mini-ITX Development Kit

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

USBSPYDER08 Discovery Kit for Freescale MC9RS08KA, MC9S08QD and MC9S08QG Microcontrollers User s Manual

AN655 R ANGE TEST APPLICATION FOR EZRADIO AND EZRADIOPRO. 1. Introduction. 2. Supported Radio Types

Freescale, the Freescale logo and CodeWarrior are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. Xtrinsic is a trademark of

Table of Contents. ARM Evaluation Board (AEB-1) Welcome Guide ARM DGI 0005D. Proprietary Notice

Quick Start Tutorial. Using the TASKING* Software Development Tools with the Intel 8x930 Family Evaluation Board

UM0985 User manual. Developing your STM32VLDISCOVERY application using the IAR Embedded Workbench software. Introduction

Applications Development on the ARM Cortex -M0+ Free On-line Development Tools Presented by William Antunes

Building an Embedded Processor System on a Xilinx Zync FPGA (Profiling): A Tutorial

UG103.8 APPLICATION DEVELOPMENT FUNDAMENTALS: TOOLS

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

BLE113 DEVELOPMENT KIT

Nuvoton Nu-Link Debug Adapter User Manual

AN3354 Application note

Installation of the MMA955xL CodeWarrior Service Pack Author: Fengyi Li Application Engineer

etpu Host Interface by:

COM Port Stress Test

AVR1900: Getting started with ATxmega128A1 on STK bit Microcontrollers. Application Note. 1 Introduction

UG103.8: Application Development Fundamentals: Tools

MPR121 Serial Communication

AT91SAM ARM-based Flash MCU. Application Note

32F072BDISCOVERY. Discovery kit for STM32F072xx microcontrollers. Features. Description

How To Use An Atmel Atmel Avr32848 Demo For Android (32Bit) With A Microcontroller (32B) And An Android Accessory (32D) On A Microcontroller (32Gb) On An Android Phone Or

CP2110-EK CP2110 EVALUATION KIT USER S GUIDE. 1. Kit Contents. 2. Relevant Documentation. 3. Software Setup

QorIQ espi Controller Register Setting Considerations and Programming Examples

Tutorial for MPLAB Starter Kit for PIC18F

Capacitive Touch Lab. Renesas Capacitive Touch Lab R8C/36T-A Family

Atmel AVR4920: ASF - USB Device Stack - Compliance and Performance Figures. Atmel Microcontrollers. Application Note. Features.

Using WinUSB in a Visual Studio Project with Freescale USB device controller

Using the Kinetis Security and Flash Protection Features

Developing an Application on Core8051s IP-Based Embedded Processor System Using Firmware Catalog Drivers. User s Guide

STM32F4DISCOVERY. Discovery kit with STM32F407VG MCU. Features. Description

How To Add A Usb Secondary Ipo Bootloader To An Lpc23Xx Flash Device To A Flash Device

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

UM1969 User manual. Getting started with STM32F746G discovery software development tools. Introduction

Getting started with software and firmware environments for the STM32F0DISCOVERY kit

SmartFusion csoc: Basic Bootloader and Field Upgrade envm Through IAP Interface

AN LPC1700 timer triggered memory to GPIO data transfer. Document information. LPC1700, GPIO, DMA, Timer0, Sleep Mode

Pre-tested System-on-Chip Design. Accelerates PLD Development

Software Real Time Clock Implementation on MC9S08LG32

Block 3 Size 0 KB 0 KB 16KB 32KB. Start Address N/A N/A F4000H F0000H. Start Address FA000H F8000H F8000H F8000H. Block 2 Size 8KB 16KB 16KB 16KB

APPLICATION. Using the PB-100 to Make Calls and Announcements From a Database. Using the PB-100 for All-Call Dialing

UM1790 User manual. Getting started with STM32L053 discovery kit software development tools. Introduction

QSG105 GETTING STARTED WITH SILICON LABS WIRELESS NETWORKING SOFTWARE

AN220 USB DRIVER CUSTOMIZATION

AN3990 Application note

USB Mass Storage Device Host Bootloader

Developing an Application for the i.mx Devices on the Linux Platform

AT88CK490 Evaluation Kit

Bootloader with AES Encryption

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

AVR1922: Xplain Board Controller Firmware. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

MQX Lite Real-Time Operating System User Guide

PL-2303 (Chip Rev H, HX, X) USB to Serial Adapter Windows Driver Installer Manual

CB-OLP425 DEVELOPMENT KIT GETTING STARTED

SMARTCARD XPRO. Preface. SMART ARM-based Microcontrollers USER GUIDE

Software Prerequisites Linux Ubuntu LTS. Estimated completion time: 15min. The goal of this hands-on is to:

December 2002, ver. 1.0 Application Note 285. This document describes the Excalibur web server demonstration design and includes the following topics:

GSM Interfacing Board

M CORE 14-PIN ENHANCED BACKGROUND DEBUG INTERFACE (14EBDI) USER S MANUAL

CodeWarrior Development Studio Floating Licensing Quick Start

Hardware Configurations for the i.mx Family USB Modules

Floating License Installation Guide for Windows

Keep it Simple Timing

DSO138 oscilloscope program upgrade method

Transcription:

TWR-KV31F120M Sample Code Guide for IAR Board configuration, software, and development tools Rev.0 Freescale TWR-KV31F120M Sample Code Guide for IAR KL25_LAB

Contents 1 Purpose... 3 2 Getting to know the board... 3 3 OpenSDA Overview... 4 3.1 MSD-DEBUG Application... 4 4 Download and Install Software and Tools... 5 4.1 Downloading and Installing OpenSDA Drivers... 5 4.2 Downloading and Installing IAR 7.10... 5 5 Freescale Sample Code... 6 5.1 Baremetal Sample Code (TWR-KV31F120M_SC)... 6 5.1.1 Baremetal Sample Code Folder Structure... 6 5.1.2 Using the Freescale Baremetal Sample Code to Jumpstart your Design... 8 6 Configure Hardware... 8 7 Terminal Program Configuration... 8 8 Loading and Running the Demos into IAR 7.10... 8 9 Flashing the Pre-compiled Binary onto your Board... 10 TWR-KV31F120M Sample Code Guide for IAR Page 2 of 10

1 Purpose This Sample Code Guide will familiarize you with TWR-KV31F120M board and development tools. You will learn the features of the TWR-KV31F120M board, the features of the OpenSDA standard, and how to access the source code examples using IAR 7.10 or newer. In addition, instructions are provided to download a precompiled binary file to your board. 2 Getting to know the board The tower board (TWR-KV31F120M) features the Kinetis MKV31F512VLL12 microcontroller and comes with the following features (which are highlighted in the figure below): 100-LQFP MKV31F512 MCU (120 MHz ARM Cortex-M4F CPU, 512KB Flash, 96KB RAM) On-board debug circuit: K20DX128VFM5 (OpenSDA) with virtual serial port Header for standard ARM Cortex JTAG connector used to debug code on KV31F512 with external debug interface Power indication LED 8 MHz crystal on board for the microcontroller FXOS8700CQ Accelerometer/Magnetometer connected to I2C channel Four user-controllable LEDs plus RGB LED Four user pushbutton switches for GPIO interrupts Reset push button for MKV31 General-purpose Tower Plug-in (TWRPI) socket Potentiometer Elevator signal supporting TWR-MCLV3PH TWR-KV31F120M Sample Code Guide for IAR Page 3 of 10

3 OpenSDA Overview OpenSDA is an open-standard serial and debug adapter. It bridges serial and debug communications between a USB host and an embedded target processor. OpenSDA features a mass storage device bootloader that offers a quick and easy mechanism for loading applications such as flash programmers, run-control debug interfaces, serial-to-usb converters, and more, onto your Tower or Freedom board. Currently, P&E Micro offers two different functionalities combined in one application: MSD-DEBUG application. 3.1 MSD-DEBUG Application This OpenSDA application was developed by P&E Micro and allows the Tower or Freedom board to instantiate as a mass storage device on your computer. Once this application properly enumerates, you may program the KV31F512 on your Tower board with a binary or SREC file by simply dragging and dropping one of these files into TWR-KV31F120M drive that is installed when your Tower board enumerated. In addition this OpenSDA application allows you to program and debug your KV31F512 on your board just as any other debugger module would allow. With this application loaded onto your board, you will also have serial communication with the KV31F512 available. TWR-KV31F120M Sample Code Guide for IAR Page 4 of 10

4 Download and Install Software and Tools 4.1 Downloading and Installing OpenSDA Drivers Before you begin, you will need the latest OpenSDA serial drivers installed on your development computer and on your TWR-KV31F120M. The latest OpenSDA drivers should already be installed, and your computer system should be able to automatically find the latest Windows CDC drivers (as they should be pre-installed on the TWR-KV31F120M board). If they are not, please navigate to www.pemicro.com/opensda and follow the directions on this page to download the correct OpenSDA files. 4.2 Downloading and Installing IAR 7.10 To download the IAR 7.10 (or newest), follow these instructions: 1. Navigate to IAR s website at www.iar.com/freescale. 2. Next, select IAR Embedded Workbench for ARM under the Kinetis ARM Cortex-M4 Microcontrollers. You can also click http://www.iar.com/en/products/iar-embedded-workbench/arm/. 3. Click on the Download button. 4. Follow IAR s downloading and licensing instructions 5. To install software tools, follow the installer package instructions. TWR-KV31F120M Sample Code Guide for IAR Page 5 of 10

5 Freescale Sample Code The Freescale sample code provided for KV31F512 is a baremetal code with most key peripheral drivers. 5.1 Baremetal Sample Code (TWR-KV31F120M_SC) 5.1.1 Baremetal Sample Code Folder Structure The baremetal sample code folder contains three folders at the top level: a build folder, an src (source) folder and freemaster folder. Toolchain specific files are stored here. FreeMASTER project for FOC demo is stored here. The build folder is as below: C source and header files are stored here. TWR-KV31F120M pre-compiled binary applications. Target specific IAR linker files are located here. IAR projects files are stored in these folders. Only toolchain-specific files are stored here, NOT the source files. TWR-KV31F120M Sample Code Guide for IAR Page 6 of 10

The source folder structure is as follows: CPU startup files are located here (e.g., start.c, sysinit.c, vectors.c, etc.) Source files common to the project and drivers reside here (e.g. printf.c, io.c, stdlib.c, alloc.c, etc.). CPU header files are stored here. Peripheral module driver files are located here. Freemaster driver is located here. Platform specific header files are stored here. These files determine startup information for the project (e.g., core frequency, terminal baud rate configuration, which UART to use, etc.). Specific Motor Control (MC) source files are stored here. Project source and header files are stored here. Main will be defined in one of these files for your project. Note that some projects may use project specific sysinit or driver files. These projects will store those files here. TWR-KV31F120M Sample Code Guide for IAR Page 7 of 10

5.1.2 Using the Freescale Baremetal Sample Code to Jumpstart your Design The KV31F512 sample code is provided as a jump start for your design, and is accompanied by code examples. We have provided a script that will copy our platinum ( hello_world ) project and rename it to your desired project name. This script is a single executable, make_new_project.exe that resides in the \build\iar folder. Simply double-click this file and a command prompt pop-up window will prompt you for a project name, copy the platinum project and rename all of the necessary files for your new project to work correctly. 6 Configure Hardware 1) Using a Micro-B to A USB cable, connect your TWR-KV31F120M board to your computer. Be sure to plug the Micro-B connection into the OpenSDA port of the TWR-KV31F120M board. 2) No special hardware configuration is necessary to run the demo applications in the code examples unless otherwise specified by the readme.txt file located in the project source folder. 7 Terminal Program Configuration The OpenSDA serial port is designed to enumerate just as any other USB to serial converter. Therefore, you will need to open a serial terminal utility (Tera Term, Hyperterm, etc.) and configure your terminal as follows: - 115200 baud - 8 data bits - 1 stop bit - no parity - no flow control 8 Loading and Running the Demos into IAR 7.10 The following instructions describe how to build and debug the platinum demo using IAR 7.10. This document is targeted for users who choose to use the OpenSDA programming and debugging capabilities and it is assumed that you have loaded the P&E Micro MSD-Debug application onto your TWR-KV31F120M Sample Code Guide for IAR Page 8 of 10

TWR-KV31F120M. If you need assistance in loading this application onto your tower board, refer to the OpenSDA user s guide provided in your Quick Start Package. 1) Open IAR Embedded Workbench for ARM 7.10 (Start->All Programs->IAR Systems->IAR Embedded Workbench for ARM 7.10->IAR Embedded Workbench). 2) Open the workspace at \build\iar\hello_world\hello_world.eww. You can either double click the *.eww icon into the IAR Workspace or by selecting File->Open->Workspace, and point IAR to the workspace path through the dialog box that pops up. 3) Compile the project by clicking the Make icon (or right click on the project and select Make ). 4) After compilation completes, please ensure that you have the OpenSDA debugger selected. You may check this by following these instructions: a. Right click on the hello_world project in the Workspace window pane and select Options. b. In the pop-up dialog box, select Debugger from the Category section on the left hand side of the box. c. In the Setup tab, select PE micro for the Driver. d. Now select PE micro from the Category list on the left hand side of the box. e. In the Setup tab, select OpenSDA as the P&E Hardware interface type. 5) After compilation completes, download the code to the board and start the debugger by pressing the Download and Debug button 6) The code will download, and the debugger screen will come up and pause at the first instruction. Hit the Go button to start running. 7) On the terminal you should see the following message: 8) Enter any character which will be echoed to the terminal. TWR-KV31F120M Sample Code Guide for IAR Page 9 of 10

9 Flashing the Pre-compiled Binary onto your Board Your TWR-KV31F120M board should come with the OpenSDA MSD-Debug application preprogrammed onto the K20 device. If this is the case, you should see the board enumerated as a USB mass storage device and the following icon should be present in your My Computer window as shown. If the TWR-KV31F120M icon is not available, please refer to the OpenSDA User s Guide to program the MSD-Debug application onto your board. Otherwise, follow these steps to load a pre-compiled binary onto your KV31F512: 1. Navigate to the TWR-KV31F120M drive in your file system (or you may double click the TWR-KV31F120M icon in the screen displayed above). 2. You should see the following files: If you do not, reprogram your board with the MSD-Debug application. Otherwise, open a second explorer window and navigate to the location where your pre-compiled binary application is stored ( \build\binaries). 3. Simply drag and drop the one of.srec file into the TWR-KV31F120M drive and the KV31F512 will be automatically programmed with the pre-compiled binary. TWR-KV31F120M Sample Code Guide for IAR Page 10 of 10

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, and Kinetis are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. Tower is a trademark of Freescale Semiconductor, Inc. 2014 Freescale Semiconductor, Inc. Doc Number: TWRKV31F120MIARUG Rev. 0 03/2014