MPC5647L: Programming the Flash Shadow Row using P&E

Freescale Semiconductor Application Note Document Number: AN4149 Rev. 1, 08/2010 MPC5647L: Programming the Flash Shadow Row using P&E by: David McM...
69 downloads 0 Views 84KB Size
Freescale Semiconductor Application Note

Document Number: AN4149 Rev. 1, 08/2010

MPC5647L: Programming the Flash Shadow Row using P&E by:

David McMenamin Microcontroller Solutions Group Glasgow UK

1 Introduction This application note is a brief guide on how to program the contents of the shadow flash on the MPC5647L for switching between Dual parallel and Lock step modes. The following P&E software is required for this: • CW_ICDPPCNEXUS.EXE v1.23.3.2 or newer • cw_progppcnexus.exe v1.30.1.1 or newer Additionally, a P&E USB multilink connected to user's computer and the MPC5674L hardware will be required. Programming the shadow flash The default contents of the shadow flash are dumped to a srecord using P&E. The srecord is hand modified for Dual parallel mode and the shadow flash is reprogrammed with this updated configuration. The following srecord configuration files are provided along with this application note in AN4149SW which can also be used, if the user does not wish/require to create their own contents for the shadow flash. LS_shadow_default.S19 – factory default setting for the shadow row. Uses default passwords and Lock Step Mode. DPM_shadow.S19 – Configures the device for Dual parallel mode. Uses default passwords.

© 2010 Freescale Semiconductor, Inc.

Contents 1 Introduction...........................................................1 2 Dual Parallel / Lock Step Mode Selection............2 3 Open and Configure the Programming tool .........2 4 Creating a srecord dump of the shadow flash.......3 5 Modifying the srecord...........................................3 6 Programming the Shadow Flash...........................4 7 Testing the Configuration......................................4

Dual Parallel / Lock Step Mode Selection

2 Dual Parallel / Lock Step Mode Selection The MCU boots in Dual parallel mode or Lock step mode dependent on the value of the LSM_DPMB bit. This bit is one of the user option bits located in the shadow flash Bus Interface Unit 4 register (BIU4). Table 1shows content of the BIU4 register.

Table 1. User option bits in the Shadow flash BIU4 register Bit Function number name

Description

31-20

FCCU configuration

FCCU_CFG

Bits 0-5: FCCU_CFG.FOP Bits 6-8: FCCU_CFG.FOM Bit 9: FCCU_CFG.PS Bit 10: FCCU_CFG.SM Bit 11: FCCU_CFG.CM 19-12 11-10

9

Reserved SELFTEST_CFG

00 Reserved

LSM_DPMB

0 Selects DPM

01 Reserved 10 Reserved 11 Self-test configuration via SSCM (default value)

1 Selects LSM (default value) 8-1 0

Reserved WATCHDOG_ENABLE

0 Disable SWT

1 Enable SWT

The BIU4 register is located at address 0x00F03E10.

3 Open and Configure the Programming tool 1. Run the flash programming utility: cw_progppcnexus.exe. To avoid locking out the MCU, programming the shadow flash from within the debugger will not be possible. 2. Once the tool opens Connection Manager window is displayed.

MPC5647L: Programming the Flash Shadow Row using P&E, Rev. 1, 08/2010 2

Freescale Semiconductor, Inc.

Creating a srecord dump of the shadow flash

Figure 1. Connection Manager 3. Ensure the MCU is powered and the Multilink connected. 4. Press the Connect (Reset) button to connect to the MPC5674L. 5. Now specify the programming Algorithm to use. P&E provides a special Algorithm for programming the shadow flash of the MCU. In this case select the following file: Freescale_MPC5643L_1x32x4k_Shadow_Blk_Freescale_C90FL2_Driver_031.PCP. This is located in: pemicro\pkgppcnexus_starter\Algorithms\shadow if the default installation path was used.The user can change the file using the

button in the console.

The tool is now configured to work with the MPC5643L Shadow Flash.

4 Creating a srecord dump of the shadow flash Once the tool has been configured for the MPC5643L shadow flash the existing contents of the shadow flash (which will be the factory default if the shadow row has never been programmed)can be dumped to a srecord file. Press the upload module button on the console

to do this. The user is prompted to provide a location and name for the file.

5 Modifying the srecord The default srecord can be opened and edited in a text editor. For this example, the default has been taken and the following lines changed to update from Lock step mode to Dual parallel mode.

MPC5647L: Programming the Flash Shadow Row using P&E, Rev. 1, 08/2010 Freescale Semiconductor, Inc.

3

Programming the Shadow Flash

Original Line: S214FFFE10FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEE Updated Line: S214FFFE10FFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2 Note that the last Byte is a checksum and must be manually modified. To calculate this, take the sum of the values of all bytes from the byte count up to the last data byte, inclusive, modulo 256. Subtract this result from 255. Ensure that the censorship control word is present in the updated srecord. Save the modified srec and give it an appropriate name.

6 Programming the Shadow Flash Erase the shadow row by clicking on the Erase Module Button

.

NOTE After the shadow flash is erased do not Reset or Power cycle the MCU or the flash will be inaccessible. Now the updated srec can be programmed. Specify the file by clicking on the Specify Object File Button updated srecord. Now download the srecord into the shadow flash by clicking on the Program Module button Verify Module Button to check the programming operation

and selecting the . Use the

.

7 Testing the Configuration Power cycle the module to restart it in the new configuration. Start the P&E debugger CW_ICDPPCNEXUS.EXE and connect to the MCU as before. The programmer and debugger use the same connection utility. The status window, shown below, will confirm what mode the processor is operating in. Check the status window so that, it matches with the specified shadow flash configuration.

Figure 2. Configuration status window

MPC5647L: Programming the Flash Shadow Row using P&E, Rev. 1, 08/2010 4

Freescale Semiconductor, Inc.

How to Reach Us: Home Page: www.freescale.com

Web Support: http://www.freescale.com/support

USA/Europe or Locations Not Listed: Freescale Semiconductor Technical Information Center, EL516 2100 East Elliot Road Tempe, Arizona 85284 +1-800-521-6274 or +1-480-768-2130 www.freescale.com/support

Europe, Middle East, and Africa: Freescale Halbleiter Deutschland GmbH Technical Information Center Schatzbogen 7 81829 Muenchen, Germany +44 1296 380 456 (English) +46 8 52200080 (English) +49 89 92103 559 (German) +33 1 69 35 48 48 (French) www.freescale.com/support

Japan: Freescale Semiconductor Japan Ltd. Headquarters ARCO Tower 15F 1-8-1, Shimo-Meguro, Meguro-ku, Tokyo 153-0064 Japan 0120 191014 or +81 3 5437 9125 [email protected]

Asia/Pacific: Freescale Semiconductor China Ltd. Exchange Building 23F No. 118 Jianguo Road Chaoyang District Beijing 100022 China +86 10 5879 8000 [email protected]

For Literature Requests Only: Freescale Semiconductor Literature Distribution Center 1-800-441-2447 or +1-303-675-2140 Fax: +1-303-675-2150 [email protected]

Document Number: AN4149 Rev. 1, 08/2010

Information in this document is provided solely to enable system and sofware implementers to use Freescale Semiconductors products. There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits or integrated circuits based on the information in this document. Freescale Semiconductor reserves the right to make changes without further notice to any products herein. Freescale Semiconductor makes no warranty, representation, or guarantee regarding the suitability of its products for any particular purpose, nor does Freescale Semiconductor assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any liability, including without limitation consequential or incidental damages. "Typical" parameters that may be provided in Freescale Semiconductor 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 Semiconductor does not convey any license under its patent rights nor the rights of others. Freescale Semiconductor prodcuts are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which failure of the Freescale Semiconductor product could create a situation where personal injury or death may occur. Should Buyer purchase or use Freescale Semiconductor products for any such unintended or unauthorized application, Buyer shall indemnify Freescale Semiconductor and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claims alleges that Freescale Semiconductor was negligent regarding the design or manufacture of the part. RoHS-compliant and/or Pb-free versions of Freescale products have the functionality and electrical characteristics as their non-RoHS-complaint and/or non-Pb-free counterparts. For further information, see http://www.freescale.com or contact your Freescale sales representative. For information on Freescale's Environmental http://www.freescale.com/epp.

Products program, go to

Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © 2010 Freescale Semiconductor, Inc.