Flash
Flash allows you to write to your DUT's internal or XIP external flash using either a hex or binary <https://en.wikipedia.org/wiki/Binary_file> image.
Hex Image
flash_hex_image.py
from lager import DUT, ImageType
mcu0 = DUT(mcu=0)
# Flash Your Device Under Device
mcu0.flash("path/to/my/image/my_image.hex", file_type=ImageType.IHEX)
Flash Hex Image
~ lager debug flash --hexfile my_image.hex --dut 1
Binary Image
Unlike with hex images that has flash address data embedded in the file format, binary images need to be combined with a start address when used.
flash_binary_image.py
from lager import DUT, ImageType
mcu0 = DUT(mcu=0)
# Flash Your Device Under Device
mcu0.flash("path/to/my/image/my_image.bin", file_type=ImageType.BIN, addr=0x80000000)
Flash Binary Image
~ lager debug flash --binfile my_image.bin,0x80000000 --dut 1