znyul / stm32flash

Automatically exported from code.google.com/p/stm32flash
0 stars 1 forks source link

hangs if writing binary file on windows #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. flash a binary into fsm32 on win32
2.
3.

What is the expected output? What do you see instead?

stm32flash hangs in binary_read(), I think it's because 
read(st->fd, data, left) return 0 when it meets ctrl-Z(EOF char)

What version of the product are you using? On what operating system?

all versions on win32

Please provide any additional information below.

can simply fixed it by adding O_BINARY flag to open.

binary.c:46
st->fd = open(filename, O_RDONLY|O_BINARY);

Original issue reported on code.google.com by zhanghan...@gmail.com on 7 Oct 2011 at 7:32

GoogleCodeExporter commented 9 years ago
Thanks for this, I will get this patched in soon, the windows code was written 
by someone else so I can not vouch for its accuracy.

Original comment by ge...@spacevs.com on 13 Oct 2011 at 7:00

GoogleCodeExporter commented 9 years ago
There are two calls to "open" in the "binary_open" function. Shouldn't both 
have the O_BINARY flag set for windows?

Original comment by trevorog...@aol.com on 13 Oct 2011 at 11:39

GoogleCodeExporter commented 9 years ago
yes, i think it should if using binary_open to write a file on win32. 

Original comment by zhanghan...@gmail.com on 13 Oct 2011 at 6:00

GoogleCodeExporter commented 9 years ago
This has been fixed, thanks for the heads up

Original comment by ge...@spacevs.com on 10 Nov 2011 at 11:07