Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions doc/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2551,6 +2551,9 @@ An :any:`IMXUSBDriver` is used to upload an image into a device in the *i.MX
USB loader state*.
This is useful to bootstrap a bootloader onto a device.
This driver uses the ``imx-usb-loader`` tool from barebox.
If your device has the ``SDP_READ_DISABLE`` fuse burnt, then reading back data
over USB is not possible anymore, which means, that the verification of the
image is not possible anymore. Set ``verify`` to False in this case.

Binds to:
loader:
Expand All @@ -2569,13 +2572,15 @@ Implements:
drivers:
IMXUSBDriver:
image: 'mybootloaderkey'
verify: True

images:
mybootloaderkey: 'path/to/mybootloader.img'

Arguments:
- image (str): optional, key in :ref:`images <labgrid-device-config-images>` containing the path
of an image to bootstrap onto the target
- verify (bool, default=True): optional, wether to verify the written image or not

BDIMXUSBDriver
~~~~~~~~~~~~~~
Expand Down
9 changes: 7 additions & 2 deletions labgrid/driver/usbloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class IMXUSBDriver(Driver, BootstrapProtocol):
}

image = attr.ib(default=None)
verify = attr.ib(default=True, validator=attr.validators.instance_of(bool))

def __attrs_post_init__(self):
super().__attrs_post_init__()
Expand All @@ -78,9 +79,13 @@ def load(self, filename=None):
mf = ManagedFile(filename, self.loader)
mf.sync_to_resource()

command = [self.tool, "-p", str(self.loader.path)]
if self.verify:
command.append("-c")
command.append(mf.get_remote_path())

processwrapper.check_output(
self.loader.command_prefix +
[self.tool, "-p", str(self.loader.path), "-c", mf.get_remote_path()],
self.loader.command_prefix + command,
print_on_silent_log=True
)

Expand Down