Skip to content

Commit e9e43aa

Browse files
Merge pull request #1714 from gumulka/conditionally_check_imxusbloader
IMXUSBDriver: conditionally check image
2 parents f640405 + f2d3cbb commit e9e43aa

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

doc/configuration.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2551,6 +2551,9 @@ An :any:`IMXUSBDriver` is used to upload an image into a device in the *i.MX
25512551
USB loader state*.
25522552
This is useful to bootstrap a bootloader onto a device.
25532553
This driver uses the ``imx-usb-loader`` tool from barebox.
2554+
If your device has the ``SDP_READ_DISABLE`` fuse burnt, then reading back data
2555+
over USB is not possible anymore, which means, that the verification of the
2556+
image is not possible anymore. Set ``verify`` to False in this case.
25542557

25552558
Binds to:
25562559
loader:
@@ -2569,13 +2572,15 @@ Implements:
25692572
drivers:
25702573
IMXUSBDriver:
25712574
image: 'mybootloaderkey'
2575+
verify: True
25722576
25732577
images:
25742578
mybootloaderkey: 'path/to/mybootloader.img'
25752579
25762580
Arguments:
25772581
- image (str): optional, key in :ref:`images <labgrid-device-config-images>` containing the path
25782582
of an image to bootstrap onto the target
2583+
- verify (bool, default=True): optional, wether to verify the written image or not
25792584

25802585
BDIMXUSBDriver
25812586
~~~~~~~~~~~~~~

labgrid/driver/usbloader.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ class IMXUSBDriver(Driver, BootstrapProtocol):
5555
}
5656

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

5960
def __attrs_post_init__(self):
6061
super().__attrs_post_init__()
@@ -78,9 +79,13 @@ def load(self, filename=None):
7879
mf = ManagedFile(filename, self.loader)
7980
mf.sync_to_resource()
8081

82+
command = [self.tool, "-p", str(self.loader.path)]
83+
if self.verify:
84+
command.append("-c")
85+
command.append(mf.get_remote_path())
86+
8187
processwrapper.check_output(
82-
self.loader.command_prefix +
83-
[self.tool, "-p", str(self.loader.path), "-c", mf.get_remote_path()],
88+
self.loader.command_prefix + command,
8489
print_on_silent_log=True
8590
)
8691

0 commit comments

Comments
 (0)