Skip to main content

spiflash.readintoblob(address, targetBlob, numberOfBytes)

Copies data from the SPI flash storage into a pre-existing blob

Availability

Device (from impOS™ 30)

Parameters

Name Type Description
address Integer Address from which to copy the data
targetBlob Blob The blob into which to copy the bytes
numberOfBytes Integer The number of bytes to copy

Returns

Nothing

Description

This method reads the specified number of bytes, starting at the given address given, and writes them into the blob passed as the method’s second parameter. The bytes will be written at the current location of the blob’s read/write pointer, which can be determined with the blob.tell() method and set with the blob.seek() method.

Contrast this method with spiflash.read(), which performs the same task but returns the bytes read from the SPI flash as a new blob object.

Example Code

Build up a pre-existing blob from SPI flash