Low Level Access Of Flash Memory And Nor Memory Vs Nand Memory
4. Low-Level Access
Low-level access to a physical flash memory by device driver software is different from accessing common memories. Whereas a common RAM will simply respond to read and write operations by returning the contents or altering them immediately, flash memories need special considerations, especially when used as program memory to a read-only memory (ROM).
While reading data can be performed on individual addresses on NOR memories (not on NAND memories) unlocking (making available for erase or write), erasing and writing operations are performed block-wise on all flash memories. A typical block size will be 64, 128, or 256 KiB.
4.1 NOR Memories
The read-only mode of NOR memories is similar to reading from a common memory, provided address and data bus is mapped correctly, so NOR flash memory is much like any address-mapped memory. NOR flash memories can be used as execute-in-place memory, meaning it behaves as a ROM memory mapped to a certain address.
When unlocking, erasing or writing NOR memories, special commands are written to the first page of the mapped memory. These commands are defined as the common flash interface (defined by Intel) and the flash circuit will provide a list of all available commands to the physical driver.
Apart from being used as a ROM, the NOR memories can of course also be partitioned with a file system and used as any storage device.
4.2 NAND Memories
NAND flash memories cannot provide execute-in-place due to their different construction principles. These memories are accessed much like block devices such as hard disks or memory cards. When executing software from NAND memories, virtual memory strategies are used: memory contents must first be paged into memory-mapped RAM and executed there, making the presence of a memory management unit (MMU) on the system absolutely necessary.