Home

Serial FLASH Programming User`s Guide

image

Contents

1. Result 2 id 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF 0000000000101030 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF 0000000000101040 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF 0000000000101050 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF 0000000000101060 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF 0000000000101070 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF Example 3 A serial Flash has 64KB per sector 0x10000 Write data 0x0 from 0x100000 to 0x12FFFF in the serial Flash FLASHFILE Set 0x100000 0xFFFF Long 0x0 FLASHFILE Set 0x110000 0xFFFF Long 0x0 FLASHFILE Set 0x120000 0xFFFF Long 0x0 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide 31 Scripts for SPI Controllers Other Useful Commands The CPU cannot read serial Flash memories directly But TRACE32 provides special commands for reading serial Flash memories The contents of the serial Flash are displayed in a window Reading the Serial Flash The following command allows to read the serial Flash memory FLASHFILE DUMP lt address gt lt format gt Display a hex dump of the serial Flash Example Display a hex dump of the serial Flash starting at 0x1000 Display the inform
2. eMMC FLASH Pin connection AT91SAM3U4 ST24C08 STMicroelectronics 8kbit 12C_SCL Port A25 12C_SDA Port A24 SYStem JtagClock 15 Mhz set JTAG clock BSDL RESet reset boundary scan configuration BSDL FILE sam3u4e_lqfp144 bsd load the required BSDL file BSDL HARDRESET F BSDL SOFTRESET toggle TRST_N pin do a sequential JTAG reset IF BSDL CHECK BYPASS check 1f BYPASS mode works IF BSDL CHECK IDCODE 7 if the IDCODE matches BSDL FLASH IFDefine RESet check reset the boundary scan flash S ClOalat a epulaeeiie Ton BSDL FLASH IFDefine I2C 1 define boundary scan flash interface protocol I2C I12C flash memory connected to IC1 of the boundary scan chain BSDL FLASH IFMap SCL PA25 map generic I2C pin SCL to port PA25 BSDL FLASH IFMap SDA PA24 map generic I2C pin SDA to port PA24 BSDL FLASH INIT SAFE Initialize boundary scan chain to safe values according to SAFE state Erom BSDL file Enable serial flash boundary scan FLASHFILE BSDLFLASHTYPE I2C08 define serial flash type FLASHFILE BSDLaccess ON 7 programming via FLASHFILE GETID get the I12c flash memory ID continue with serial flash programming e g FLASHFILE DUMP 0x0 FLASHFILE ERASE 0x0 0x3FF FLASHFILE LOAD 0x0 ENDDO 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide 39 FLASH Programming via Boundary Scan
3. End in order to find the correct value Description One Byte One Byte Address Dummy Data Instruction Instruction Code BIN Code HEX READ Read Data Bytes 0000 0011 0 fito RFSR Read Flag Status Register 0111 0000 0 o ite 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide 21 Scripts for SPI Controllers 3 Click Find The code box displays the lt serialflash_code gt of your serial Flash device If the code box displays unknown then proceed as described in If There is No Script 4 Make a note of the displayed lt serialflash_code gt 5 Click End to close the dialog 6 Identify the correct bin file based on the lt serialflash_code gt The following example illustrates how to do this Example for SPI Controllers page 23 For information about the file name convention for driver binary files see File Name Convention for Serial Flash Drivers on page 9 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide 22 Scripts for SPI Controllers Example for SPI Controllers Target ARM based STM32F10X CPU with the SPI controller stm Serial Flash device M25P64 Taken together the Code column and the Controller column make up the file name of the serial Flash driver binary file spi6 4_stm bin The number 64 indicates the size of one sector in KByte the sector erase size in KByte E Tool Chain ST Microelectronic
4. Sector size 64Kbytes 0x0 0xFFFF Driver file demo arm flash byte_thumb spi64_stm bin Note is expanded to the lt TRACE32_installation_directory gt which is c T32 by default Reset the FLASHFILE declaration within TRACE32 FLASHFILE RESet For the serial Flash CS connected PIO A 4 Group A port Number4 PIO group A register 0x4001080C lt SPI Tx reg gt lt SPI Rx reg gt lt CS GPIO reg gt lt CS bit gt FLASHFILE CONFIG 0x4001300C 0x4001300C 0x4001080C 0x4 f 1 Specify the serial Flash programming algorithm and where it runs on the target RAM FLASHFILE TARGET 0x20000000 0x1FFF 0x20002000 0x1FFF demo arm flash byte thumb spi64 stm bin 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide 24 Scripts for SPI Controllers Declaration Example for AT91SAM9XE ARM9 AT91SAM9XE ARM9 from ATMEL M25P64 64Mbit SPI Tx register SPI Rx register OxFFFC800C OxFFFC8008 Sector size 64Kbytes 0x0 OxFFFF Driver file demo arm flash byte spi64_at91sam9xe bin Note is expanded to the lt TRACE32_installation_directory gt which is c T32 by default Reset the FLASHFILE declaration within TRACE32 FLASHFILE RESet The AT91SAM9XE s CS is controlled by the SPI register OxFFFC8000 not the specified GPIO ports lt SPI Tx reg gt lt SPI Rx reg gt lt SPI ChipEnable reg gt FLASHFILE CONFIG OxFFFC800C OxFFFC8008 OxFFFC8000 Specify the seri
5. Serial Flash Drivers on page 9 tod 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide 20 Scripts for SPI Controllers Finding the lt serialflash_code gt of Your Serial Flash Device The following step by step procedure helps you find the lt serialflash_code gt of your serial Flash device Based on the lt serialflash_code gt you can then identify the correct bin file To find the lt serialflash_code gt 1 Run the following PRACTICE script file cmm from the TRACE32 demo folder CD DO demo etc flash find_spidef cmm The path prefix expands to the system directory of TRACE32 plow default Cs Wiese If this demo script is missing you can download it from www lauterbach com scripts html The Find SPI flash code dialog opens 2 Under spi flash parameters make your settings You can find the required information in the serial Flash documentation of the manufacturer For an example of where to search for the information see figure and table below J Find SPI flash code 8 Eo spi flash parameters Address Cycle 4 x Byte E by cmd D8h 64 KB F n Era i In the serial Flash documentation of Support Page Program cmd 02h ON OFF the manufacturer search for terms Support Read Flag Status cmd 70h ON OFF ex Numonyx like Support Read Bank Register cmd 16h ON OFF ex Spansion erase capability code sector spraBears granularity
6. have proprietary SPI interface controllers short SPI controllers and thus require special driver binary files for programming serial Flash memories These driver binary files are programs executed by a core in the target and interact with the master SPI controller for controlling the SPI slave controller in order to program the serial Flash memory Once the required driver binary file was loaded to the target the TRACE32 s command group FLASHFILE can be used to program and erase the serial Flash memory Lauterbach provides driver binary files for a large number of SPI controllers See further down for instructions how to identify the correct driver for your application About Blocks and Pages The Flash memory of a serial Flash device consists of sectors and each sector is subdivided into pages see example diagram below Page 1 Sector 0 Flash Memory ii Page n Sector n Sector A sector is the minimum size unit for erasing A sector can have a size of 32 64 or 256 KBytes The sector sizes are part of the file names of the algorithms required for serial Flash programming spi32 bin spi64 bin spi256 bin For more information see File Name Convention for Serial Flash Drivers on page 9 Page A page is the minimum size unit for writing and has a size of 256 bytes 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide Backgr
7. 00000 ComPare 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide 29 Scripts for SPI Controllers Example 3 Copy the 1MB serial Flash data at 0x0 to the serial Flash at 0x800000 FLASHFILE COPY 0x0 OxFFFFF 0x800000 1 Verify the 1MB serial Flash data between 0x0 and 0x800000 FLASHFILE COPY 0x0 OxFFFFF 0x800000 ComPare 1989 2015 Lauterbach GmbH 30 Scripts for SPI Controllers Serial FLASH Programming User s Guide Modifying the Serial Flash Memory The following command is available to modify the contents of the serial Flash memory The maximum range that one FLASHFILE Set command can modify is only one sector of the Flash memory If you want to modify three sectors you need three FLASHFILE Set commands etc FLASHFILE Set lt address gt lt range gt lt format gt lt data gt Modify the contents of the serial Flash Example 1 Write 4 bytes of data 0x12345678 to the address 0x100000 LE little endian FLASHFILE Set 0x100000 LE Long 0x12345678 Example 2 Write data 0x0 to the address range 0x100000 0xFFF FLASHFILE Set 0x100000 0xFFF Byte 0x0 Result 1 2 B FLASHFILE DUMP 0x100000 Long Tracki C_0123456789ABCDEF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF 0000000000100030 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF 0000000000100040 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF 0000000000100050 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF
8. ASH Programming via Boundary Scan SYStem JtagClock 15 Mhz set JTAG clock BSDL RESet reset boundary scan configuration BSDL FILE sam3u4e_lqfp144 bsd load the required BSDL file BSDL HARDRESET toggle TRST_N pin BSDL SOFTRESET do a sequential JTAG reset IF BSDL CHECK BYPASS check if BYPASS mode works IF BSDL CHECK IDCODE check if the IDCODE matches BSDL FLASH IFDefine RESet reset the boundary scan flash Commutation BSDL FLASH IFDefine SPI 1 define boundary scan flash interface protocol SPI SPI flash memory connected to IC1 3 of the boundary scan chain BSDL FLASH IFMap CE PA16 map generic SPI pin CE to port PA16 BSDL FLASH IFMap SCK PA15 map generic SPI pin SCK to port PA15 BSDL FLASH IFMap SI PA14 map generic SPI pin SI to port PATA BSDL FLASH IFMap SO PA13 map generic SPI pin SO to port PA13 BSDL FLASH INIT SAFE Initialize boundary scan chain to safe values according to SAFE state S tevetelin ISIDIL teal ILS FLASHFILE BSDLaccess ON Enable serial flash programming via boundary scan FLASHFILE BSDLFLASHTYPE SPI64 define serial flash type FLASHFILE GETID get the SPI flash memory ID continue with serial flash programming e g FLASHFILE DUMP 0x0 FLASHFILE ERASE 0x0 OxFFFFF FLASHFILE LOAD 0x0 ENDDO 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide 38 FLASH Programming via Boundary Scan Example 2 for the I2C Protocol CPU
9. CE32 about the Serial Flash Register Addresses SPI page 17 Informing TRACE32 about the Serial Flash Programming Algorithm page 18 Checking the Identification from the Serial Flash Device page 26 Erasing the Serial Flash Device page 27 Programming the Serial Flash Device page 28 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide 13 Scripts for SPI Controllers The following framework can be used as base for serial Flash programming Establish the communication between the target CPU and the TRACE32 debugger ACON igure thers EPIRCONE CO Ner FLASHFILE RESet Reset the serial Flash environment in TRACE32 to its default values FLASHFILE CONFIG Inform TRACE32 about the serial Flash register R addresses and the CS address of the serial Flash FLASHFILE TARGET Specify the serial Flash programming algorithm and where it runs in target RAM FLASHFILE Erase Erase the serial Flash FLASHFILE LOAD lt main_file gt Program the file to serial Flash An ellipsis in the framework indicates that command parameters have been omitted here for space economy NOTE The parametrization of FLASHFILE CONFIG and FLASHFILE TARGET requires expert knowledge 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide Scripts for SPI Controllers Establishing Communication between Debugger and Target CPU Serial F
10. D 0x40021014 Long 0x114 2 amalla elie Clock tor tas PER Set SD 0x40021018 Long 0x100C 9 SPL 6 IRO PER S SD 0x40010800 Long 0xbbb34444 Switch the PIO A group to PER S SD 0x40010810 Long OxFFFFFFF the SPI function PER S SD 0x40013000 WORD 0x34F Configure the SPI PER S SD 0x40013010 WORD 0x7 amp CGomeEer llileie 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide 16 Scripts for SPI Controllers Resetting Default Values The following command is used to reset the serial Flash environment in TRACE32 to its default values FLASHFILE RESet Reset the serial Flash environment in TRACE32 to its default values Informing TRACE32 about the Serial Flash Register Addresses SPI The following command is used to inform TRACE32 about the various register addresses Flash declaration Chip selection is controlled by one GPIO pin FLASHFILE CONFIG lt SPI Tx reg gt lt SPI Rx reg gt lt CS GPIO reg gt lt CS bit gt Chip selection is controlled by the SPI controller FLASHFILE CONFIG lt SPI Tx reg gt lt SPI Rx reg gt lt SPI ChipEnable reg gt Parameters for the FLASHFILE CONFIG command lt SPI Tx reg gt The transmit data register lt SPI Rx reg gt The receive data register lt CS GPIO reg gt The chip selection GPIO register which is connected to the Flash chip selection lt CS bit gt The chip selection bit in the GPIO CS register lt SPI ChipEnable reg gt The chip enable register of
11. Flash to RAM and then executed by the processor The code in the serial Flash is not changed by the download process and is write protected Reasons for the widespread use of serial Flash devices include Cost effective and space saving solution thanks to a reduced number of pins Low power consumption Life cycle of about 20 years About SPI Interface Controllers in Serial Flash Memories Serial Flash memories consist of an interface controller for example a SPI interface controller and a Flash memory Access to the Flash memory is performed by the interface controller on the SPI slave side SPI Master Controller SPI Slave Re ca fan ER E ee Fe E a ee Pa N es ons Ca ae Cee ee ae at tee a ee ae PY q Processor ip Serial Flash GPIO Ss oe Memory SPI SS SPI Core Interface MOSI gt SDI Interface Flash Controller Miso 4 SDO Controller e Memory SCLK gt SCLK Figure Processor Chip and Serial Flash Memory with a SPI Interface 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide Background Knowledge Serial Flash memories are controlled by many kinds of serial interface protocols SPI SSP SSI SMI etc The protocol of the SPI interface serial peripheral interface specifies four signals Slave select SS Master output slave input MOSI Master input slave output MISO Serial clock SCLK Most chip manufacturers
12. Monaco VM 00000100 0A0D2064 20202038 202D2D2D 20202020 d p 40202C29 36354350 00203437 2D203B0A MPCS674fh vm 00000110 2D202D2D 20202020 2D202D20 2D202D20 f0000000000100060 20202020 20202020 2p2D2D2D 20202020 vm 00000120 2D202D2D 20202020 2D2D2D2D 20202020 0000000000100070 20202020 20202020 20202020 20202020 VM 00000130 2D2D2D2D 2D2D2D2D 38040020 43504020 0000000000100080 2D2D2D2D 2D2D2D2D 2D2D2D2D 2D2D2D2D ee oe ET YM 00000140 58593535 23284020 0A0D2029 62040020 0000000000100090 040D202D 6F43203B 20206572 20202020 _ amp Core 0000000000100040 20202020 32652034 00203030 4D203B04 amp 66756E61 75746361 20726572 46203420 anufacturerou oF 73656572 656C6163 3B0A0D20 3B0A0D20 reescalegt amp b 0000000000100000 74754120 20726F68 20202020 34202020 Author uu 00000000001000E0 49455220 3B0A0D20 61745320 20737574 LREIL Status _ 00000000001000F0 20202020 3A202020 6C657220 65736165 elease Data is copied from the 0000000000100100 0A0D2064 20202038 20202020 20202020 CPU to the serial Flash 0000000000100110 20202020 20202020 20202020 20202020 0000000000100120 2D2D2D2D 2D2D2D2D 2D2D2D2D 2D2D2D2D 0000000000100130 2D2D2D2D 2D2D2D2D 3B0A0D20 43504020 Res MPC 0000000000100140 58583535 23284020 0A0D2029 620A0D20 SSXX C Gk Eb ne Example 2 Verify the data between virtual memory and serial Flash FLASHFILE COPY VM 0x0 OxFFFFF 0x1
13. O Enable FLASHFILE RESet lt SPI Tx Reg gt lt SPI Rx Reg gt lt CS GPIO reg gt lt CS bit gt FLASHFILE CONFIG 0x5C007008 0x5C007008 0x5800B3FC 0x7 lt code_range gt lt data_range gt lt algorithm_file gt FLASHFILE TARGET 0x4000000 0x1FFF 0x4002000 0x1FFF demo arm flash byte spi6 4 stm bin Programming for the serial Flash FLASHFILE GETID FLASHFILE ERASE 0x0 0OxFFFFF FLASHFILE LOAD 0x0 FLASHFILE SAVE dump bin 0x0 0OxFFFFF ENDDO 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide 36 Scripts for SPI Controllers FLASH Programming via Boundary Scan The BSDL commands of TRACE22 are used to program external FLASH memories via boundary scan Important BSDL specific steps are Check that the bypass mode works Check that the IDCODE matches Define the FLASH pin connection Enable serial FLASH programming via boundary scan and define the flash type Serial FLASH programming then continues with the FLASHFILE commands described in this manual The following PRACTICE script cmm illustrates the BSDL specific steps by way of these examples Example 1 for the SPI protocol Example 2 for the 12C protocol Example 1 for the SPI Protocol CPU AT91SAM3U4 Serial FLASH M25P64 STMicroelectronics 64Mbit Pin connection SPI_CE Port A16 SPI_SCK Port A15 SPI_MOSI Port A14 SPI_MISO Port A13 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide 37 FL
14. SPI Controllers 23 FLASHFILE Declaration Examples 24 Declaration Example for STM32F 103 Cortex M3 24 Declaration Example for AT91SAM9XE ARM9 25 Checking the Identification from the Serial Flash Device 26 Erasing the Serial Flash Device 27 Programming the Serial Flash Device 28 Copying the Serial Flash Memory 29 Modifying the Serial Flash Memory 31 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide 1 Other Useful Commands 32 Reading the Serial Flash 32 Saving the Serial Flash Device 33 Full Examples 34 Example 1 34 Example 2 36 FLASH Programming via Boundary Scan s secccesecesseeeeneeeeeeesaeenseeeesecaeseseeeesseeseneeeeeeenees 37 Example 1 for the SPI Protocol 37 Example 2 for the 12C Protocol 39 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide 2 Serial FLASH Programming User s Guide Version 06 Nov 2015 05 Feb 15 Added section Finding the lt serialflash_code gt of Your Serial Flash Device Introduction This manual describes the basic concept of serial Flash programming How This Manual is Organized Background Information Provides information about important terms in serial Flash programming such as SPI interface controller block and page Standard Approach Describes the fastest way to get started with SPI serial Flash programming All you need to do is to identify and run the correct script Demo scripts for SPI serial Flash programming are prov
15. Serial FLASH Programming User s Guide TRACE32 Online Help TRACE32 Directory TRACE32 Index TRAGES2 DOCUINGIES sisiiccdinns eccrine asec aaa E a seer eevee ea 5 FLASH Programming sssaaa AAAS j Serial FLASH Programming User s Guide nssnnssunssnueennnnnnnnennnennnnnnennnnunnennnnnnnnnnnnnnnnnn nnne nnnnn nann 1 iniroduction sinrin 3 How This Manual is Organized 3 Related Documents 3 Contacting Support 4 Listor ADDIOVIAUONS senina eatecGuappbianCundsonnicenaslys 6 Background Knowledge cass cscs ccei cscs tcc vesaittecen case t ieee cresntceevencittecen deca bieed NEEE Ean 7 What is a Serial Flash Device 7 About SPI Interface Controllers in Serial Flash Memories 7 About Blocks and Pages 8 File Name Convention for Serial Flash Drivers 9 Simdan ED SEEMITEDAC ING sesiins Soactecinscsucce since vty A pages Camminntaceanane 10 Identifying and Running Scripts for Serial Flash Programming 10 If There Is No Script 12 SCHpts For SPI COMMONS ccesistssccsesccssccasccascadcasecersiacssccedsciscnsasnanchsoeresiustcccas ictssoeevicderieeeseseces 13 Establishing Communication between Debugger and Target CPU 15 Configuring the SPI Controller 16 Resetting Default Values 17 Informing TRACE32 about the Serial Flash Register Addresses SPI 17 Informing TRACE32 about the Serial Flash Programming Algorithm 18 Identifying the Correct Driver Binary File for a Serial Flash Device 20 Finding the lt serialflash_code gt of Your Serial Flash Device 21 Example for
16. a is buffered for the programming algorithm 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide a Scripts for SPI Controllers 64 byte argument buffer buffer for programming data 256 byte stack Figure Memory mapping for the lt data_range gt The argument buffer used for the communication between the TRACE32 software and the programming algorithm is located at the first 64 bytes of lt data_range gt The 256 byte stack is located at the end of lt data_range gt lt buffer_size gt size_of lt dala_range gt 64 byte argument buffer 256 byte stack lt buffer_size gt is the maximum number of bytes that are transferred from the TRACE32 software to the serial Flash programming algorithm in one call lt file gt Lauterbach provides ready to run driver binary files for serial Flash programming They are located in the TRACE32 installation directory demo lt architecture gt flash byte Note is expanded to the lt TRACE32_installation_directory gt which is c T32 by default For detailed information about how to determine the lt file gt parameter see Identifying the Correct Driver Binary File for a Serial Flash Device on page 20 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide LE Scripts for SPI Controllers Identifying the Correct Driver Binary File for a Serial Flash Device There are two ways to find the correct
17. al Flash programming algorithm and where it runs on the target RAM FLASHFILE TARGET 0x300000 0x1FFF 0x302000 0x1FFF demo arm flash byte spi64_at91lsam9xe bin 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide 25 Scripts for SPI Controllers Checking the Identification from the Serial Flash Device The following command can be used to check if TRACE32 can access the serial Flash device Get the ID values of the serial Flash FLASHFILE GETID device Open the TRACE32 AREA window AREA view Check the access to the serial Flash device and the device ID by getting the manufacturer ID FLASHFILE GETID 1989 2015 Lauterbach GmbH 26 Scripts for SPI Controllers Serial FLASH Programming User s Guide Erasing the Serial Flash Device The following command is available to erase serial Flash devices FLASHFILE Erase lt range gt Erase the serial Flash NOTE The FLASHFILE Erase command has a time limitation TRACE322 has to get a response success or failure from the serial Flash in 3 minutes If you get an error message because of the FLASHFILE Erase time limita tion then divide the original range into several smaller ranges Example 1 Original erase range Erase 2MB starting from 0x0 FLASHFILE Erase 0x0 0x1FFFFF Example 1 cont d Two smaller erase ranges Erase 2MB starting from 0x0 FLASHFILE Erase 0x0 0OxFFFFF FLASHFILE Erase 0x100000 0x1FFFFF Exam
18. ation in a 32 bit format Long option FLASHFILE DUMP 0x1000 Long AFind Modify 0 4 8 L gt E3510201 31510003 31801201 31402202 3AFFFFFA E3510102 31510003 31401081 3102082 3AFFFFFA E3A00000 E1530001 20433001 21800002 E15300A1 20433041 21800042 E1530121 20433121 21800122 E1530141 2043311 21800142 E3530000 11B02222 11401221 1AFFFFEF E35C0000 42600000 E1AQFOOE E13C0000 42600000 E1A0FOOE 33400000 O1A00FCC 03800001 E1AQFOOE 3510801 21A01821 23402010 33402000 E3510C01 21401421 22822008 E3510010 21401221 22822004 3510004 82822003 908220A1 E35C0000 E1A400233 42600000 E1AQFOOE E52DE004 EB000230 E3A00000 E49DF004 E1A00000 E1A400000 E1A00000 E1A00000 E1A00000 E1400000 E3510000 0A000032 42611000 E1B0Cc000 42600000 2512001 11500001 03400000 81110002 00000002 9A000026 E3402000 E3510201 31510000 31401201 32822004 3AFFFFFA E3510102 31510000 31401081 32822001 3AFFFFFA E2522003 BAQOOOOE E1500001 20400001 E15000A1 20400081 0000000000001170 E1500121 20400121 15001A1 20400141 Of DMcTcEcE HP rn _czczczezrn Oczor sitam COWMyM s am a czZczczcz O bmn czoNnczczncz cz I T CTOPNHY OPDOPDOMODPOPETOPLONWODOW 7A NOY M NODDI DO gt NWM gm aM aM pam M pa M HDuD onet Inczczo aa 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide 32 Scripts for SPI Controllers Saving the Serial Flash Device The following command is available to save the contents of the serial Flash memory to a
19. bin file You can identify the bin file via our website as described in this section Alternatively run a PRACTICE script cmm as described in Finding the lt serialflash_code gt of Your Serial Flash Device page 21 To identify the correct bin file 1 For information about supported Flash devices access the Lauterbach website 2 Click the drill down button next to Tool Chain and then click Supported NAND Serial Flash Controller http Avww lauterbach com ylistnand html 3 Open Supported Flash Devices in a separate window or tab http www lauterbach com ylist html 4 On the Supported Flash Devices page select the required company from the drop down list LAUTERBACH Supported Flash Devices v HYNIX a home gt Tool Chain INFINEON INTEL MACRONIX MICRON MICRONAS MICROSEMI NEC pi Supported FLASH Devices NXP OKI RENESAS NAND FLASH devices are marked in GREEN SAMSUNG SANDISK d SERIAL FLASH devices are marked in RED 5 Locate the desired Flash device You need the name of the Flash device to be able to identify the correct driver binary file 6 Identify the correct bin file based on the name of the Flash device The following example illustrate how to do this The example below illustrates how to apply the file name convention in practice For information about the file name convention for driver binary files see File Name Convention for
20. case of missing script files cmm please proceed as requested in If There is No Script on page 12 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide 5 Introduction List of Abbreviations The abbreviations vary from chip manufacturer to chip manufacturer MOSI or SI Master output slave input MISO or SO Master input slave output SCLK or SCK Serial clock SS Slave select SDI Serial data input SDO Serial data output CS or CE CS Chip selection CE Chip enable SPI Serial peripheral interface eMMC Embedded multimedia card MMC Multimedia card GPIO General purpose input output SSI Synchronous serial interface 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide List of Abbreviations Background Knowledge This chapter of the manual is aimed at users who are new to serial Flash programming it does not address experts with many years of expertise in this area This chapter gives you a brief overview of important terms in serial Flash programming such as serial flash device sector page and SPI interface controller What is a Serial Flash Device A serial Flash device is a non volatile memory that can be electrically erased and reprogrammed It is used for storing executable code in devices such as DVD players DSL modems routers hard disk drives and printers After power up the executable code is downloaded from the serial
21. data from the source range to the defined address of the serial Flash FLASHFILE COPY lt source range gt lt target addr gt ComPare Verify the source range data against the target range data Example 1 Copy the 1MB virtual memory data at 0x0 to the serial Flash address z ac OxilOOOOO VM The virtual memory of the TRACE32 software FLASHFILE COPY VM 0x0 OxFFFFF 0x100000 Result 1 2 AS DIALOG j ee Long OE Track M Hex C 0123456789ABCDEF VM 00000000 4E565338 76655220 6F697369 75920346E SVN_Revyision u VM 00000010 6FEEGBEE OAODGE 3BOA0D3B 43504020 nknown t Gk MPC VM 00000020 58353535 43504D2F 58363535 43504D2F 555X MPC556X MPC V M 00000030 58333535 504D202C 33363543 532F4D78 553X MPCS63xM S VM 00000040 36354350 78784D33 6F4D2820 6F63616E PCS63Mxx Monaco 5 40202C29 36354350 0020343 2D203B04 202D202D 2D2D2D2D 2D2D2D2D 20202020 4E FAO a aU Pea 2D2D2D2D 2D2D2D2D 2D2D2D2D 20202020 EF F E ra Ca 20202020 32652034 0D203030 4D203B0A address o a 8 0123456 78SABCDEF Be SEI E746361 20226572 ac203A20 4565338 76655220 6F697369 75203A6E SVNRevision u 6F6E6B6E OAODGE7 3B0A0D3B 43504020 nknown gk FF MPC 73858572 658C6163 38080020 38000020 Ce pE VM ODODODED 49455220 3BOAOD20 61745320 20737574 58333535 504D202C 33363543 532F4D78 553 MPC563xM S VM OO000OFO 20202020 3A202020 6C657220 65736165 36354350 78784033 6F4D2820 6F63616E PC563Mxx
22. file FLASHFILE SAVE lt file gt lt range gt Save the contents of the serial Flash memory into lt file gt Example Save 1MB of the serial Flash data starting at 0x0 to the file my_dump bin FLASHFILE SAVE my_dump bin 0x0 0OxFFFFF 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide 33 Scripts for SPI Controllers Full Examples Example 1 CPU STM32F 103 Cortex M3 core Serial Flash M25P64 STMicroelectronics 64Mbit Serial Flash CS Connected to GPIO B 2 RESet SYStem RESet SYStem CPU STM32F103ZE SYStem Up gosub enable_SPI Reset the Flash declaration within TRACE32 FLASHFILE RESet For the serial Flash CS connected GPIO B 2 group B port number2 GPIO B 2 data output register 0x40010C0C s lt SPI Tx reg gt lt SPI Rx reg gt lt CS GPIO reg gt lt CS bit gt FLASHFILE CONFIG 0x4001300C 0x4001300C 0x40010C0C 0x2 FLASHFILE TARGET 0x20000000 0x1ffF 0x20002000 0x1FFF demo arm flash byte thumb spi64 stm bin Read Flash manufacture and device ID FLASHFILE GETID Erase serial Flash FLASHFILE Erase 0x0 0OxFFFFF Program my_file bin to serial Flash FLASHFILE LOAD my _file bin 0x0 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide 34 Scripts for SPI Controllers Save to my_dump bin from serial Flash FLASHFILE SAVE my _dump bin 0x0 0OxFFFFF enable SPI Clock Enable related with the SPI and GPIO group PER S SD 0x40021014 Long 0x114 FSCM Cl
23. ided on the TRACE32 software CD demo lt architecture gt flash lt gt cmm e g at9lsam9xe spi cmm stm32f10x spi cmm str910 spi cmm New Scripts for SPI Controllers Describes how you can create a script if there is no demo script for the SPI controller you are using Related Documents A complete description of all serial Flash programming commands can be found in chapter FLASHFILE in General Commands Reference Guide F general_ref_f pdf The manual List of Supported FLASH Devices flashlist pdf provides the following information A list of the supported serial Flash memory devices A list of the supported CPU families for the serial Flash protocol 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide Introduction The Lauterbach home page provides an up to date list of Supported Flash devices under http Awww lauterbach com ylist html Supported serial Flash controllers under http Awww lauterbach com ylistnand html Contacting Support LAUTERBACH GmbH Altlaufstrasse 40 85635 Hoehenkirchen Siegertsbrunn Germany Phone 49 8102 9876 555 Fax 49 8102 9876 187 Internet http www lauterbach com tsupport html or http www lauterbach com report html Here you ll find local and special support addresses E mail support lauterbach com General support address where your request will be answered within a short time if it is a basic support request or redirec
24. lash programming with TRACE32 requires that the communication between the debugger and the target CPU is established The following commands are available to set up this communication SYStem CPU lt cpu gt Specify your target CPU SYStem Up Establish the communication between the debugger and the target CPU SYStem CPU STM32F103 Select STM32F103 as the target CPU SyStem Up Establish the communication between the debugger and the target CPU 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide 15 Scripts for SPI Controllers Configuring the SPI Controller Programming a serial Flash device requires an appropriate initialization of the serial Flash interface The following settings might be necessary Enable the clock SCLK Configure the registers of the serial Flash interface such as clock master slave data width etc Configure the serial Flash pins if they are muxed with other functions of the CPU Example In the CPU STM32F 103 all the SPI pins are muxed with the GPIOs Serial Flash CPU Memory STM32F103 GPIO A4 SS gt SS GPIO A5 SCLK gt SCLK GPIO A6 MISO SDI GPIO A7 MOSI gt SDO Using the commands below the pins of the serial Flash interface SPI can be configured for the CPU STM32F103 The resulting configuration allows the CPU to switch from the GPIO A4 A7 to SS SCLK MISO and MOSI PER Set S
25. n of scripts to be used with SPI controllers lt TRACE32_installation_directory gt demo lt architecture gt flash lt cpu_name gt spi cmm To identify and run the required script 1 Make a note of the lt cpu_name gt printed on the CPU for example bem5357 2 Put the lt cpu_name gt and spi together to form the script name becm5357 spi cmm tod The script file resides in this folder demo mips flash bem5357 spi cmm Note is replaced by the lt TRACE32_installation_directory gt which is c T32 by default If the folder does not contain the script you are looking for see If There Is No Script on page 12 3 Run the script in TRACE32 by doing one of the following Choose File gt Run Batch File lt script name gt 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide 10 Standard Approach Inthe command line type DO lt path and script name gt NOTE Each script cmm includes a reference to the required serial Flash programming algorithm bin You do not need to program or select the algorithm Example gt lt code_range gt lt data_range gt lt algorithm_file gt FLASHFILE TARGET 0x80020000 0x1FFF 0x80022000 0x3FFF demo mips flash byte_le spi6 4_bem5357 bin 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide 11 Standard Approach If There Is No Script If there is no script for your device in this directory lt TRACE32_installatio
26. n_directory gt demo lt architecture gt flash then please send a request to serialflash support lauterbach com using the e mail template below E Mail Template Chip name Name of serial Flash device Provide the CPU datasheet for us Lend the target board to us by sending it to the address given in Contacting Support lt SystemInformation gt Be sure to include detailed system information about your TRACE32 configuration For information about how to create a system information report see Contacting Support Normally we can provide support for a new device in two weeks If our support cannot provide you with a script you will have to create your own script cmm For more information about how to create your own script cmm see Scripts for SPI Controllers on page 13 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide Standard Approach Scripts for SPI Controllers This chapter describes how to create new scripts for serial Flash memories that are equipped with SPI controllers The steps and the framework see below provide an overview of the process They are described in detail in the following sections The following steps are necessary to create a new script it oN Oo a FF DN Establishing Communication between Debugger and Target CPU page 15 Configuring the SPI Controller page 16 Resetting Default Values page 17 Informing TRA
27. ock Enable PER S SD 0x40021018 Long 0x100C SPI1 amp GPIO A B Enable PER S SD 0x40010C00 LONG 44444344 GPIOB 2 output PER S SD 0x40010C0C LONG 00000004 deselect the SPI FLASH CS GPIOB 2 PER S SD 0x40013000 WORD Ox30F SPI_Init PER S SD 0x40013010 WORD 0x7 SPL_GAXe ool amp spi_enable Data word SD 0x40013000 0x40 PER S SD 0x40013000 WORD amp spi_enable SPI1 Enable return ENDDO 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide 35 Scripts for SPI Controllers Example 2 CPU The STR91x is based on a ARM966E core It has a SSP protocol which is similar to a STM SPI controller Serial Flash ST Microelectronics M25P64 64Mbit Serial Flash is connected to GPIO 5 7 on the STR91x Then it is controlled by GPIOS5 register Ox5800B3FC Select str910 as target CPU Establish the communication between the debugger and the target CPU SyStem RESet SyStem CPU STR910 SYStem Option ResBreak OFF SYStem JtagClock RTCK SyStem Up Enable SSP Synchronous Serial Peripheral amp configuration of pins PER Set ASD 0x5C002018 Long 0x80300 PER Set ASD 0x5C002020 Long 0x80300 PER Set ASD 0x5C002028 Long 0x80300 PER Set ASD 0x5800B400 Long 0xb0 PER Set ASD 0x5C002058 Long 0x4a00 PER Set ASD 0x5C002098 Long 0x0 PER Set ASD 0x5C002078 Long 0x40 PER Set ASD 0x5C007000 Long 0x5c7 SSPO_CRO PER Set ASD 0x5C007010 Long 0x2 SSP0_PR PER Set ASD 0x5C007004 Long 0x2 SSP0
28. ound Knowledge File Name Convention for Serial Flash Drivers The serial Flash drivers for SPI controllers i e the algorithm files use the following file name convention Serial Flash driver name SPInn_ CPU bin where nn is a two digit number that indicates the size of one sector in KByte the sector erase size in KByte nn Sector Hex Size 32 32KB 0x0 0x7FFF 64 64KB 0x0 0xFFFF where CPU is the CPU family name 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide 9 Background Knowledge Standard Approach The chapter Standard Approach provides a compact description of the steps required to program serial Flash memories This description is intentionally limited to the standard use case Overview of the Standard Approach Identify and run the required script for serial Flash programming What to do if there is no script for NAND Flash programming The following step by step procedures describe the standard approach in detail For a detailed description of the serial Flash programming concepts see Scripts for SPI Controllers on page 13 Identifying and Running Scripts for Serial Flash Programming Lauterbach provides scripts cmm for serial Flash programming which can be found below the TRACE32 installation directory The scripts support serial Flash memories that have a serial Flash controller with a SPI interface short SPI controller Path and file name conventio
29. ple 2 Erase 8 MB in increments of 1 MB using a RePeaT loop amp addr 0x0 RePeaT 8 FLASHFILE Erase amp addr 0xFFFFF amp addr amp addr 0x100000 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide 27 Scripts for SPI Controllers Programming the Serial Flash Device The following commands are available to program the serial Flash FLASHFILE LOAD lt file gt lt address gt lt range gt Program serial Flash FLASHFILE LOAD lt file gt lt address gt lt range gt ComPare The data from lt file gt is written to the address range specified by lt range gt If no lt range gt or lt address gt is specified programming starts at address 0x0 Example 1 Program the contents of my_file bin to the serial Flash memory starting at address 0x0 FLASHFILE LOAD my _file bin 0x0 Example 2 Verify the contents of my_file bin against the serial Flash memory starting at address 0x0 FLASHFILE LOAD my file bin 0x0 ComPare 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide 28 Scripts for SPI Controllers Copying the Serial Flash Memory The following command is available to copy Any data from any CPU memory area to the serial Flash memory or Any data from one address range of the serial Flash to another address range within the same serial Flash memory for example for backup purposes FLASHFILE COPY lt source range gt lt target addr gt Copy
30. s N V Supported Compilers I Supported Host CPU CONTROLLER COMMENT Operating Systems SPEAR300 generic NAND F Supported Flash Devices F Supported NAND Serial Flash Controller STM32F103ZE cortexm3 NAND F Supported Target Operati e perating ms E Tool Chain IE Supported Compilers E ST Microelectronics N V F Supported Host Operating Systems TYPE COMPANY COMMENT I Supported Flash Devices M25FL128 STM Serial Flash 256KB sector F Supported NAND Serial Flash M25P64 v Serial Flash Controller M28F101 M28F256 F Supported Target M28F102 M28F256 Operating Systems M28F201 M28F256 F Supported Tool Integrations F Supported Simulators Virtual Prototypes Target Servers Support The binary file resides in this folder demo arm flash byte Note is expanded to the lt TRACE32_installation_directory gt which is c T32 by default This results in the following command line Specify the serial Flash programming algorithm and where it runs in the target RAM lt code_range gt lt data_range gt lt file gt FLASHFILE TARGET 0x20000000 0x1FFF 0x20002000 0x1FFF demo arm flash byte spi6 4_ stm bin 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide 23 Scripts for SPI Controllers FLASHFILE Declaration Examples Declaration Example for STM32F103 Cortex M3 STM32F103 ARM Cortex M3 from ST Microelectronics M25P64 64Mbit SPI Tx register SPI Rx register 0x4001300C
31. ted to the appropriate address Be sure to include detailed system information about your TRACE32 configuration 1 To generate a system information report choose TRACE32 gt Help gt Support gt Systeminfo Lauterbach Homepage About TRACE32 Online S Aone Cann CEES Onn Sa E Contact Lauterbach License details Press following button to get help on how to generate Support Information Help About Company Lauterbach Department Prefix Firstname Andrea Surname Martin Street Altlaufstrasse 40 P O Box City Hoehenkirchen Siegertsbr ZIP Code 85635 Country Germany Telephone 49 8104 8943 555 eMail andrea martin lauterbach com Product PowerTrace 512MB Target CPU ARM7TDMI Hostsystem pc Windows 7 X Compiler ARM RealtimeOS Nono Safe Mode Generate Support Information Save to Clipboard Save to Fie 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide Introduction NOTE Please help to speed up processing of your support request By filling out the system information form completely and with correct data you minimize the number of additional questions and clarification request e mails we need to resolve your problem 2 Preferred click Save to File and send the system information as an attachment to your e mail 3 Click Save to Clipboard and then paste the system information into your e mail NOTE In
32. the serial flash For information about the register addresses and the CS bit refer to the manufacturer s microcontroller manual and the schematics Example 1 For the serial Flash CS connected PIO A 4 group A port number 4 PIO group A register 0x4001080C p lt SPI Tx reg gt lt SPI Rx reg gt ACS EiPlO ieee lt CS bit gt FLASHFILE CONFIG 0x4001300C 0x4001300C 0x4001080C 0x4 Example 2 The AT91SAM9XE s CS is controlled by the SPI register OxFFFC8000 not the specified GPIO ports 7 lt SPI Tx reg gt lt SPI Rx reg gt lt SPI ChipEnable reg gt FLASHFILE CONFIG OxFFFC800C OxFFFC8008 OxFFFC8000 1989 2015 Lauterbach GmbH Serial FLASH Programming User s Guide Scripts for SPI Controllers Informing TRACE32 about the Serial Flash Programming Algorithm The following command is available to inform TRACE32 about the serial Flash programming algorithm FLASHFILE TARGET lt code_range gt lt data_range gt lt file gt Specify the serial Flash programming driver and where it runs in the target RAM Parameters lt code_range gt Define an address range in the target s RAM to which the serial Flash programming algorithm is loaded FLASH algorithm 32 byte Figure Memory mapping for the lt code_range gt Required size for the code is size_of lt file gt 32 byte lt data_range gt Define the address range in the target s RAM where the programming dat

Download Pdf Manuals

image

Related Search

Related Contents

Manual del usuario NPB-40 Pulsioxímetro portátil  Delta Tau TURBO UMAC User's Manual  MOD. R101, R51M/E  Bimetal thermometers Model 52 Operating instructions  + DV 57  Toro Hand-held Radio Interface Data Sheet  Philips HSB4383 SoundBar DVD home theater  Utilize o comando com quatro sentidos  Samsung DVD-P345 Benutzerhandbuch  Le mode d`emploi CNSD de la déclaration MED/RX  

Copyright © All rights reserved.
Failed to retrieve file