Fix ID mismatch in test when switching modes
When switching between bootloader and interface mode during testing
the error "Unique ID mismatch in details.txt" sometimes occurs. This is
because mbed-ls is returning old data. This patch adds an extra call
to mbed-ls to ensue that the data is up to date.
@@ -497,6 +497,12 @@ class DaplinkBoard(object):
while True:
if self._update_board_info(False):
if os.path.isdir(self.mount_point):
+ # Information returned by mbed-ls could be old.
+ # Only break from the loop if the second call to
+ # mbed-ls returns the same mount point.
+ tmp_mount = self.mount_point
+ if self._update_board_info(False):
+ if tmp_mount == self.mount_point:
break
if elapsed > wait_time:
raise Exception("Mount timed out")
