AMD PCMCIA Flash Memory Card Embed Utility User's Guide (c) 1996 Advanced Micro Devices, Inc. Advanced Micro Devices reserves the right to make changes in its products without notice in order to improve design or performance characteristics. This publication neither states nor implies any warranty of any kind, including but not limited to implied warrants of merchantability or fitness for a particular application. AMD(R) assumes no responsibility for the use of any circuitry other than the circuitry in an AMD product. The information in this publication is believed to be accurate in all respects at the time of publication, but is subject to change without notice. AMD assumes no responsibility for any errors or omissions, and disclaims responsibility for any consequences resulting from the use of the information included herein. Additionally, AMD assumes no responsibility for the functioning of undescribed features or parameters. Trademarks AMD, the AMD logo, and combinations thereof are trademarks of Advanced Micro Devices, Inc. Product names used in the publication are for identification purposes only and may be trademarks of their respective companies. TABLE OF CONTENTS Introduction ................................................................................................................... 5 Preparing to use the Embed program ......................................................................... 5 Starting the Embed program ....................................................................................... 6 Selecting the Flash Card .............................................................................................. 6 Using Common Memory ............................................................................................... 7 Reading memory ....................................................................................................... 7 Programming a word to common memory ................................................................ 9 Programming a byte to common memory ................................................................. 9 Programming a file to common memory .................................................................. 10 Erasing common memory ........................................................................................ 10 Erasing a sector pair .......................................................................................... 10 Erasing the entire card ....................................................................................... 11 Using the Attribute Memory ....................................................................................... 11 Displaying Attribute Memory .................................................................................... 12 Writing a Byte to Attribute Memory .......................................................................... 12 Writing a File or File Image to Attribute Memory ..................................................... 12 Reading Attribute Memory to a File ......................................................................... 13 Exiting to DOS temporarily ........................................................................................ 13 Using Erase and Suspend; Resume Erase ............................................................... 13 AMD PCMCIA Flash Memory Card Embed Utility User's Guide 3 4 AMD PCMCIA Flash Memory Card Embed Utility User's Guide Introduction The Embed program is a DOS utility that allows you to perform the following functions on any AMD C-series or D-series Flash memory PC card: * Read from the card's common or attribute memory * Program a byte or file contents into the card's common or attribute memory * Erase a sector or the entire card's common memory. AMD Flash memory cards verify program and erase operations through Embedded Algorithms. Each Flash component within a Flash memory card executes these algorithms. This guide presents the features of the Embed program and explains how to use them. This version of the Embed program is preliminary; currently only minimal support is available. For general information on the PCMCIA specification, refer to the PCMCIA Training Manual (PID 17515B), included in this Evaluation Kit. Preparing to use the Embed program The Embed utility was designed to assist users of the AMD Flash Memory Card Evaluation Kit. Refer to AMD Flash Memory Card Evaluation Kit User's Guide for information on installing the card drive provided with the kit. You can also use Embed with any 365-compatible card drive. Embed has a built-in flash file system; you should disable any FFS or FTL drivers before running Embed to avoid possible conflicts. Embed can also conflict with networking software; consider disconnecting the PC from the network before running Embed. You can use the boot menu option of config.sys to choose which drivers your PC loads at startup. While Embed is running, it copies the contents of this address space to the Flash card. Adding this line to the config.sys file prevents EMM386.exe from using this address space in upper memory. Also, add the following line to your config.sys file: device=emm386.exe noems x=D000-DFFF If you are using a multiple card drive configuration, determine which card socket is designated as the first (slot 0). Embed always uses the designated first card socket in the system. To install the Embed utility, copy embed.exe from the floppy disk to the system's hard drive. AMD PCMCIA Flash Memory Card Embed Utility User's Guide 5 Starting the Embed program To run the Embed program, type embed at a DOS command line. Figure 1 shows the main menu that appears. Figure 1. Main Menu Selecting the Flash Card To select a Flash card, press f on the keyboard. The screen scrolls and displays a list of AMD's Flash card part numbers (Figure 2). Press a number key (1-7) that corresponds to the card plugged into the card drive, and then press Enter. If you press Enter without pressing a number key, you return to the main menu. When Embed identifies the card and matches it to your selection, Embed displays the message, "Correct card selected." and displays the manufacturer and device codes. Press Enter to return to the Main Menu. Embed calculates the highest valid address based on your selection; for example, if you select the letter corresponding to a 1 MB card, but you have a 4 MB card plugged into the card drive, Embed will not report the correct address information beyond the highest address for a 1 MB card. Therefore, ensure that the selection you enter matches the card plugged into the drive. 6 AMD PCMCIA Flash Memory Card Embed Utility User's Guide Figure 2. Card Selection Menu If Embed cannot identify the card, Embed displays an error message (Figure 3). Pressing any key then returns you to the main screen. Figure 3. Card Error Message Using Common Memory Embed can read, program, and erase both the common and attribute (CIS) memory data. This section describes the steps for interacting with the common memory. For information on the attribute memory, see "Using the Attribute Memory" on page 11. Reading memory Press Esc to return to the main menu. Press r on the keyboard. The screen scrolls and asks for a starting address, in hexadecimal format, from which you wish to read (Figure 4). Type the desired starting address and press Enter. Ensure that you selected the proper card with the "Card Select" option on the Main Menu, or Embed may display an address that is higher than the highest address on the physical card in the card drive. After reading the highest physical address, Embed reads data starting from address 0 again, but continues to increment the address value. AMD PCMCIA Flash Memory Card Embed Utility User's Guide 7 Figure 4. Entering a Starting Address Press Enter to view the next screenful of memory contents, or press Esc to return to the Main Menu. Figure 5. Error Message During Read Request Figure 6. Displaying Memory Contents 8 AMD PCMCIA Flash Memory Card Embed Utility User's Guide Programming a word to common memory To program a word to common memory, return to the Main Menu. Press w on the keyboard. Embed requests a starting address and the word of data you want to program to memory. Figure 7 shows the screen that Embed displays for these steps. Ensure that you enter a valid hexadecimal value to avoid programming erroneous data into memory. After the program operation is complete, Embed displays the message, "Program Successful. Hit Return to Continue." You can verify the operation was successful by returning to the Main Menu and reading data from the address to which you just programmed. Embed calculates the highest valid address based on your card selection. Embed will not program to an address higher than the highest address associated with the card part number you entered at the main menu. For example, if you selected a 2 MB card, but had actually plugged in a 4 MB card, then tried to program to an address beyond 2 MB, Embed reports an "out of range" error message. Figure 7. Programming a Word to Common Memory Programming a byte to common memory To program a byte to common memory, return to the Main Menu. Press b on the keyboard. Embed requests a starting address and the byte of data you want to program to memory. Figure 8 shows the screen that Embed displays for these steps. Be sure to enter a valid hexadecimal value to avoid programming erroneous data into memory. After the program operation is complete, Embed displays the message, "Program Successful. Hit Return to Continue." You can verify the operation was successful by returning to the Main Menu and reading data from the address to which you just programmed. Figure 8. Programming a Byte to Common Memory AMD PCMCIA Flash Memory Card Embed Utility User's Guide 9 Programming a file to common memory Embed allows you to program a file into common memory. To program, press p at the Main Menu. Type in the file name (and path, if necessary), press Enter. Type the starting address at which you want to load the file; press Enter. If you specify a starting address that is too high, Embed reports "Maximum Address Exceeded." Press Enter to return to the menu. Figure 9 shows the prompts that Embed displays during these steps. Figure 9. Programming a File into Memory Erasing common memory In Flash devices and cards, an erase command programs all the affected bits to a logical 1. A subsequent read operation will confirm this by displaying ff for all words. The erase function in Embed affects only common memory; it does not alter the attribute memory. Erasing a sector pair Embed has two functions that erase the contents of the Flash memory card: sector erase and card erase. Specifying a sector address erases a sector pair. On Flash memory cards, the Flash devices are paired off such that one sector from one device pairs with one sector of the other device to form a single contiguous address space in common memory. A sector pair thus holds twice the data of a single sector. The first sector pair addresses are from 00000-1ffff, the second sector pair addresses are from 20000-3ffff, and so on. To erase a sector pair, return to the Main Menu and press s. Type in the starting address of the sector you want to erase, then press Enter. The starting address can be any address within the sector pair. To erase the proper sector, ensure you selected the correct card at the main menu. Figure 10 shows the prompts during the erase enabling sequence. Embed displays the elapsed time for the erase operation when finished. Figure 10. Erasing a Sector 10 AMD PCMCIA Flash Memory Card Embed Utility User's Guide Erasing the entire card To erase the entire card, return to the Main Menu and press c. (Figure 11). Embed displays the line "Erasing card: " for each internal component it erases. In Figure 11, Embed is erasing an AmC001CFLKA, which has eight Am29F010A components. Embed displays the elapsed time for the erase operation when finished. Figure 11. Erasing the Entire Card Using the Attribute Memory AMD's Flash memory cards store the CIS (Card Information Structure) data on an separate EEPROM on the card. The memory space on this EEPROM is called the attribute memory. The CIS always begins at address 0 of the attribute memory. Embed allows you to access the CIS data in the attribute memory via the Attribute Memory Menu. To access this menu, return to the Main Menu and press a. Figure 12 shows the Attribute Memory Menu that appears. To return to the Main Menu, press Esc. Figure 12. Attribute Memory Menu AMD PCMCIA Flash Memory Card Embed Utility User's Guide 11 Displaying Attribute Memory To display the contents of the attribute memory on the screen, press d while Embed is displaying the Attribute Memory Menu. Type the address from where Embed will begin reading; press Enter. Embed displays the memory contents in hexadecimal and ASCII formats (Figure 13). Figure 13. Displaying Attribute Memory Writing a Byte to Attribute Memory Embed allows you to write individual bytes into attribute memory. To do this, access the Attribute Memory Menu, then press m. Figure 14 shows the options that appear. Press 1 to proceed with modifying the attribute memory. Type the starting address; press Enter. Type the hexadecimal value to write into attribute memory; press Enter. Figure 14. Specifying Data to Write Into Attribute Memory Writing a File or File Image to Attribute Memory The attribute memory has valid data only in the even bytes, as an anti-virus measure. When you select w (write a file to Attribute Memory) from the Attribute Memory Menu, Embed writes the contents of a file you specify to only the even bytes of the attribute memory. This places the file contents only in attribute memory locations with valid data. Selecting f writes the contents of a file you specify to all bytes in attribute memory, not just the even ones. This means that the sequence of data in the file should be exactly the sequence of data you want in the attribute memory. This is why the file you specify with the f option is called the file image. 12 AMD PCMCIA Flash Memory Card Embed Utility User's Guide Reading Attribute Memory to a File The r option is the "complement" of the f option. Selecting r reads all bytes of the attribute memory and saves them to a file you specify. To save the contents of the Attribute memory to a file, return to the Attribute Memory Menu, then press r (see Figure 15). Type the name you wish to give the file; press Enter. If you do not specify a path, Embed writes the file to the C:\ directory. Embed assumes a file size of 128 bytes and an attribute memory size of 256 bytes, since only the even bytes of the attribute memory contain valid data. You can use the r and f options together to back up and restore the CIS information. Figure 15. Reading Attribute Memory to a File Exiting to DOS temporarily You can exit to DOS temporarily from Embed, then resume working with Embed by typing "exit" and pressing Enter. Simply press e while at either the Main Menu or the Attribute Memory Menu. Figure 16. Exiting to DOS temporarily Using Erase and Suspend; Resume Erase The Erase and Suspend option demonstrates the ability of AMD's Flash memory cards to suspend an erase operation, and then read from any sector (excluding the one being erased). After the read operation is complete, the Resume Erase option resumes the erase operation. To erase and suspend, press x while at the Main Menu and confirm your choice. Enter the sector address to erase, and Embed erases that sector and suspends the erase operation (Figure 16). To resume the erase, select y from the Main Menu and confirm your selection. Enter the address to resume the erase operation, and Embed continues it (Figure 17). AMD PCMCIA Flash Memory Card Embed Utility User's Guide 13 Figure 17. Suspending an Erase Operation Figure 18. Resuming an Erase Operation 14 AMD PCMCIA Flash Memory Card Embed Utility User's Guide ADVANCED MICRO DEVICES, INC. One AMD Place P.O. Box 3453 Sunnyvale, California 94088-3453 (408) 732-2400 (800) 538-8450 TWX: 910-339-9280 TELEX: 34-6306 APPLICATIONS HOTLINE & LITERATURE ORDERING USA (408) 749-5703 JAPAN (03) 3346-7600 UK & EUROPE 44-(0)256-811101 TOLL FREE USA (800) 222-9323 FRANCE 0590-8621 GERMANY 0130-8138575 ITALY 1678-77224 http://www.amd.com 20775A