Debugger

class DUT

Device Under Test

erase(self, *, start_addr=None, length=None)

Erase a region of flash

from lager import DUT

mcu0 = DUT(mcu=0)
mcu0.erase(start_addr=0x80000000, length=65536)
Parameters
  • start_addr (int) -- start address in flash

  • length (int) -- size of flash to erase

reset(self, halt=False)

Reset a device.

from lager import DUT

mcu0 = DUT(mcu=0)
mcu0.reset(halt=True)
Parameters

halt (bool) -- stop device after reset if true

flash(self, file_name, *, file_type, start_addr=None)

Flash a device.

from lager import DUT, ImageType

mcu0 = DUT(mcu=0)
mcu0.reset(halt=True)
# Flash Your Device Under Device
mcu0.flash("path/to/my/image/my_image.hex", file_type=ImageType.IHEX)
mcu0.flash("path/to/my/image/my_image.bin", file_type=ImageType.BIN, start_addr=0x80000000)
Parameters
  • file_name (str) -- path to image

  • file_type (ImageType) -- hex or binary file

  • start_addr (int) -- start address of binary image