BK7231GUIFlashTool icon indicating copy to clipboard operation
BK7231GUIFlashTool copied to clipboard

Exception on port already open

Open practicalusage opened this issue 10 months ago • 3 comments

I get this exception when I do cen-gnd or power on off the device:

Going to open port: COM3. Serial port open! Getting bus... (now, please do reboot by CEN or by power off/on) Getting bus failed, will try again - 0/100! Got exception: System.UnauthorizedAccessException: Access to the port is denied. at System.IO.Ports.InternalResources.WinIOError(Int32 errorCode, String str) at System.IO.Ports.SerialStream.get_BytesToRead() at System.IO.Ports.SerialPort.get_BytesToRead() at BK7231Flasher.BK7231Flasher.Start_Cmd(Byte[] txbuf, Int32 rxLen, Single timeout)! Exception caught: System.InvalidOperationException: The port is closed. at System.IO.Ports.SerialPort.get_BytesToRead() at BK7231Flasher.BK7231Flasher.consumePending() at BK7231Flasher.BK7231Flasher.Start_Cmd(Byte[] txbuf, Int32 rxLen, Single timeout) at BK7231Flasher.BK7231Flasher.linkCheck() at BK7231Flasher.BK7231Flasher.getBus() at BK7231Flasher.BK7231Flasher.doGetBusAndSetBaudRate() at BK7231Flasher.BK7231Flasher.doGenericSetup() at BK7231Flasher.BK7231Flasher.doReadInternal(Int32 startSector, Int32 sectors) at BK7231Flasher.BK7231Flasher.doRead(Int32 startSector, Int32 sectors) There was no result to save.

practicalusage avatar Jan 08 '25 20:01 practicalusage

I have the same problem.

Dmitry-systemd avatar Jun 09 '25 18:06 Dmitry-systemd

presumably the port opens successfully in something like PUTTY without port in use error?

are you powering module from USB-TTL 3.3v? Does windows do the device eject sound when this happens?

divadiow avatar Jun 15 '25 15:06 divadiow

I have solved the problem. I am inexperienced and connected the tx-tx rx-rx when the tx-rx rx-tx should be connected, so I got the connection and I successfully flashed the module.

Dmitry-systemd avatar Jun 16 '25 08:06 Dmitry-systemd