wuxx / icesugar

iCESugar FPGA Board (base on iCE40UP5k)
350 stars 96 forks source link

icesprog fail on windows. #14

Closed aalku closed 3 years ago

aalku commented 3 years ago

https://github.com/wuxx/icesugar/blob/6424e0d8f8a48fe0bd77059bbc0fa9bf72767708/tools/src/icesprog.c#L659

On windows it fails there. Windows needs a flag O_BINARY when using binary files with open(). Otherwise newline sequences accidentally found in the binary stream are converted by mistake so this check that should be redundant actually fails. In the file maybe there is 0x10,0x13 and it reads 0x13 only, so it appears to read less bytes.