Real-time and Embedded Systems Design Lecture 9

946 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
946
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
25
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Real-time and Embedded Systems Design Lecture 9

  1. 1. Embedded Real-Time Systems Design Selecting memory
  2. 2. Memory for embedded systems <ul><li>Embedded systems have different memory requirements </li></ul><ul><ul><li>System frequently don’t have hard disk </li></ul></ul><ul><ul><ul><li>No ability to swap </li></ul></ul></ul><ul><ul><li>They run unattended </li></ul></ul><ul><ul><li>May required unattended boot </li></ul></ul><ul><ul><li>Won’t do normal system logging </li></ul></ul><ul><ul><li>Power down reliability </li></ul></ul>
  3. 3. Memory options Negative Positive Type Wears out! High Density High Speed FLASH Volatile High Speed Low cost DRAM Dynamic Random Access Memory Low density Volatile Highest Speed SRAM Static Random Access Memory High cost Low density Easier to erase than EPROM EEPROM Electrically Erasable PROM Difficult to write to High Density Low Cost EPROM Electrically Programmable ROM Can’t write to High Density Low cost ROM Read Only Memory
  4. 4. Why Flash? EPROM E 2 PROM ROM DRAM FLASH Updateable Nonvolatile High Density
  5. 5. Why Flash Memory? <ul><li>Flash has characteristics of both ROM and RAM </li></ul><ul><ul><li>It is non-volatile </li></ul></ul><ul><ul><li>Can be written to </li></ul></ul><ul><ul><li>Has high read access speeds </li></ul></ul><ul><ul><li>It is reliable </li></ul></ul>
  6. 6. What is Flash memory? <ul><li>Flash covers a wide range of different memory technologies and Architectures </li></ul><ul><ul><li>DOC (Disc On Chip) system – also known as NAND flash </li></ul></ul><ul><ul><li>CFI (Common Flash Interface) – also known as NOR flash </li></ul></ul><ul><ul><li>JEDEC – an older standard, still used but becoming obsolete by CFI </li></ul></ul><ul><ul><li>Non-DOC Nand </li></ul></ul><ul><ul><li>Old non-CFI Flash </li></ul></ul>
  7. 7. Flash memory <ul><li>Flash memory, both nand and nor, work differently from other memory devices </li></ul><ul><li>In many ways they operate as block devices such as disk drives. </li></ul><ul><li>The devices are started as a whole series of 1 (empty) </li></ul><ul><li>Writing just means resetting the 1s to 0s where necessary </li></ul>
  8. 8. Flash memory <ul><li>Writing and erasure must be done in blocks </li></ul><ul><ul><li>Blocks can vary in size </li></ul></ul><ul><ul><li>Nor flash can set individual bits in a block </li></ul></ul><ul><ul><li>Nand can have pages in a block to change </li></ul></ul><ul><li>Whole blocks have to be erased before they can be written to </li></ul><ul><li>Blocks can be locked and unlocked </li></ul>
  9. 9. Common Flash Interface <ul><li>CFI or the Common Flash Interface was developed by Intel and AMD </li></ul><ul><li>The parameters for the flash are stored on chip in a common protocol </li></ul><ul><li>Software can query the devices </li></ul><ul><li>A number of levels of compliance </li></ul>
  10. 10. Flash Memory Maps <ul><li>As flash is block orientated it can be laid out in differing ways </li></ul><ul><ul><li>Boot flash </li></ul></ul><ul><ul><ul><li>With small (normally 8k byte) boot blocks at either top or bottom </li></ul></ul></ul><ul><ul><ul><li>Then 64k erase blocks </li></ul></ul></ul><ul><ul><li>Flash memory </li></ul></ul><ul><ul><ul><li>Arranged in erase blocks of 64 or 128k </li></ul></ul></ul>
  11. 11. Flash limitations <ul><li>Writing of data can only be done in blocks 9or pages on Nand flash) </li></ul><ul><li>Erasing and re-writing is slow </li></ul><ul><li>For DOC Nand pages can only be written a limited number of times (10) before block must be erased and re-written </li></ul><ul><li>There is a overall limitation on the number of writes – around 100,000 times </li></ul>
  12. 12. Flash file systems <ul><li>Flash devices have to have separate file systems and devices </li></ul><ul><li>On Linux this is the MTD (Memory Technology Device) interface </li></ul><ul><li>The file systems need special characteristics </li></ul><ul><li>Some devices require a translation layer for a file system to run – FTL (Flash Translation Layer) or NFTL (Nand FTL) </li></ul>
  13. 13. JFFS & JFFS2 <ul><li>The Journaling Flash File System is a popular choice for flash </li></ul><ul><ul><li>It maintains a log structure of the file system in Flash </li></ul></ul><ul><ul><li>Loads the file system in to ram a boot time </li></ul></ul><ul><ul><li>Does wear levelling – avoids problems of over-writing </li></ul></ul><ul><ul><li>Can’t do XIP (eXecute In Place) because of compression/decompression </li></ul></ul><ul><ul><li>Not for real-time – garbage collection </li></ul></ul>
  14. 14. CRAMFS <ul><li>CRAMFS (Compressed RAM File System) </li></ul><ul><li>Developed by Linux Torvalds </li></ul><ul><li>Compressed version of file system in flash run in ram </li></ul><ul><li>Can’t be written to – only remade off-line </li></ul><ul><li>Use tmpfs for volatile data </li></ul>

×