Image

Image An Image consists of: an image type, a filename, and SIMG header info.
Image.render_to_simg Creates a SIMG file.
Image.size Return the full size of this image (as an SIMG)
Image.verify Returns true if the image is valid, false otherwise.
class Image(filename, image_type, simg=None, daddr=None, skip_crc32=False, version=None)[source]

An Image consists of: an image type, a filename, and SIMG header info.

>>> from cxmanage_api.image import Image
>>> img = Image(filename='spi_highbank.bin', image_type='PACAKGE')
Parameters:
  • filename (string) – Path to the image.
  • image_type (string) – Type of image. [CDB, BOOT_LOG, SOC_ELF]
  • simg (string) – Path to the simg file.
  • daddr (integer) – The daddr field in the SIMG Header.
  • skip_crc32 (boolean) – Flag to skip (or not) CRC32 checking.
  • version (string) – Image version.
Raises:
  • ValueError – If the image file does not exist.
  • InvalidImageError – If the file is NOT a valid image.
render_to_simg(priority, daddr)[source]

Creates a SIMG file.

>>> img.render_to_simg(priority=1, daddr=0)
>>> 'spi_highbank.bin'
Parameters:
  • priority (integer) – SIMG header priority value.
  • daddr (integer) – SIMG daddr field value.
Returns:

The file name of the image.

Return type:

string

Raises InvalidImageError:
 

If the SIMG image is not valid.

size()[source]

Return the full size of this image (as an SIMG)

>>> img.size()
2174976
Returns:The size of the image file in bytes.
Return type:integer
verify()[source]

Returns true if the image is valid, false otherwise.

>>> img.verify()
True
Returns:Whether or not the image file is valid.
Return type:boolean

Previous topic

Firmware_Package

Next topic

Tftp