stcflash icon indicating copy to clipboard operation
stcflash copied to clipboard

I got an IOError

Open Pyloons opened this issue 7 years ago • 6 comments

I just want to detect some info of my 89c52, but always raise an IOError. it's my steps to use this script. 1st,python stcflash.py; 2nd,turn off the power; 3rd, turn on the power.then wait.then raise error. why...

Pyloons avatar Aug 02 '17 05:08 Pyloons

I have the same issue on my Mac. When I was executing the command "python /Users/Tnze/Documents/projects/51/tools/stcflash.py --port /dev/tty.wchusbserial1410 -v --lowbaud 19200 --protocol 89 /Users/Tnze/Documents/projects/51/CubeGluttonousSnake/bin/tnze.ihx", it shows Connect to /dev/tty.wchusbserial1410 at baudrate 19200 Detecting target... then I turn off, turn on the power, It shows

Connect to /dev/tty.wchusbserial1410 at baudrate 19200 Detecting target...INFO: [2668] Model ID: F0 02 INFO: [2668] Model name: STC89C52RC INFO: [2669] ROM size: 8 INFO: [2669] Protocol ID: 89 INFO: [2669] Checksum mode: 1 INFO: [2669] UART Parity: NONE INFO: [2669] Info string [0]: 66 43 FD F0 02 82 00 00 00 00 00 00 00 00 00 00 INFO: [2669] Info string [1]: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 INFO: [2669] Info string [2]: 00 00 00 04 done FOSC: 8.097MHz Model: STC89C52RC (ver6.6C) ROM: 8KB [X] Reset stops watchdog [X] Internal XRAM [X] Normal ALE pin [X] Full gain oscillator [X] Not erase data EEPROM [X] Download regardless of P1 [X] 12T mode Baudrate: INFO: [2669] Test baudrate 28800 (accuracy 0.0244) using config FF F7 00 12 140 INFO: [2669] Waiting time config 83 Traceback (most recent call last): File "/Users/Tnze/Documents/projects/51/tools/stcflash.py", line 700, in main() File "/Users/Tnze/Documents/projects/51/tools/stcflash.py", line 696, in main program(Programmer(conn, opts.protocol), code, opts.erase_eeprom) File "/Users/Tnze/Documents/projects/51/tools/stcflash.py", line 525, in program prog.handshake() File "/Users/Tnze/Documents/projects/51/tools/stcflash.py", line 372, in handshake self.send(0x8F, baudstr + [0x80 + twait]) File "/Users/Tnze/Documents/projects/51/tools/stcflash.py", line 231, in send self.__conn_write(buf) File "/Users/Tnze/Documents/projects/51/tools/stcflash.py", line 68, in __conn_write self.conn.write(bytearray(s)) ValueError: byte must be in range(0, 256).

Then I insert print(s) at line 68. It prints [70, 185, 106, 0, 12, 143, 255, 247, 0, 18, 320, 131, 208, 22]

Tnze avatar Nov 10 '18 06:11 Tnze

I just want to detect some info of my 89c52, but always raise an IOError. it's my steps to use this script. 1st,python stcflash.py; 2nd,turn off the power; 3rd, turn on the power.then wait.then raise error. why...

I got the same problem, waiting for someone to help me

MRsoymilk avatar Sep 06 '19 10:09 MRsoymilk

your chip may not support, change another one.

MRsoymilk avatar Oct 21 '19 11:10 MRsoymilk

Got a similar output. After I got "Detecting target...", I turned off and on the power of my board, but nothing happened. After a while I got an IO error. I was using a STC89C52.

retrhelo avatar Mar 10 '20 12:03 retrhelo

I use STC89C516, The same problem~ Is there someone solve it? Thanks~

Detecting target...Traceback (most recent call last): File "stcflash.py", line 701, in main() File "stcflash.py", line 697, in main program(Programmer(conn, opts.protocol), code, opts.erase_eeprom) File "stcflash.py", line 509, in program prog.detect() File "stcflash.py", line 243, in detect raise IOError()

Calvin-Dong-007 avatar Dec 13 '20 10:12 Calvin-Dong-007

remember serial is cross connected, check if it is the issue

Haotian-Shi-cyber avatar Oct 04 '22 02:10 Haotian-Shi-cyber