winIDEA SDK
isys::CStorageDeviceController Class Referenceabstract

Description

This class presents a common API for all storage devices.

#include <CStorageDeviceController.h>

Public Member Functions

virtual void read (ADDRESS_64 address, ADDRESS_64 size, std::vector< BYTE > &data)=0
 Reads data from device. More...
 
virtual void write (IConnectUMI::EOperationFlags programMode)=0
 Writes contents of pre-configured files to device. More...
 
virtual void write (IConnectUMI::EOperationFlags programMode, DWORD fileFormat, ADDRESS_64 offset, const std::string &fileName)=0
 Writes contents of file to device. More...
 
virtual void write (IConnectUMI::EOperationFlags programMode, ADDRESS_64 address, ADDRESS_64 size, std::vector< BYTE > &data)=0
 Writes data to device. More...
 
virtual void erase (IConnectUMI::EOperationFlags programMode)=0
 Erases complete device. More...
 
virtual void erase (IConnectUMI::EOperationFlags programMode, ADDRESS_64 address, ADDRESS_64 size)=0
 Erases the specified region (sector, partition,...). More...
 
virtual void flush ()=0
 Programs the device from the intermediate cache. More...
 
virtual void verify ()=0
 Compares device contents to cache. More...
 
virtual void verify (ADDRESS_64 address, ADDRESS_64 size)=0
 Compares device contents to cache. More...
 
virtual bool isDeviceEmpty ()=0
 Compares device contents to the empty value. More...
 
virtual bool isDeviceEmpty (ADDRESS_64 address, ADDRESS_64 size)=0
 Compares device contents to the empty value at given address. More...
 
virtual void fill ()=0
 Fills device with preconfigured value. More...
 
virtual void readState (IConnectUMI::EOperationFlags programMode, ADDRESS_64 address, ADDRESS_64 size, std::vector< BYTE > &stateResult)=0
 Reads the device program state. More...
 
virtual void readHash (std::vector< BYTE > &hashResult)=0
 Reads target device data MURMUR2 hash. More...
 
virtual void readHash (IConnectUMI::EOperationFlags programMode, ADDRESS_64 address, ADDRESS_64 size, std::vector< BYTE > &hashResult)=0
 Reads target device data MURMUR2 hash. More...
 
virtual std::string getLastError ()=0
 This function returns error description, after call fails. More...
 
virtual isys::CSecurityStorageDeviceModuleSPtr getSecurityModule ()=0
 Returns security storage device module. More...
 
virtual isys::CPartitionConfigurationModuleSPtr getPartitionConfigurationModule ()=0
 Returns configuration module for partition based devices. More...
 

Member Function Documentation

◆ erase() [1/2]

virtual void isys::CStorageDeviceController::erase ( IConnectUMI::EOperationFlags  programMode)
pure virtual

Erases complete device.

Parameters
programModeshould be either IConnectUMI::wProgDevice or IConnectUMI::wProgCache.

Python example: test_storage_erase.py
Python example: test_storage_emmc_erase.py

◆ erase() [2/2]

virtual void isys::CStorageDeviceController::erase ( IConnectUMI::EOperationFlags  programMode,
ADDRESS_64  address,
ADDRESS_64  size 
)
pure virtual

Erases the specified region (sector, partition,...).

Parameters
programModeshould be either IConnectUMI::wProgDevice or IConnectUMI::wProgCache.
addressaddress to erase from
sizesize of the data to be erased

Python example: test_storage_erase.py
Python example: test_storage_emmc_erase.py

◆ fill()

virtual void isys::CStorageDeviceController::fill ( )
pure virtual

Fills device with preconfigured value.

Exceptions
CUMIExceptionif device is not empty
IllegalStateExceptionif operation not supported.

Python example: test_storage_fill.py

◆ flush()

virtual void isys::CStorageDeviceController::flush ( )
pure virtual

Programs the device from the intermediate cache.

Exceptions
IllegalStateExceptionif operation not supported.

Python example: test_storage_flush.py

◆ getLastError()

virtual std::string isys::CStorageDeviceController::getLastError ( )
pure virtual

This function returns error description, after call fails.

If there is no error message available, an empty string is returned.

Returns
error description string

Python example: test_storage_get_last_error.py

◆ getPartitionConfigurationModule()

virtual isys::CPartitionConfigurationModuleSPtr isys::CStorageDeviceController::getPartitionConfigurationModule ( )
pure virtual

Returns configuration module for partition based devices.

Returns
configuration module for partition based devices if available, otherwise return nullptr

Python example: test_storage_get_partition_info.py

◆ getSecurityModule()

virtual isys::CSecurityStorageDeviceModuleSPtr isys::CStorageDeviceController::getSecurityModule ( )
pure virtual

Returns security storage device module.

Returns
security storage device module if available, otherwise return nullptr

◆ isDeviceEmpty() [1/2]

virtual bool isys::CStorageDeviceController::isDeviceEmpty ( )
pure virtual

Compares device contents to the empty value.

Returns
true if the device is empty, false otherwise
Exceptions
IllegalStateExceptionif operation not supported.

Python example: test_storage_is_device_empty.py
Python example: test_storage_emmc_is_device_empty.py

◆ isDeviceEmpty() [2/2]

virtual bool isys::CStorageDeviceController::isDeviceEmpty ( ADDRESS_64  address,
ADDRESS_64  size 
)
pure virtual

Compares device contents to the empty value at given address.

Parameters
addressaddress to verify from
sizesize of the data to be verified
Returns
true if the device is empty, false otherwise
Exceptions
IllegalStateExceptionif operation not supported.

Python example: test_storage_is_device_empty.py
Python example: test_storage_emmc_is_device_empty.py

◆ read()

virtual void isys::CStorageDeviceController::read ( ADDRESS_64  address,
ADDRESS_64  size,
std::vector< BYTE > &  data 
)
pure virtual

Reads data from device.

Parameters
addressaddress to read from
sizesize of the data to read
datavector to contain read data on return

Python example: test_storage_read.py
Python example: test_storage_emmc_read.py

◆ readHash() [1/2]

virtual void isys::CStorageDeviceController::readHash ( IConnectUMI::EOperationFlags  programMode,
ADDRESS_64  address,
ADDRESS_64  size,
std::vector< BYTE > &  hashResult 
)
pure virtual

Reads target device data MURMUR2 hash.

Parameters
programModeshould be either IConnectUMI::wProgDevice or IConnectUMI::wProgCache.
addressstarting address for hash calculation
sizesize of the data to be hashed
hashResultHash result as vector of bytes. LSB is returned first. Vector capacity should be at least 4 bytes, since hash is 4-bytes long.
Exceptions
IllegalStateExceptionif operation not supported.

Python example: test_storage_read_hash.py

◆ readHash() [2/2]

virtual void isys::CStorageDeviceController::readHash ( std::vector< BYTE > &  hashResult)
pure virtual

Reads target device data MURMUR2 hash.

Parameters
hashResultHash result as vector of bytes. LSB is returned first. Vector capacity should be at least 4 BYTES.
Exceptions
IllegalStateExceptionif operation not supported.

Python example: test_storage_read_hash.py

◆ readState()

virtual void isys::CStorageDeviceController::readState ( IConnectUMI::EOperationFlags  programMode,
ADDRESS_64  address,
ADDRESS_64  size,
std::vector< BYTE > &  stateResult 
)
pure virtual

Reads the device program state.

Parameters
programModeshould be either IConnectUMI::wProgDevice or IConnectUMI::wProgCache.
addressstarting address
sizesize of the data to be examined
stateResultProgram state as vector of bytes, returned as an unpacked byte array (1 MAU per byte). Vector size must be the size of the data to be examined. Value equals to 1 if MAU programmed and 0 if not.
Exceptions
IllegalStateExceptionif operation not supported.

Python example: test_storage_read_state.py

◆ verify() [1/2]

virtual void isys::CStorageDeviceController::verify ( )
pure virtual

Compares device contents to cache.

Throws CUMIException in case of verification error (contents do not match), throws IOException in case of any other isystem.connect error.

Exceptions
IllegalStateExceptionif operation not supported.

Python example: test_storage_verify.py

◆ verify() [2/2]

virtual void isys::CStorageDeviceController::verify ( ADDRESS_64  address,
ADDRESS_64  size 
)
pure virtual

Compares device contents to cache.

Throws CUMIException in case of verification error (contents do not match), throws IOException in case of any other isystem.connect error.

Parameters
addressaddress to verify from
sizesize of the data to be verified
Exceptions
IllegalStateExceptionif operation not supported.

Python example: test_storage_verify.py

◆ write() [1/3]

virtual void isys::CStorageDeviceController::write ( IConnectUMI::EOperationFlags  programMode)
pure virtual

Writes contents of pre-configured files to device.

Parameters
programModeshould be either IConnectUMI::wProgDevice or IConnectUMI::wProgCache. For eMMC devices IConnectUMI::wProgDevice is always used.
Exceptions
IllegalStateExceptionif operation not supported.

Python example: test_storage_write.py
Python example: test_storage_emmc_read_write.py

◆ write() [2/3]

virtual void isys::CStorageDeviceController::write ( IConnectUMI::EOperationFlags  programMode,
ADDRESS_64  address,
ADDRESS_64  size,
std::vector< BYTE > &  data 
)
pure virtual

Writes data to device.

Parameters
programModeshould be either IConnectUMI::wProgDevice or IConnectUMI::wProgCache. For eMMC devices IConnectUMI::wProgDevice is always used.
addressaddress to write to
sizesize of the data to write
datavector of data to be written

Python example: test_storage_write.py
Python example: test_storage_emmc_read_write.py

◆ write() [3/3]

virtual void isys::CStorageDeviceController::write ( IConnectUMI::EOperationFlags  programMode,
DWORD  fileFormat,
ADDRESS_64  offset,
const std::string &  fileName 
)
pure virtual

Writes contents of file to device.

Parameters
programModeshould be either IConnectUMI::wProgDevice or IConnectUMI::wProgCache. For eMMC devices IConnectUMI::wProgDevice is always used.
fileFormatshould be one of wFile... flags from IConnectUMI::EOperationFlags, for example IConnectUMI::wFileFormatAuto, IConnectUMI::wFileFormatBin, IConnectUMI::wFileFormatS, IConnectUMI::wFileFormatHex.
offsetoffset to add to the address in the file
fileNamepath to the file to program

Python example: test_storage_write.py
Python example: test_storage_emmc_read_write.py