Skip to content

Commit dd5e4be

Browse files
author
Juho Hovila
committed
Merge branch 'IOTSYSTOOL-1290' into custom_target_filename
2 parents 05687cc + 208a021 commit dd5e4be

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

mbed_flasher/flashers/FlasherMbed.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,14 @@ def _copy_file_windows(self, source, destination):
220220
def _copy_file(self, aux_source, destination):
221221
destination_fd = None
222222
try:
223-
destination_fd = os.open(
224-
destination,
225-
os.O_CREAT | os.O_TRUNC | os.O_RDWR | os.O_SYNC)
223+
if os.uname()[4].startswith('arm'):
224+
destination_fd = os.open(
225+
destination,
226+
os.O_CREAT | os.O_TRUNC | os.O_RDWR | os.O_DIRECT)
227+
else:
228+
destination_fd = os.open(
229+
destination,
230+
os.O_CREAT | os.O_TRUNC | os.O_RDWR | os.O_SYNC)
226231

227232
self.logger.debug("Copying binary: %s (size=%i bytes)", destination, len(aux_source))
228233
os.write(destination_fd, aux_source)

0 commit comments

Comments
 (0)