SDK docs menu

class

Image

One firmware image, or what one memory chip holds, for Board.start.

from hardlabs_sdk import Image
Image(path, address=None, part=None, payload=None)

A string does the same: Image("app.bin", 0x08010000) is "app.bin@0x08010000", and Image("config.bin", part="U7") is "config.bin@U7". Image.from_bytes takes the bytes themselves, for contents a test works out (settings, a calibration table).

Usage

from hardlabs_sdk import Image

board.start([Image("bootloader.bin", 0x08000000), Image("app.bin", 0x08010000),
             Image("config.bin", part="U7")])

Arguments

pathPath
The image file.
addressint | Nonedefault None
Where a raw .bin is flashed, as J-Link's loadbin takes it. None for ELF and Intel HEX files, which carry their own. With part, the offset within the chip (0 when None).
partstr | Nonedefault None
The memory chip the image is for, by reference designator ("U7") or slot. None for the processor's flash.
payloadbytes | Nonedefault None
The image's bytes when they come from from_bytes rather than a file.

Attributes

pathPath
The image file.
addressint | None
Where a raw .bin is flashed, as J-Link's loadbin takes it. None for ELF and Intel HEX files, which carry their own. With part, the offset within the chip (0 when None).
partstr | None
The memory chip the image is for, by reference designator ("U7") or slot. None for the processor's flash.
payloadbytes | None
The image's bytes when they come from from_bytes rather than a file.

Image.nameproperty

The file's name.

image.name -> str

Image.dataproperty

The image's bytes: the file's contents, or the bytes given to from_bytes.

image.data -> bytes

Image.offsetproperty

Where a memory chip's image goes within it.

image.offset -> int

Image.kindproperty

elf, hex or bin, from the contents and extension; memory for a memory chip's image.

image.kind -> str