Technical Note. J3F 32Mb, 64Mb, 256Mb Parallel NOR Flash Memory Software Device Drivers. Introduction. TN-12-50: J3F Software Device Drivers

Similar documents
Technical Note. Software Driver for M29EW NOR Flash Memory. Introduction. TN-13-12: Software Driver for M29EW NOR Flash Memory.

Application Note Software Device Drivers for the M29Fxx Flash Memory Device

Application Note C Library Source Code for M29W256 Flash Memory Using the Flash Device Driver Software Interface

Monitoring Ready/Busy Using the READ STATUS (70h) Command

Maximum Monolithic Density Density Number of Stacks N25Q512Axxx. 512Mb 2 256Mb N25Q00AAxxx 1Gb 4 MT25Qxs01Gxxx. 1Gb 2 512Mb MT25Qxs02Gxxx 2Gb 4

Technical Note. One-Time Programmable (OTP) Operations. Introduction. TN-29-68: 2Gb: x8, x16 NAND Flash Memory. Introduction

NAND Flash Performance Improvement Using Internal Data Move

Technical Note. Reset Configurations for MT25Q, MT25T, and N25Q Flash Memory Devices. Introduction

SMART Self-Test Reference for P400e SATA SSDs

Power-Up, Power-Down, and Brownout Considerations on MT25Q, MT25T, and MT35X NOR Flash Memory

How to Power On and Power Off the M29F Flash Memory Device

Migrating from Spansion Am29F to Micron M29F NOR Flash Memories

Enabled (both during preconditioning and measurement) 4KB for random writes, 2MB for sequential writes

Technical Note. Improving Random Read Performance Using Micron's SNAP READ Operation. Introduction. TN-2993: SNAP READ Operation.

Technical Note NAND Flash Performance Increase with PROGRAM PAGE CACHE MODE Command

Technical Note. Migrating from Micron M29W Devices to MT28EW NOR Flash Devices. Introduction. TN-13-50: Migrating M29W to MT28EW NOR Flash Devices

Technical Note. SMART Command Feature Set for the eu500. Introduction. TN-FD-35: eu500 eusb SMART Commands. Introduction

Technical Note. Enabling On-Die ECC NAND with JFFS2. Introduction. TN-29-75: Enabling On-Die ECC NAND with JFFS2. Introduction.

Technical Note. Migrating from S29GL-S Devices to MT28FW NOR Flash Devices. Introduction. TN-13-41: Migrating S29GL-S to MT28FW NOR Flash Devices

Comparing Micron N25Q and Macronix MX25L Flash Devices

Technical Note. Migrating from Micron M25PE to Micron MT25Q 128Mb. Introduction. TN-25-36: Migrating from M25PE to MT25Q 128Mb.

Migrating from Spansion S25FL512S to Micron N25Q 512Mb Flash Device

Technical Note. Migrating from Micron M25P to Micron MT25Q 128Mb. Introduction. TN-25-34: Migrating from M25P to MT25Q 128Mb.

Technical Note. Migrating from Cypress's FL-S and FS-S to Micron's MT25Q. Introduction

MT29F4G08AAA, MT29F8G08BAA, MT29F8G08DAA, MT29F16G08FAA, MT29F8G08MAA, MT29F16G08QAA,

Multiple Flash Manufacturers for a Single Design

Technical Note Using CellularRAM to Replace UtRAM

Migrating from Macronix MX29GL-G/F and MX68GL-G Devices to MT28EW NOR Flash Devices

Command Register Settings Description Notes

Parallel NOR and PSRAM 88-Ball MCP Combination Memory

Technical Note. Comparing Micron N25Q and M25P Flash Devices. Introduction. TN-12-12: Comparing N25Q and M25P Flash Devices.

Parallel NOR and PSRAM 56-Ball MCP Combination Memory

Active Serial Memory Interface

AN Entering ISP mode from user code. Document information. ARM ISP, bootloader

Technical Note. Design Considerations when using NOR Flash on PCBs. Introduction and Definitions

Technical Note Using Micron Asynchronous PSRAM with the NXP LPC2292 and LPC2294 Microcontrollers

User Guide. Storage Executive. Introduction. Storage Executive User Guide. Introduction

Technical Note. Enabling SD/uSD Card Lock/Unlock Feature in Linux. Introduction. TN-SD-01: Enabling SD/uSD Card Lock/Unlock in Linux.

Overview. TN-29-08: Hamming Codes for NAND Flash Memory Devices Overview

Creating Flash Algorithms with Eclipse

Micron part numbers e MMC registers Multilevel cell (MLC) to single-level cell (pslc) setting flow

Technical Note. SMART Command Feature Set for the M500DC. Introduction. TN-FD-26: M500DC SSD SMART Implimentation. Introduction

F²MC-16LX FAMILY MB90F897 DUAL OPERATION FLASH 16-BIT MICROCONTROLLER APPLICATION NOTE. Fujitsu Microelectronics Europe Application Note

Technical Note. Adding ECC to a Data Bus with DDR4 x16 Components. Introduction. TN-40-41: Adding ECC With DDR4 x16 Components.

AN3281 Application note

Technical Note. SMART Command Feature Set for the M510DC. Introduction. TN-FD-33: M510DC SSD SMART Implementation. Introduction

Technical Note. ONFI 4.0 Design Guide. Introduction. TN-29-83: ONFI 4.0 Design Guide. Introduction

Technical Note. Micron N25Q to Micron MT25Q Migration. Introduction. TN-25-01: Micron N25Q to Micron MT25Q Migration. Introduction

COMMUNICATIONS PROTOCOL WAYNE MILLER ASSOCIATES SERIAL/PARALLEL INTERFACE MODEL WMA-039

One 32-bit counter that can be free running or generate periodic interrupts

C Routines for Setting Up the AIC on the TMS320C5x EVM

Technical Note. SMART Command Feature Set for the Introduction. TN-FD-34: 5100 SSD SMART Implementation. Introduction

Writing to Internal Flash in PSoC 3 and PSoC 5

Chapter 8: Intraprogram Communication. Lecture 8 1

Technical Note. Client SATA SSD SMART Attribute Reference. Introduction. TN-FD-22: Client SATA SSD SMART Attribute Reference.

S1C17 Family EEPROM Emulation Library Manual

Technical Note. Maximize SPI Flash Memory Design Flexibility With a Single Package. Introduction

PARAMETER SYMBOL MIN MAX Address Access Time

ENERGY 211 / CME 211. Functions

Enhanced Serial Peripheral Interface (espi)

Technical Note Designing for High-Density DDR2 Memory

EZ I 2 C Slave. Features. General Description. When to use a EZ I 2 C Slave 1.50

Variables Data types Variable I/O. C introduction. Variables. Variables 1 / 14

Use the Status Register when the firmware needs to query the state of internal digital signals.

Nios DMA. General Description. Functional Description

Programmable Threshold Comparator Data Sheet

For one or more fully configured, functional example projects that use this user module go to

Using HAL Device Drivers with the Altera Monitor Program. 1 Introduction. For Quartus II 13.1

CY7C603xx CYWUSB

Technical Note. Booting from Embedded MMC (e.mmc) Introduction. TN-FC-06: Booting from Embedded MMC. Introduction

AN022: The Bootloader Protocol

AN LPC1700 secondary USB bootloader. Document information. LPC1700, Secondary USB Bootloader, ISP, IAP

Common Flash Interface (CFI) and Command Sets

SEMICONDUCTOR PRODUCT INFORMATION

Parallel NOR Flash Embedded Memory

DYNAMIC ENGINEERING 150 DuBois, Suite C Santa Cruz, CA (831) Fax (831) Est

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

This optional pin is present if the Mode parameter is set to SyncMode or PulseMode. Otherwise, the clock input does not show.

PulseBlaster PCI Board Rev. 02 Owner s Manual Models: PB12-50, PB12-100, PB k SpinCore Technologies, Inc.

AN10428 UART-SPI Gateway for Philips SPI slave bridges

Product Brief LPDDR2-PCM and Mobile LPDDR2 121-Ball MCP

LogiCORE IP 3GPP LTE Turbo Encoder v1.0 Bit-Accurate C Model. 3GPP LTE Turbo. [optional] UG490 (v1.0) April 25, 2008 [optional]

MPLAB C1X Quick Reference Card

Programmable Gain Amplifier Datasheet PGA V 3.2. Features and Overview

AN4491 Application note

Use the Status Register when the firmware needs to query the state of internal digital signals.

STM8 I 2 C optimized examples

A Fast Review of C Essentials Part I

Fair Isaac Product Name User s Guide ENHANCEMENT NOTIFICATION Fair Isaac LenStar. Security Requirements

LPF (Optional) CY8C24x93. Without LPF and ISR to 3* With LPF only** to 3* With ISR only to 3*

Using LPC11Axx EEPROM (with IAP)

Practical Hardware Debugging: Quick Notes On How to Simulate Altera s Nios II Multiprocessor Systems Using Mentor Graphics ModelSim

Kinetis Flash Tool User's Guide

Firmware Flash Upgrade Wizard. User Manual

80C186XL/80C188XL EMBEDDED MICROPROCESSORS SPECIFICATION UPDATE

DM3 Standard Component Interface Messages

ESP8266 Application Note Firmware Download Protocol

APPLICATION NOTE. Atmel AT03261: SAM D20 System Interrupt Driver (SYSTEM INTERRUPT) SAM D20 System Interrupt Driver (SYSTEM INTERRUPT)

AN2659 Application note

Linear Encoder Parameter setting

Transcription:

Technical Note J3F 32Mb, 64Mb, 256Mb Parallel NOR Flash Memory Software Device Drivers TN-12-50: J3F Software Device Drivers Introduction Introduction This technical note provides a description of the library source code in C for the specified Parallel NOR Flash device. The c2105.c and c2105.h files contain libraries for accessing the device. This technical note does not duplicate or replace information from the specified Parallel NOR Flash data sheet. It refers to the data sheets throughout. It is necessary to have a copy of the appropriate data sheet to understand explanations. This technical note provides information for modifying the accompanying source code. The source code is written to be as platform-independent as possible, and requires some changes by the user to compile and run. The technical note also explains how the source code should be modified for individual target hardware. The source code contains comments throughout, explaining its use and the intent of its design. The software supplied with this documentation has been tested on a target platform and can be used in C and C++ environments. It is small in size and can be applied to any target hardware. 1 Products and specifications discussed herein are for evaluation and reference purposes only and are subject to change by Micron without notice. Products are only warranted by Micron to meet Micron's production data sheet specifications. All information discussed herein is provided on an "as is" basis, without warranties of any kind.

Using the Software Driver TN-12-50: J3F Software Device Drivers Using the Software Driver The low-level functions (drivers) described in this technical note are provided to simplify developing C application code for the device. The drivers enable developers to focus on writing the high-level functions required for their particular applications. The highlevel functions access the device by calling the drivers that handle low-level command sequences. Thus, developer source code is both simpler and easier to maintain. Note: To meet compatibility requirements, the software device driver numbers each block in a device starting from 0 (block 0 always has address offset 0) up to the highest address block number in the device. Block numbers may be described differently in the data sheets. For example, in a Flash device containing 64 blocks, it will always refer to the block with address offset 0 as block number 0, and to the last block as block number 63. Code developed using the provided drivers can be divided into three layers: Hardware-specific bus operations: Developer's applications are dependent on the microprocessor on which the code runs and where the device is mapped in the microprocessor's address space. In addition, code must be written according to the hardware platform. Low-level driver code: Drivers issue the correct sequences of WRITE operations for each command and interpret information received from the device during PROGRAM and ERASE operations. They also encode all details on how commands are issued to the device and how to interpret the device status register bits. High-level code: High level functions written by developers access the device by calling the drivers. Developers should proceed as follows when developing an application: Write a simple program to test the low level drivers and verify that they operate as expected on the target hardware and software environments. Write the application high-level code, which accesses the Flash device by calling the low level drivers. Test the completed application source code thoroughly. 2

Porting the Driver (User Change Area) Porting the Driver (User Change Area) Basic Data Types All of the changes to the software driver can be found in the header file. The designated area (called "the user change area") contains the items described in the following sections, which are required to port the software driver to new hardware. Check whether the compiler to be used supports the following basic data types, as described in the source code, and change it where necessary. Table 1: Basic Data Typedefs Device Type Flash Memory Location Flash Configuration Timeout typedef unsigned char UINT8; (8 bits) typedef char SINT8; (8 bits) typedef unsigned short UINT16; (16 bits) typedef short SINT16; (16 bits) typedef unsigned int UINT32; (32 bits) typedef int SINT32; (32 bits) Use the appropriate define statement to choose the correct device. #define PC28F256J3F95 #define PC28F320J3F75 #define PC28F640J3F75 BASE_ADDR is the start address of the device. It must be set according to the target system, in order to access the device at the correct address. This value is used by the functions FlashRead() and FlashWrite(). The default value is set to 0, and must be adjusted appropriately. #define BASE_ADDR ((volatile ucpubustype*)0x00000000) Choose the correct device configuration. #define USE_16BIT_CPU_ACCESSING_1_16BIT_FLASH Timeouts are implemented in code loops to provide an exit to operations that otherwise would never terminate. There are two possibilities: The ANSI library functions declared in time.h exist. If the current compiler supports time.h, the define statement TIME_H_EXISTS should be activated. This prevents any change in timeout settings due to the performance of the current evaluation hardware. #define TIME_H_EXISTS 3

Porting the Driver (User Change Area) Additional Subroutines Additional Considerations The option COUNT_FOR_A_SECOND. If the current compiler does not support time.h, the define statement TIME_H_EXISTS cannot be used. In this case, the COUNT_FOR_A_SECOND value must be defined so as to create a 1-second delay. For example, if 100,000 repetitions of a loop are needed to give a time delay of 1 second, then COUNT_FOR_A_SECOND should have the value 100,000. #define COUNT_FOR_A_SECOND (chosen value) Note: This delay depends on the hardware performance, and therefore should be updated each time the hardware is changed. This driver has been tested with a specific configuration and other target platforms may have other performance data. It may be necessary to change the COUNT_FOR_A_SEC- OND value. It is up to the user to implement the correct value to prevent the code from timing out too early and enable correct completion. In accordance to the corresponding data sheet, a suitable timeout value is configured in each function where required. #define VERBOSE In the software driver, the define VERBOSE statement is used to activate the Flash- ErrStr() function in order to generate a text string describing the return code from the device. The access timing data can sometimes be problematic. Therefore, in certain cases it may be necessary to change the functions FlashRead() and FlashWrite() when they are not compatible with the timing of the target hardware. These problems can be solved with a logic analyzer. The FlashRead() and FlashWrite() function examples provided in the source code should give the user a good idea of what is required and can be used in many instances with little modification. The programmer needs to take extra care when the device is accessed during an interrupt service routine. When the device is in read mode, interrupts can freely read from the device. Interrupts that do not access the device may be used during all functions. 4

C Library Functions Table 2: Function Names and Descriptions TN-12-50: J3F Software Device Drivers C Library Functions The table below provides the user with source code for the following functions. Function Flash() FlashBlockErase() FlashBlockLock() FlashBlockUnlock() FlashCheckBlockProtection() FlashCheckCompatibility() FlashChipErase() FlashChipUnprotect() FlashClearStatusRegister() FlashErrorStr() FlashProgram() FlashProtectionRegisterProgram() FlashReadCfi() FlashReadDeviceId() FlashReadManufacturerCode() FlashReadProtectionRegister() FlashReadProtectRegisterProgram() FlashReset() FlashSingleProgram() Description Accesses all device functions and acts as the main device interface. Available on all software drivers written in the driver format and should be used exclusively. Any functionality unsupported by the device can be detected and malfunctions can thus be avoided. The other functions are listed to offer a second-level interface when enhanced performance is required. Within the device driver, the functions are always used in the same way, and the function interface (names, return codes, parameters, and data types) remains unchanged, regardless of the device. Erases a block in the device. A block cannot be erased when it is locked or V PP is invalid (lower than V PPLK ). Attempting to do so generates an error. Locks (protects) a block in the device. Once locked (protected), the data in the block cannot be programmed or erased until the block is unlocked (unprotected). Unlocks a block in the device. Once the block is unlocked, the data it contains can be erased or new data can be programmed to it. Checks whether a block is locked. Checks the device for compatibility. Erases the entire device. Locked blocks will not be erased. The device cannot be erased when V PP is invalid (lower than V PPLK ). Attempting to do so generates an error. Unlocks all blocks in the device. Once all the blocks are unlocked, the data contained in all the blocks can be entirely erased or new data can be programmed. Clears the status register. Generates a text string describing the detected error. Programs data arrays to the device. Only previously erased elements can be programmed reliably. Locked blocks cannot be programmed, and PROGRAM operations cannot be performed when V PP is invalid. Programs the protection register. Checks whether if the CFI is supported and then read the CFI data at the specified offset. Reads the device codes. Reads the manufacturer codes. Reads a location in the protection register. Reads the status register. Resets the device to read array mode. All the other software library functions leave the device in this mode under normal operation; therefore, function does not need to be called out. Programs a single element. 5

C Library Functions Table 2: Function Names and Descriptions (Continued) Function FlashRead() FlashWrite() Description Reads a value from the device. Writes a value to the device. 6

Sample Code Sample Code The following sample code includes a main() function from which all Flash memory functions can be called and tested. Typical sample code begins by reading from the device; if the device is erased, FFFFh data should be output. Other device tests shown here include reading device ID information (device code, manufacturer code) to ensure it is correct and performing a BlockErase command. All other device functions should also be tested. Table 3: Quick Device Test Sample Code #include "c2105.h" void main(void) { ParameterType flashpara; /* parameters used for all operations */ ReturnType retval; /* return Type enum */ Flash(ReadManufacturerCode, &flashpara); printf ("Manufacturer Code: %08xh/r/n", flashpara.readmanufacturercode.ucmanufacturercode); Flash(ReadDeviceID, &flashpara); printf ("Device Code: %08xh/r/n", flashpara.readdeviceid.ucdeviceid); flashpara.blockerase.ublblocknr = 10; /* designates block 10 to be erased */ rretval = Flash(BlockErase, &flashpara); /* function executed; block 10 erased */ } /* End function Main */ 7

Software Limitations TN-12-50: J3F Software Device Drivers Software Limitations The software described in this document does not implement all functionality of the device. When an error occurs, the software simply returns the error message. When this happens, the user can either try the command again or replace the device if necessary. Conclusion Parallel NOR Flash devices are ideal products for embedded and other computer systems. They can be easily interfaced to microprocessors and driven with simple software drivers written in the C language. Applications supporting the Flash device driver standard can implement any Flash device with the same interface without any code change. Recompiling with a new software driver is all that is needed to control a new device. The device driver interface enables changeable configurations, compiler-independent data types, and a unique access mode for a broad range of Flash devices. 8

Revision History Revision History Rev. A 01/13 Initial release 8000 S. Federal Way, P.O. Box 6, Boise, ID 83707-0006, Tel: 208-368-3900 www.micron.com/productsupport Customer Comment Line: 800-932-4992 Micron and the Micron logo are trademarks of Micron Technology, Inc. All other trademarks are the property of their respective owners. 9