AN4465 Application note

Similar documents
SPC5-FLASHER. Flash management tool for SPC56xx family. Description. Features

Single LNB supply and control IC DiSEqC 1.X compliant with EXTM based on the LNBH29 in a QFN16 (4x4) Description

AN3332 Application note

AN3155 Application note

UM1676 User manual. Getting started with.net Micro Framework on the STM32F429 Discovery kit. Introduction

SPC5-CRYP-LIB. SPC5 Software Cryptography Library. Description. Features. SHA-512 Random engine based on DRBG-AES-128

UM1613 User manual. 16-pin smartcard interface ST8034P demonstration board. Introduction

M24LRxx/CR95HF application software installation guide

AN3354 Application note

EN: This Datasheet is presented by the m anufacturer. Please v isit our website for pricing and availability at ore.hu.

AN4108 Application note

STEVAL-IEG001V2. Smart real-time vehicle tracking system. Features

LM337. Three-terminal adjustable negative voltage regulators. Features. Description

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

Description. Table 1. Device summary. Order code Temperature range Package Packaging Marking

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

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

Description. Table 1. Device summary

AN3998 Application note

EVL185W-LEDTV. 185 W power supply with PFC and standby supply for LED TV based on the L6564, L6599A and Viper27L. Features.

DDSL01. Secondary protection for DSL lines. Features. Description

AN3265 Application note

AN2557 Application note

AN2824 Application note

UA741. General-purpose single operational amplifier. Features. Applications. Description. N DIP8 (plastic package)

Table 1. Absolute maximum ratings (T amb = 25 C) Symbol Parameter Value Unit. ISO C = 330 pf, R = 330 Ω : Contact discharge Air discharge

STTH1R04-Y. Automotive ultrafast recovery diode. Features. Description

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

ST19NP18-TPM-I2C. Trusted Platform Module (TPM) with I²C Interface. Features

Description. Table 1. Device summary. Order codes. TO-220 (single gauge) TO-220 (double gauge) D²PAK (tape and reel) TO-220FP

TN0023 Technical note

2STBN15D100. Low voltage NPN power Darlington transistor. Features. Application. Description

AN2604 Application note

AN2389 Application note

AN2680 Application note

TDA W CAR RADIO AUDIO AMPLIFIER

BD238. Low voltage PNP power transistor. Features. Applications. Description. Low saturation voltage PNP transistor

BD241A BD241C. NPN power transistors. Features. Applications. Description. NPN transistors. Audio, general purpose switching and amplifier transistors

Description SO-8. series. Furthermore, in the 8-pin configuration Very low-dropout voltage (0.2 V typ.)

AN3270 Application note

Getting started with DfuSe USB device firmware upgrade STMicroelectronics extension

ULN2801A, ULN2802A, ULN2803A, ULN2804A

How To Write To An Eeprom Memory On A Flash Memory On An Iphone Or Ipro Memory On Microsoft Flash Memory (Eeprom) On A Microsoft Microsoft Powerbook (Ai) 2.2.2

ST High voltage fast-switching NPN power transistor. Features. Applications. Description

AN4128 Application note

Description. IO and RF AGC. ASIC controller and power management. Carrier recovery loop. GPIO switch matrix. Lock indicator and monitoring DVBS2 FEC

Order code Temperature range Package Packaging

AN4156 Application note

BD135 - BD136 BD139 - BD140

ULN2001, ULN2002 ULN2003, ULN2004

AN3353 Application note

ESDLIN1524BJ. Transil, transient voltage surge suppressor diode for ESD protection. Features. Description SOD323

AN3110 Application note

ETP01-xx21. Protection for Ethernet lines. Features. Description. Applications. Benefits. Complies with the following standards

AN4368 Application note

DSL01-xxxSC5. Secondary protection for DSL lines. Features. Description. Applications. Benefits. Complies with the following standards

AN3990 Application note

TDA2004R W stereo amplifier for car radio. Features. Description

MC Low noise quad operational amplifier. Features. Description

BZW50. Transil, transient voltage surge suppressor (TVS) Features. Description

L78MxxAB L78MxxAC. Precision 500 ma regulators. Features. Description

MC34063AB, MC34063AC, MC34063EB, MC34063EC

STDP2600. Advanced HDMI to DisplayPort (dual mode) converter. Features. Applications

AN1819 APPLICATION NOTE Bad Block Management in Single Level Cell NAND Flash Memories

AN2760 Application note

AN3252 Application note

AN2866 Application note

AN3359 Application note

LM135-LM235-LM335. Precision temperature sensors. Features. Description

STTH2R06. High efficiency ultrafast diode. Features. Description

STTH110. High voltage ultrafast rectifier. Description. Features

L6234. Three phase motor driver. Features. Description

UM0462 User manual. STM32 and STM8 Flash loader demonstrator. Introduction

LM134-LM234-LM334. Three terminal adjustable current sources. Features. Description

STDP2690. Advanced DisplayPort to DisplayPort (dual mode) converter. Features. Applications

STN3NF06L. N-channel 60 V, 0.07 Ω, 4 A, SOT-223 STripFET II Power MOSFET. Features. Application. Description

Obsolete Product(s) - Obsolete Product(s)

STP60NF06. N-channel 60V Ω - 60A TO-220 STripFET II Power MOSFET. General features. Description. Internal schematic diagram.

STP60NF06FP. N-channel 60V Ω - 30A TO-220FP STripFET II Power MOSFET. General features. Description. Internal schematic diagram.

P6KE. Transil, transient voltage surge suppressor (TVS) Features. Description. Complies with the following standards

AN2703 Application note

Figure 1. STM32F429 Discovery board: STM32F429I-DISCO

AN886 APPLICATION NOTE

AN974 APPLICATION NOTE

AN3969 Application note

STDP4328. DisplayPort 1.2a concentrator. Features. Applications

AN1754 APPLICATION NOTE

AN2146 APPLICATION NOTE

STP55NF06L STB55NF06L - STB55NF06L-1

VN5R003H-E. 3 mω reverse battery protection switch. Features. Description. Application

STGB10NB37LZ STGP10NB37LZ

AN820 APPLICATION NOTE INPUT/OUTPUT PROTECTION FOR AUTOMOTIVE COMPUTER

STCS A max constant current LED driver. Features. Applications. Description

AN4427 Application note

AN3327 Application note

STDP4320. DisplayPort 1.2a splitter. Features. Applications

TDA CHANNEL VOLUME CONTROLLER 1 FEATURES 2 DESCRIPTION. Figure 1. Package

UM1075 User manual. ST-LINK/V2 in-circuit debugger/programmer for STM8 and STM32. Introduction

Description. Table 1. Device summary. Order code Temperature range Package Packing Marking

AN3211 Application note

Transcription:

Application note Serial Programming: BAM vs. BAF differences Introduction This document describes the differences between the Boot Assist Module (BAM) presents on SPC56 family and the Boot Assist Flash (BAF) presents on SPC57 family. The purpose of this document is to highlight the differences between the two modules (BAM and BAF). April 2014 DocID026150 Rev 1 1/10 www.st.com

Contents AN4465 Contents 1 Boot Assist Module (BAM).................................... 3 1.1 Boot modes................................................ 3 1.2 BAM overview.............................................. 3 1.3 Censorship................................................. 3 1.4 BAM Download protocol....................................... 4 2 Boot Assist Flash (BAF)...................................... 5 2.1 Boot modes................................................ 5 2.2 BAF Overview.............................................. 5 2.3 BAF Download Protocol....................................... 5 3 Differences between BAM and BAF............................ 7 3.1 Activation mode............................................. 7 3.2 Serial boot protocol.......................................... 7 3.3 Code mode................................................. 7 3.4 Password managing.......................................... 7 3.5 Baud rate detection.......................................... 7 3.6 RAM reservation............................................. 7 3.7 Serial interface baud rate calculation............................. 8 Revision history..................................................... 9 2/10 DocID026150 Rev 1

Boot Assist Module (BAM) 1 Boot Assist Module (BAM) 1.1 Boot modes The SPC56 family supports the following boot modes: Boot from internal flash. The device boots from the first bootable section of the Flash main array. Serial Boot. The device downloads boot code from either SCI or CAN interface and then execute it. If booting is not possible with the selected configuration (e.g. if no valid Boot ID is found in any of the possible boot locations) then the device enters the static mode. The device enters power safe mode and waits for an external reset. 1.2 BAM overview The Boot Assist Module is a block of read-only memory containing VLE code which is executed according to the boot mode of the device. The BAM downloads code into internal SRAM through the following serial protocols and executes it afterwards: CAN (with and without auto baud depending the target) UART (with and without auto baud depending the target) The BAM provides the following features: Programmable 64-bit password protection for serial boot mode Serial boot loads the application boot code from a CAN or UART bus into internal SRAM Censorship protection for internal flash module The BAM code resides in 8 kilobytes of ROM mapped from address 0xFFFF_C000. The RAM location where to download the code can be any 4 byte-aligned location in the SRAM starting from the address 0x4000_0100. The SPC56 detects the boot mode based on external pins and device status. The following sequence applies: 1. to boot either from CAN or UART, the device must be forced into an Alternate Boot Loader Mode via the FAB (Force Alternate Boot Mode) pin which must be asserted before initiating the reset sequence. The type of alternate boot mode is selected according to the ABS (Alternate Boot Selector) pins. 2. if FAB is not asserted, the device boots from the first flash-memory sector which contains a valid boot signature. 3. if no flash memory sector contains a valid boot signature, the device goes into static mode 1.3 Censorship The internal Flash memory can be enabled or disabled it depends on the values stored in the censorship word and serial boot control word in the shadow row of the internal Flash memory, the Nexus port can be enabled or disabled, the password received in the serial DocID026150 Rev 1 3/10 9

Boot Assist Module (BAM) AN4465 boot mode is compared with the fixed public password or compared to a user programmable password in the internal Flash memory. The censorship word is a 32-bit word of data stored in the shadow row of internal Flash memory. This memory location is read and interpreted by hardware as part of the boot process and is used in conjunction with the BAM configuration pin to enable/disable the internal Flash memory and the Nexus interface. The address of the Censorship word is 0x00FF_FDE0. The censorship word consists of two fields: censorship control and serial boot control. The censorship word is programmed during manufacturing to be 0x55AA_55AA. This results in a device that is not censored and uses a Flash-based password for serial boot mode. The BAM program uses the state of the SIU_CCR DISNEX bit to determine whether the serial password received in serial boot mode, should be compared to a public password (fixed value of the 0xFEED_FACE_CAFE_BEEF) or needs to be compared to a Flash password - 64-bit data, stored in the shadow row of internal Flash at address 0x00FF_FDD8. If the bit is set, the BAM uses the Flash serial password, if the bit is cleared, it uses the public password. A valid serial password must be always programmed, regardless the boot mode used. This provides capability to rescue the part using the serial boot mode, if the Flash content becomes corrupted for whatever reason. 1.4 BAM Download protocol From high level perspective, the download protocol follows steps: 1. Send message and receive acknowledge message for auto baud or auto bit rate selection (optional step depending the target and the ABS pins configuration). 2. Send 64 bits password. 3. Send start address, size of downloaded code in bytes and VLE bit. 4. Download data. 5. Execute code from start address. Each step must be complete before the next step starts. These steps are correct if auto baud is disabled. Otherwise, to measure the baud rate some data from host to MCU are sent before the step 1. The communication is done in half duplex manner and any transmission from host is followed by the MCU transmission: Host sends data to MCU and starts waiting MCU echoes to host the data received Host verifies if echoes are correct: If data is correct, the host can continue to send data; If data is not correct, the host stops to transmit and MCU need to be reset. All multi-byte data structures are sent with MSB first. 4/10 DocID026150 Rev 1

Boot Assist Flash (BAF) 2 Boot Assist Flash (BAF) 2.1 Boot modes Depending on the state and the content of its flash memory the device can enter one of three different boot modes: Boot from internal flash. If the internal flash contains application code with a valid boot header, the application is booted. The boot header contains flags that enable/disable individual cores and their reset vectors Serial boot. If no valid boot header is found and the current lifecycle phase of the device is less than In Field, an attempt is made to download the application by a serial protocol using the UART. The downloaded code is then executed by the initial boot core. Static mode. The device enters power safe mode and waits for an external reset. 2.2 BAF Overview The MCU is booted through a collaboration of several blocks, hardware, and firmware. The first boot phases are performed by a state machine inside the System Status and Configuration Module (SSCM). Finally, the SSCM sends a reset vector to the boot core (the I/O Processor (IOP) on this device) pointing into the Boot Assist Flash (BAF). The BAF code then checks the life cycle of the device. If it is Failure Analysis, BAF enters a loop in which it will service the watch dog. BAF will not execute further since the read access to flash boot sectors for cores may be disabled if device life cycle is Failure Analysis. Otherwise it searches for a boot header and boots the application code in internal flash. If no boot header is found in internal flash, it downloads application code serially using the UART module. The package pins used by UART are the same pins that can be used by CAN module. So the external PHY can be either UART or CAN. The BAF is located in a 16 KB block of flash that is mapped adjacent to the UTEST flash memory block. The BAF block base address is 0040_4000h. It is one time programmable (OTP) and is programmed during factory test. 2.3 BAF Download Protocol From high level perspective, the download protocol follows steps: 1. Host transmits 64 bit password to MCU. 2. Host transmits start address, size of downloaded code in bytes and VLE bit13 to MCU. 3. Host transmits a sequence of data bytes that are to be executed. 4. CPU2 executes code from start address provided in step 2. Each step must be complete before the next step starts. DocID026150 Rev 1 5/10 9

Boot Assist Flash (BAF) AN4465 The communication is done in half duplex manner and any transmission from host is followed by the MCU transmission: 1. Host sends data to MCU and start waiting. 2. The MCU echoes to host the data received. 3. The host verifies if the echo is correct: If data is correct, the host can send the next byte of data If data is not correct, it is assumed the MCU has not correctly received the data and the only practical option is for the Host to reset the MCU and start again. All multi-byte data structures are sent with MSB first. 6/10 DocID026150 Rev 1

Differences between BAM and BAF 3 Differences between BAM and BAF 3.1 Activation mode The sequences to start the serial boot are different: while the BAM mode is enabled by hardware configuration using FAB pin and ABS pins, the BAF mode is automatically enabled only if no valid boot header is found and the lifecycle phase of the device is less than In Field. This means that, to use BAM, the user needs to have the configuration pins accessible. In this case the flash can be managed without limitation. Instead, the BAF module allows managing the flash only in specific condition but without external hardware configuration. 3.2 Serial boot protocol From high level perspective, the serial boot protocols are similar except the behavior of the device when the user sends a wrong password or not sends the password: BAM: If the password check fails, the device stops responding. To get the device out of that state, the RESET signal must be asserted. BAF: If an incorrect password is supplied, BAF puts the device into static mode (low power safe mode). If 64 bits of password data is not received after approximately 30s, BAF causes a destructive reset of the MCU. 3.3 Code mode Another difference between BAM and BAF regarding the code mode available: SPC57 family executes only VLE code. So, the bit present into the BAF protocol is used only for a backward compatibility. 3.4 Password managing BAF has a public fixed password (fixed value: 0xFEEDFACECAFEBEEF) not modifiable while BAM can use a public password (fixed value: 0xFEEDFACECAFEBEEF) or can use a 64 bit Flash password, stored in the shadow row of internal Flash. 3.5 Baud rate detection SPC57 family does not support baud rate detection option, instead the BAM has the option to use the baud rate detection. 3.6 RAM reservation SPC57 family does not need RAM reservation for executing BAF. The BAM protocol, on the contrary, requires the reservation of a part of RAM (from 0x4000_0000 to 0x4000_0100). This RAM cannot be overwritten during the download phase. DocID026150 Rev 1 7/10 9

Differences between BAM and BAF AN4465 3.7 Serial interface baud rate calculation UART and CAN baud rate depending by external clock but with different formulas. BAM module formulas: UART baud rate = f sys / 833.33 CAN baud rate = f sys / 40 BAF module formulas: UART baud rate = f sys / 80 CAN baud rate = f sys / 40 8/10 DocID026150 Rev 1

Revision history 4 Revision history Table 1. Document revision history Date Revision Changes 09-Apr-2014 1 Initial release. DocID026150 Rev 1 9/10 9

Please Read Carefully: Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries ( ST ) reserve the right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any time, without notice. All ST products are sold pursuant to ST s terms and conditions of sale. Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein, and ST assumes no liability whatsoever relating to the choice, selection or use of the ST products and services described herein. No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such third party products or services or any intellectual property contained therein. UNLESS OTHERWISE SET FORTH IN ST S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. ST PRODUCTS ARE NOT DESIGNED OR AUTHORIZED FOR USE IN: (A) SAFETY CRITICAL APPLICATIONS SUCH AS LIFE SUPPORTING, ACTIVE IMPLANTED DEVICES OR SYSTEMS WITH PRODUCT FUNCTIONAL SAFETY REQUIREMENTS; (B) AERONAUTIC APPLICATIONS; (C) AUTOMOTIVE APPLICATIONS OR ENVIRONMENTS, AND/OR (D) AEROSPACE APPLICATIONS OR ENVIRONMENTS. WHERE ST PRODUCTS ARE NOT DESIGNED FOR SUCH USE, THE PURCHASER SHALL USE PRODUCTS AT PURCHASER S SOLE RISK, EVEN IF ST HAS BEEN INFORMED IN WRITING OF SUCH USAGE, UNLESS A PRODUCT IS EXPRESSLY DESIGNATED BY ST AS BEING INTENDED FOR AUTOMOTIVE, AUTOMOTIVE SAFETY OR MEDICAL INDUSTRY DOMAINS ACCORDING TO ST PRODUCT DESIGN SPECIFICATIONS. PRODUCTS FORMALLY ESCC, QML OR JAN QUALIFIED ARE DEEMED SUITABLE FOR USE IN AEROSPACE BY THE CORRESPONDING GOVERNMENTAL AGENCY. Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately void any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, any liability of ST. ST and the ST logo are trademarks or registered trademarks of ST in various countries. Information in this document supersedes and replaces all information previously supplied. The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners. 2014 STMicroelectronics - All rights reserved STMicroelectronics group of companies Australia - Belgium - Brazil - Canada - China - Czech Republic - Finland - France - Germany - Hong Kong - India - Israel - Italy - Japan - Malaysia - Malta - Morocco - Philippines - Singapore - Spain - Sweden - Switzerland - United Kingdom - United States of America www.st.com 10/10 DocID026150 Rev 1