diff --git a/stm32loader/stm32loader.py b/stm32loader/stm32loader.py index 67e3b6f..6cd5d12 100755 --- a/stm32loader/stm32loader.py +++ b/stm32loader/stm32loader.py @@ -402,7 +402,7 @@ if __name__ == "__main__": # cmd.cmdWriteProtect([0, 1]) if (conf['write'] or conf['verify']): - data = map(lambda c: ord(c), file(args[0]).read()) + data = map(lambda c: ord(c), file(args[0], 'rb').read()) if conf['erase']: cmd.cmdEraseMemory()