From e502858e6aee04452f6b5d1969d1a213690e97bf Mon Sep 17 00:00:00 2001 From: Domen Puncer Date: Mon, 18 Jun 2012 10:40:43 +0200 Subject: [PATCH] Open file in binary mode, so it works on windows. Fix from http://www.micromouseonline.com/2009/05/08/stm32-arm-cortex-bootloader/#comment-197 --- stm32loader/stm32loader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stm32loader/stm32loader.py b/stm32loader/stm32loader.py index f7c7796..4a903b6 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()