Skip to content

Commit 2ed6ba7

Browse files
committed
IMXUSBDriver: conditionally check image
Some devices do not allow USB Serial Download read commands, which will result in a failure, when trying to verify the correctness of the image. Make the verify step optional but on by default. Signed-off-by: Fabian Pflug <[email protected]>
1 parent 0ba0f75 commit 2ed6ba7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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)