⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tep128.txt

📁 tinyos-2.x.rar
💻 TXT
📖 第 1 页 / 共 2 页
字号:
    command error_t erase(uint16_t eraseUnitIndex);
    
    command error_t flush();
    
    command error_t crc(uint32_t addr, uint32_t len, uint16_t baseCrc);
    
    
  
    event void readDone(uint32_t addr, void *buf, uint32_t len, error_t error);
    
    event void writeDone(uint32_t addr, void *buf, uint32_t len, error_t error);  
    
    event void eraseDone(uint16_t eraseUnitIndex, error_t error);
    
    event void flushDone(error_t error);
    
    event void crcDone(uint16_t calculatedCrc, uint32_t addr, uint32_t len, error_t error);
  
  }


``read(uint32_t addr, void '*buf', uint32_t len);``
 - Read 'len' bytes into ``*buf`` from the given address
 - Returns FAIL if the volume is already in use
 - Signals readDone(...) when complete.

``write(uint32_t addr, void '*buf', uint32_t len);``
 - Write 'len' bytes from ``*buf`` starting at the given address
 - Returns FAIL if the volume is already in use
 - Signals writeDone(...) when complete.

``erase(uint16_t eraseUnitIndex);``
 - Erase a single 0-indexed erase unit
 - Returns FAIL if the volume is already in use
 - Signals eraseDone(...) when complete.

flush()
 - All data that has been previously written and is not yet located on 
   non-volatile memory should be immediately stored to non-volatile memory.
 - Returns FAIL if the operation cannot be completed at this time
 - Signals flushDone(...) when complete.

crc(uint32_t addr, uint32_t len, uint16_t baseCrc);
 - Calculate the CRC of 'len' bytes starting at the given address, using
   the given baseCrc as a seed.
 - Returns FAIL if the volume is already in use
 - Signals crcDone(...) when complete.


3.3 DirectModify Interface
--------------------------------------------------------------------
Some memory types have the ability to modify their contents without
destroying surrounding data.  

The AT45DB NOR-flash, for example, is able to do this because 
it has built in RAM buffers coupled with small erase unit sizes. 
The physical RAM buffers perform a read-modify-write operation to 
effectively change the contents of flash, allowing it to emulate
the behavior of an EEPROM with the speed and efficiency of NOR-flash.

The ATmega128 microcontroller has 4kB of internal EEPROM memory which 
can be directly modified.  Also, the MSP430 has 256 bytes of internal
NOR-flash memory which is divided into two segments of 128 bytes each.  
When implemented properly, this NOR-flash memory can be modified in a 
fault-tolerant manner. 

The ST M25P80 NOR-flash cannot support modification without sacrificing 
significant overhead.  It has 16 erase units that are 64kB each,
which is too large to effectively modify bytes.

While not all memories support modification, a unified interface
should exist to interact with memories that do.  This interface
should be access with the understanding that applications built
on top may not be portable to all memory types. Also, DirectStorage 
and DirectModify are mounted to their own individual volumes, so 
DirectModify cannot share its allocated memory resources with 
a DirectStorage interface:::


  interface DirectModify {
  
    command error_t modify(uint32_t addr, void *buf, uint32_t len);
  
    command error_t read(uint32_t addr, void *buf, uint32_t len);
  
    command error_t erase(uint16_t eraseUnitIndex);
  
    command error_t flush();
  
    command error_t crc(uint32_t addr, uint32_t len, uint16_t baseCrc);
  
    command bool isSupported();
    
    
    event void modified(uint32_t addr, void *buf, uint32_t len, error_t error);
  
    event void readDone(uint32_t addr, void *buf, uint32_t len, error_t error);
    
    event void eraseDone(uint16_t eraseUnitIndex, error_t error);
    
    event void flushDone(error_t error);
    
    event void crcDone(uint16_t calculatedCrc, uint32_t addr, uint32_t len, error_t error);
    
  }


``modify(uint32_t addr, void *buf, uint32_t len)``
 - Modify 'len' bytes located on non-volatile memory at the given address,
   replacing them with data from the given buffer
 - Returns FAIL if the volume is already in use
 - Signals modified(...) when the operation is complete

``read(uint32_t addr, void *buf, uint32_t len)``
 - Read 'len' bytes into ``*buf`` from the given address
 - Same as DirectStorage.read(...)
 - Returns FAIL if the volume is already in use
 - Signals readDone(...) when complete.

``erase(uint16_t eraseUnitIndex);``
 - Erase a single 0-indexed erase unit
 - Returns FAIL if the volume is already in use
 - Signals eraseDone(...) when complete.

``flush()``
 - All data that has been previously written and is not yet located on 
   non-volatile memory should be immediately stored to non-volatile memory.
 - Same behavior as flush() methods found in Java
 - Returns FAIL if the operation cannot be completed at this time
 - Signals flushDone(...) when complete.

``crc(uint32_t addr, uint32_t len, uint16_t baseCrc);``
 - Calculate the CRC of 'len' bytes starting at the given address, using
   the given baseCrc as a seed.
 - Returns FAIL if the volume is already in use
 - Signals crcDone(...) when complete.

``isSupported()``
 - Returns TRUE if DirectModify is available on the current memory type



3.4 VolumeSettings Interface
--------------------------------------------------------------------
As was shown in Section 1.1, finding information about the current
volume required platform-dependent methods of access.  VolumeSettings
provides a unified method of accessing information about the underlying 
memory chip and volume settings.  

VolumeSettings MUST be implemented separately for DirectStorage and
DirectModify, not only because those abstractions will exist on
separate volumes, but also because the DirectModify interface may 
change the available size of the volume to support certain memory 
types such as NAND- and NOR-flash:::


  interface VolumeSettings {

    command uint32_t getVolumeSize();

    command uint32_t getTotalEraseUnits();
  
    command uint32_t getEraseUnitSize();
  
    command uint32_t getTotalWriteUnits();

    command uint32_t getWriteUnitSize();
  
    command uint8_t getFillByte();

    command uint8_t getEraseUnitSizeLog2();
  
    command uint8_t getWriteUnitSizeLog2();

  }


getVolumeSize()
  - Returns the size of the volume the DirectStorage layer 
    is mounted to, in bytes

getTotalEraseUnits()
  - Returns the total number of erase units on the mounted volume

getEraseUnitSize()
  - Returns the size of an individual erase unit, in bytes

getTotalWriteUnits()
  - Returns the total number of write units on the mounted volume

getWriteUnitSize()
  - Returns the size of an individual write unit, in bytes

getFillByte()
  - Returns the default byte value found on the memory after an erase,
    which is typically 0xFF

getEraseUnitSizeLog2()
  - Returns the size of an erase unit in Log2 format for ease of
    calculations

getWriteUnitSizeLog2()
  - Returns the size of a write unit in Log2 format for ease of
    calculations

  

4. Author's Address
====================================================================

| David Moss
| Rincon Research Corporation
| 101 N. Wilmot, Suite 101
| Tucson, AZ  85750
|
| phone - +1 520 519 3138
| phone - +1 520 519 3146
| email ? dmm@rincon.com
|
| Junzhao Du
| Contact -
|
| Prabal Dutta
| Contact -
| 
| Deepak Ganesan
| Contact -
| 
| Kevin Klues 
| Contact -
| 
| Manju
| Contact -
|
| Ajay Martin
| Contact -
|
| Gaurav Mathur
| Contact -


5. Citations
====================================================================
.. [1] TEP 103: Permanent Data Storage (Flash). http://tinyos.cvs.sourceforge.net/*checkout*/tinyos/tinyos-2.x/doc/html/tep103.html
.. [2] Atmel AT45DB041B datasheet. http://www.atmel.com/dyn/resources/prod_documents/DOC1432.PDF
.. [3] ST M25P80 datasheet. http://www.st.com/stonline/products/literature/ds/8495/m25p80.pdf
.. [4] K9K1G08R0B datasheet. http://www.samsung.com/Products/Semiconductor/NANDFlash/SLC_SmallBlock/1Gbit/K9K1G08R0B/ds_k9k1g08x0b_rev10.pdf

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -