import DUT
mcu0 = DUT(mcu=0)
# Your DUT my be a multi-mcu architecture
# in which case you'll need more than 1 debug probe.
mcu1 = DUT(mcu=1)
# Halt your device
mcu0.reset(halt=True)
# Erase your device
# 64k flash, start address 0x08000000
mcu0.erase(address=0x08000000, length=65536)
# Flash Your Device Under Device
mcu0.flash("path/to/my/image/my_image.hex", type=DUT.ihex)
# Or maybe you'd prefer to use a binary file
mcu0.flash("path/to/my/image/my_image.bin", type=DUT.bin, address=0x8000000)
# Start running the new code
mcu0.run()