Getting Started with the MCU Flashloader

Similar documents
Kinetis Flash Tool User's Guide

NXP Semiconductors MCU Bootloader Demo Applications User's Guide

MCU Bootloader Release Notes

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

Kinetis Updater User's Guide

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

Kinetis Flash Tool User's Guide

i.mx 7 Dual/Solo Product Lifetime Usage

How to Enable Boot from HyperFlash and SD Card

Kinetis Bootloader v1.2.0 Release Notes

How to Enable Boot from QSPI Flash

Kinetis Bootloader Demo Application User's Guide

Kinetis USB-KW41Z Wireless Protocol Sniffer Quick Start Guide

i.mx 6ULL Product Usage Lifetime Estimates

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

i.mxrt1050 Product Lifetime Usage Estimates

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

i.mx 6UltraLite Product Usage Lifetime Estimates

MCUXpresso SDK USB Power Delivery

Kinetis Bootloader to Update Multiple Devices in a Field Bus Network

Getting Started with MCUXpresso SDK CMSIS Packs

Building U-Boot in CodeWarrior ARMv8

Kinetis SDK Freescale Freedom FRDM-KL03Z Platform User s Guide

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

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

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

HVP-KV10Z32 User s Guide

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

Smart Plug Software Design Reference Manual

Using FCCU on MPC5744P

Power Consumption and Measurement of i.mx RT1020

S12Z MagniV LIN Bootloader

FRDM-K64F Board Errata

PICO-i.MX6UL Development Platform for Android Things Quick Start Guide

Configuring DDR in U-Boot using QCVS

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

How to Implement USB Suspend/Resume Feature with MCUXpresso SDK USB Stack

Configure QSPI Bus Width and Frequency in Pre-Boot Loader Stage on QorIQ LS Series Processors

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

Kinetis KE1xF512 MCUs

Processor Expert Software for i.mx Processors Version 1.0

Boot Loader. Bootloader

Kinetis SDK v Release Notes for KV5x Derivatives

Kinetis Motor Suite v1.2.0 Release Notes

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

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

Freedom FRDM-KV31F Development Platform User s Guide

Emulating Dual SPI Using FlexIO

Freedom FRDM-MC-LVBLDC Development Platform User s Guide

Measuring Interrupt Latency

OpenSDA on TWR-KW2x. User s Guide Rev 1.1

HVP-KV31F120M User s Guide

Kinetis SDK v Release Notes for the MK21DA5 and MKW24D5 Devices

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

USB Bootloader GUI User s Guide

Getting Started with MQX RTOS for Kinetis SDK

Collect Linux Hardware Trace for ARMv8 User Space and Kernel Space Applications

TWR-LS1021A Getting Started

Freescale Kinetis Software Development Kit Release Notes

Getting Started with FreeRTOS BSP for i.mx 7Dual

Getting Started with Pins Tool User's Guide

QN9080 QN908x RF Certification Guide

Collecting Linux Trace without using CodeWarrior

S32K1xx Bootloader. 1. Introduction. 2. Architecture description. NXP Semiconductors. Application Notes Rev. 1, 10/2018. Contents

NXP Semiconductors. Document Number: MCUBLHOSTUG User's Guide Rev 4, 05/2018. blhost User's Guide

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

SPI topics: watchdog, serial output and parity check

Freescale MKW40Z IEEE Software Quick Start Guide

IMXPINSQSUG Quick Start Guide on Pins Tool for i.mx Processors

How to Reduce SoC Power when Running M4 with A53 on i.mx8m

Working around ERR7026 according to application needs

KW41Z IEEE and BLE Coexistence Performance

i.mx 6ULZ Migration Guide

Three-Phase Power Meter Hardware Design Reference Manual

WCT1011A/WCT1013A Automotive MP-A9 V4.0 Run-Time Debugging

Migrating Applications from MC9S12VR64 to MC9S12VR32 by: Manuel Rodríguez

Using VRC_CTL to Control an External VDD_LV Supply on the MPC5748G

TWR-LS1021A Getting Started

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

Quick Start Guide for FRDM-KL05Z

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

Emulating I2S bus on KE06

i.mxrt1060 Product Lifetime Usage Estimates

Developing a simple UVC device based on i.mx RT1050

Emulating I2C Bus Master by using FlexIO

Quick Start Guide for FRDM-KL46Z Rev 1

NOVPEK NetLeap User Guide

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

Exception and fault checking on S32K1xx

MIMXRT1020 EVK Board Hardware User s Guide

MAC57D5xx Start-Up Sequence

Model-Based Design Toolbox

AN5016. Trigonometry approximations. Document information

for ColdFire Architectures V7.2 Quick Start

Controller Continuum. for Microcontrollers V6.3. Quick Start

Using an External GCC Toolchain with CodeWarrior for Power Architecture

Production Flash Programming Best Practices for S32K1xx MCUs

HVP-MC56F82748 User s Guide

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

IMXPINSQSUG Pins Tool for i.mx Processors Installation User's Guide

Transcription:

NXP Semiconductors Document Number: MBOOTFLASHGS User's Guide Rev 3, 05/2018 Getting Started with the MCU Flashloader

Contents Contents Chapter 1 Introduction...3 Chapter 2 Overview...4 2.1 MCU flashloader...4 2.2 Host utilities... 4 Chapter 3 MCU flashloader application... 5 3.1 Connecting to the MCU platform... 5 3.2 The host utility application - blhost... 5 3.3 Flashing the user application...6 3.4 The KinetisFlashTool application... 7 Chapter 4 User application: vector table offset...8 Chapter 5 User application: Flash Configuration Area...9 Chapter 6 Revision History...10 2 NXP Semiconductors

Introduction Chapter 1 Introduction This document describes how to interface with the MCU flashloader to program a user application image into the on-chip flash. The MCU flashloader application is pre-programmed into the Kinetis flash during manufacturing and enables flash programming without a debugger. NXP Semiconductors 3

Overview MCU flashloader Chapter 2 Overview This document describes the steps required to program a user application image into MCU flash memory, utilizing the standardized MCU bootloader command interface. In the factory, the device boots from flash memory and loads the MCU flashloader into RAM. Running from RAM, the flashloader has access to the entire flash array for placement of the user application. After the user application is programmed into flash memory, the MCU flashloader is no longer available. 2.1 MCU flashloader The MCU bootloader is a standard bootloader for all Kinetis devices. It provides a standard interface to the device using any of the peripherals supported by the bootloader on a given NXP Kinetis device. The MCU flashloader is a specific implementation of the MCU bootloader. For the flashloader implementation, the MCU bootloader command interface is packaged as an executable that is loaded from flash and executed from RAM. This configuration allows the user application to be placed at the beginning of the on-chip flash where it is automatically launched upon boot from flash. Other MCU bootloader implementations include a ROM-based bootloader and a flash-resident bootloader. The MCU bootloader is available as source code for custom, flash-based implementations. Example applications are provided to demonstrate how to interface with the bootloader. Using the MCU flashloader to program a user application to the beginning of the Kinetis flash makes this implementation of the bootloader a one-time programming aid. Developers creating a manufacturing flow for their hardware and software implementations may find it necessary to restore the MCU flashloader such that the device works as it did from the NXP factory. To accomplish this, use an external debugger to program the flashloader_loader.bin file included in this package to the Kinetis on-chip flash. The exact method for doing this varies depending on hardware design and available tools. 2.2 Host utilities The blhost utility is a command-line host program used to interface with devices running the MCU bootloader. It can list and request execution of all of the commands supported by a given Kinetis device running the bootloader. The KinetisFlashTool is a GUI host application that can be used to program an application image. NOTE These applications are released as part of MCU bootloader release package available on mcuxpresso.nxp.com. They are available in the SDK bootloader folder: <sdk_package>/ middleware/mcu-boot/bin/tools. 4 NXP Semiconductors

MCU flashloader application Connecting to the MCU platform Chapter 3 MCU flashloader application The NXP Kinetis platform must be connected to a host computer to interface with the MCU flashloader application. After the platform is connected, use the blhost or KinetisFlashTool application to program a user application into the Kinetis flash memory. 3.1 Connecting to the MCU platform The MCU flashloader supports UART and USB connections to a computer. See the MCU Reference Manual for a specific device to determine the peripherals are supported by the flashloader application and the way the signals are routed to the pins of the MCU platform. After the MCU platform is powered up and there is a physical serial/usb connection between the Kinetis platform and host. The MCU device is ready to receive commands. For this example, a MCU device is connected to a serial-to-usb converter that enumerates on a Windows operating systems PC as a Serial Port on COMxx. Figure 1. UART connection to MCU platform Figure 2. Alternate UART connection to MCU platform 3.2 The host utility application - blhost This section describes how blhost host utility program is used to communicate with the MCU bootloader. Open a command prompt in the directory containing blhost. For Windows OS, it is <sdk_package>/middleware/mcuboot/bin/blhost/win. Type blhost --help to see the complete usage of the blhost utility. Verify if the Kinetis device is connected and is running the flashloader firmware application. It is assumed that the Kinetis platform is fresh out of reset. Check under the COM port in Device Manager that the Kinetis platform is connected. In this example, the device is connected to COMxx. Type blhost -p COMxx -- get-property 1 to get the flashloader version from the MCU flashloader. Below screen shot shows that blhost is successfully communicating with the Kinetis platform. NXP Semiconductors 5

MCU flashloader application Flashing the user application Figure 3. Host communication with MCU flashloader 3.3 Flashing the user application After communication has been established between the MCU flashloader and the host, it issue two commands to program the Kinetis flash memory with a user application. blhost -p COMxx -- flash-erase-all - Erases the entire flash array. blhost -p COMxx -- write-memory 0 myapp.bin Writes the myapp.bin binary image to address 0 of the Kinetis flash memory. [Optional] blhost -p COMxx -- reset Resets the Kinetis platform and launches the user application. Note the MCU flashloader is no longer running on the device, so further commands issued from the blhost utility fail. After issuing the reset command, allow 5 seconds for the user application to start running. Below screen shot shows the successful completion of the above commands. Figure 4. Programming a user application using the MCU flashloader 6 NXP Semiconductors

MCU flashloader application The KinetisFlashTool application 3.4 The KinetisFlashTool application The KinetisFlashTool application can also be used to program an application to the device. See the Kinetis Flash Tool User's Guide (document MBOOTFLTOOLUG) for more information. NXP Semiconductors 7

User application: vector table offset Chapter 4 User application: vector table offset Chapter 3, MCU flashloader application discusses how to program the Kinetis flash memory with the myapp.bin user application. When creating the user application, the vector table of the application must be located at the beginning address of the flash memory region. When booting from flash, the Kinetis device considers offset 0, the initial stack pointer and offset 4, the entry point for the application. 8 NXP Semiconductors

User application: Flash Configuration Area Chapter 5 User application: Flash Configuration Area The Flash Configuration Area (0x400-0x40F) must be populated with known values as per the specific Kinetis platform reference manual. In particular, values of the FSEC (0x40C) and FOPT (0x40D) locations may prevent future writes to the Kinetis flash. If user application code, other than the vector table, is linked to begin at offset 0x410, the default erased value (0xFF) of these locations makes the device secure. However, mass erase is enabled. NXP Semiconductors 9

Revision History Chapter 6 Revision History This table summarizes revisions to this document. Table 1. Revision history Revision number Date Substantive changes 0 12/2014 Initial release 1 07/2015 Kinetis Bootloader 1.2.0 updates 2 04/2016 Kinetis Bootloader 2.0 updates 3 05/2018 MCU Bootloader v2.5.0 release 10 NXP Semiconductors

How To Reach Us Home Page: nxp.com Web Support: nxp.com/support Information in this document is provided solely to enable system and software implementers to use NXP 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. NXP reserves the right to make changes without further notice to any products herein. NXP makes no warranty, representation, or guarantee regarding the suitability of its products for any particular purpose, nor does NXP 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 NXP 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. NXP does not convey any license under its patent rights nor the rights of others. NXP sells products pursuant to standard terms and conditions of sale, which can be found at the following address: nxp.com/ SalesTermsandConditions. NXP, the NXP logo, NXP SECURE CONNECTIONS FOR A SMARTER WORLD, All other product or service names are the property of their respective owners. ARM, AMBA, ARM Powered, are registered trademarks of ARM Limited (or its subsidiaries) in the EU and/or elsewhere. All rights reserved. C 2018 NXP B.V.