pine64 / blisp

ISP tool & library for Bouffalo Labs RISC-V Microcontrollers and SoCs
MIT License
144 stars 20 forks source link

Handshake Failed (sp_blocking_read returning 0) #47

Open L-udo opened 1 year ago

L-udo commented 1 year ago

Pinecil V2 Running v2.20.14DAF70 Windows 10 10.0.19045

C:\Users\User\Downloads\Pinecilv2>.\blisp.exe write --chip bl60x --reset -p COM3 Pinecilv2_EN.bin
sp: sp_get_port_by_name(COM3, 000000D98A6FCF98) called.
sp: Building structure for port COM3.
sp: get_port_details returning SP_OK.
sp: sp_get_port_by_name returning SP_OK.
sp: sp_open(00000283A3378880, 0x3) called.
sp: Opening port COM3.
sp: New wait running in background.
sp: restart_wait returning SP_OK.
sp: get_config(00000283A3378880, 000000D98A6FCEF8, 000000D98A6FCF18) called.
sp: Getting configuration for port COM3.
sp: get_config returning SP_OK.
sp: set_config(00000283A3378880, 000000D98A6FCEF8, 000000D98A6FCF18) called.
sp: Setting configuration for port COM3.
sp: await_write_completion(00000283A3378880) called.
sp: await_write_completion returning SP_OK.
sp: set_config returning SP_OK.
sp: sp_open returning SP_OK.
sp: sp_set_bits(00000283A3378880, 8) called.
sp: get_config(00000283A3378880, 000000D98A6FCF38, 000000D98A6FCF10) called.
sp: Getting configuration for port COM3.
sp: get_config returning SP_OK.
sp: set_config(00000283A3378880, 000000D98A6FCF38, 000000D98A6FCF10) called.
sp: Setting configuration for port COM3.
sp: await_write_completion(00000283A3378880) called.
sp: await_write_completion returning SP_OK.
sp: set_config returning SP_OK.
sp: sp_set_bits returning SP_OK.
sp: sp_set_parity(00000283A3378880, 0) called.
sp: get_config(00000283A3378880, 000000D98A6FCF38, 000000D98A6FCF10) called.
sp: Getting configuration for port COM3.
sp: get_config returning SP_OK.
sp: set_config(00000283A3378880, 000000D98A6FCF38, 000000D98A6FCF10) called.
sp: Setting configuration for port COM3.
sp: await_write_completion(00000283A3378880) called.
sp: await_write_completion returning SP_OK.
sp: set_config returning SP_OK.
sp: sp_set_parity returning SP_OK.
sp: sp_set_stopbits(00000283A3378880, 1) called.
sp: get_config(00000283A3378880, 000000D98A6FCF38, 000000D98A6FCF10) called.
sp: Getting configuration for port COM3.
sp: get_config returning SP_OK.
sp: set_config(00000283A3378880, 000000D98A6FCF38, 000000D98A6FCF10) called.
sp: Setting configuration for port COM3.
sp: await_write_completion(00000283A3378880) called.
sp: await_write_completion returning SP_OK.
sp: set_config returning SP_OK.
sp: sp_set_stopbits returning SP_OK.
sp: sp_set_flowcontrol(00000283A3378880, 0) called.
sp: get_config(00000283A3378880, 000000D98A6FCF38, 000000D98A6FCF10) called.
sp: Getting configuration for port COM3.
sp: get_config returning SP_OK.
sp: sp_set_config_flowcontrol returning SP_OK.
sp: set_config(00000283A3378880, 000000D98A6FCF38, 000000D98A6FCF10) called.
sp: Setting configuration for port COM3.
sp: await_write_completion(00000283A3378880) called.
sp: await_write_completion returning SP_OK.
sp: set_config returning SP_OK.
sp: sp_set_flowcontrol returning SP_OK.
sp: sp_get_port_usb_vid_pid(00000283A3378880) called.
sp: sp_get_port_usb_vid_pid returning SP_ERR_SUPP: VID:PID values are not available.
sp: sp_set_baudrate(00000283A3378880, 460800) called.
sp: get_config(00000283A3378880, 000000D98A6FCF38, 000000D98A6FCF10) called.
sp: Getting configuration for port COM3.
sp: get_config returning SP_OK.
sp: set_config(00000283A3378880, 000000D98A6FCF38, 000000D98A6FCF10) called.
sp: Setting configuration for port COM3.
sp: await_write_completion(00000283A3378880) called.
sp: await_write_completion returning SP_OK.
sp: set_config returning SP_OK.
sp: sp_set_baudrate returning SP_OK.
Sending a handshake...
sp: sp_set_rts(00000283A3378880, 1) called.
sp: get_config(00000283A3378880, 000000D98A6FCC28, 000000D98A6FCC00) called.
sp: Getting configuration for port COM3.
sp: get_config returning SP_OK.
sp: set_config(00000283A3378880, 000000D98A6FCC28, 000000D98A6FCC00) called.
sp: Setting configuration for port COM3.
sp: await_write_completion(00000283A3378880) called.
sp: await_write_completion returning SP_OK.
sp: set_config returning SP_OK.
sp: sp_set_rts returning SP_OK.
sp: sp_set_dtr(00000283A3378880, 1) called.
sp: get_config(00000283A3378880, 000000D98A6FCC28, 000000D98A6FCC00) called.
sp: Getting configuration for port COM3.
sp: get_config returning SP_OK.
sp: set_config(00000283A3378880, 000000D98A6FCC28, 000000D98A6FCC00) called.
sp: Setting configuration for port COM3.
sp: await_write_completion(00000283A3378880) called.
sp: await_write_completion returning SP_OK.
sp: set_config returning SP_OK.
sp: sp_set_dtr returning SP_OK.
sp: sp_set_dtr(00000283A3378880, 0) called.
sp: get_config(00000283A3378880, 000000D98A6FCC28, 000000D98A6FCC00) called.
sp: Getting configuration for port COM3.
sp: get_config returning SP_OK.
sp: set_config(00000283A3378880, 000000D98A6FCC28, 000000D98A6FCC00) called.
sp: Setting configuration for port COM3.
sp: await_write_completion(00000283A3378880) called.
sp: await_write_completion returning SP_OK.
sp: set_config returning SP_OK.
sp: sp_set_dtr returning SP_OK.
sp: sp_set_rts(00000283A3378880, 0) called.
sp: get_config(00000283A3378880, 000000D98A6FCC28, 000000D98A6FCC00) called.
sp: Getting configuration for port COM3.
sp: get_config returning SP_OK.
sp: set_config(00000283A3378880, 000000D98A6FCC28, 000000D98A6FCC00) called.
sp: Setting configuration for port COM3.
sp: await_write_completion(00000283A3378880) called.
sp: await_write_completion returning SP_OK.
sp: set_config returning SP_OK.
sp: sp_set_rts returning SP_OK.
sp: sp_blocking_write(00000283A3378880, 000000D98A6FCC80, 276, 500) called.
sp: Writing 276 bytes to port COM3, timeout 500 ms.
sp: await_write_completion(00000283A3378880) called.
sp: await_write_completion returning SP_OK.
sp: Waiting for write to complete.
sp: Write completed, 276/276 bytes written.
sp: sp_blocking_write returning 276.
sp: sp_drain(00000283A3378880) called.
sp: Draining port COM3.
sp: sp_drain returning SP_OK.
sp: sp_flush(00000283A3378880, 0x1) called.
sp: Flushing input buffers on port COM3.
sp: Previous wait completed.
sp: New wait running in background.
sp: restart_wait returning SP_OK.
sp: sp_flush returning SP_OK.
sp: sp_blocking_read(00000283A3378880, 000000D98A6FD148, 2, 50) called.
sp: Reading 2 bytes from port COM3, timeout 50 ms.
sp: Read completed immediately.
sp: restart_wait_if_needed returning SP_OK.
sp: sp_blocking_read returning 2.
sp: sp_blocking_write(00000283A3378880, 000000D98A6FCC80, 276, 500) called.
sp: Writing 276 bytes to port COM3, timeout 500 ms.
sp: await_write_completion(00000283A3378880) called.
sp: await_write_completion returning SP_OK.
sp: Waiting for write to complete.
sp: Write completed, 276/276 bytes written.
sp: sp_blocking_write returning 276.
sp: sp_drain(00000283A3378880) called.
sp: Draining port COM3.
sp: sp_drain returning SP_OK.
sp: sp_flush(00000283A3378880, 0x1) called.
sp: Flushing input buffers on port COM3.
sp: Previous wait completed.
sp: New wait running in background.
sp: restart_wait returning SP_OK.
sp: sp_flush returning SP_OK.
sp: sp_blocking_read(00000283A3378880, 000000D98A6FD148, 2, 50) called.
sp: Reading 2 bytes from port COM3, timeout 50 ms.
sp: Read completed immediately.
sp: restart_wait_if_needed returning SP_OK.
sp: sp_blocking_read returning 2.
sp: sp_blocking_write(00000283A3378880, 000000D98A6FCC80, 276, 500) called.
sp: Writing 276 bytes to port COM3, timeout 500 ms.
sp: await_write_completion(00000283A3378880) called.
sp: await_write_completion returning SP_OK.
sp: Waiting for write to complete.
sp: Write completed, 276/276 bytes written.
sp: sp_blocking_write returning 276.
sp: sp_drain(00000283A3378880) called.
sp: Draining port COM3.
sp: sp_drain returning SP_OK.
sp: sp_flush(00000283A3378880, 0x1) called.
sp: Flushing input buffers on port COM3.
sp: Previous wait completed.
sp: New wait running in background.
sp: restart_wait returning SP_OK.
sp: sp_flush returning SP_OK.
sp: sp_blocking_read(00000283A3378880, 000000D98A6FD148, 2, 50) called.
sp: Reading 2 bytes from port COM3, timeout 50 ms.
sp: Read completed immediately.
sp: restart_wait_if_needed returning SP_OK.
sp: sp_blocking_read returning 2.
sp: sp_blocking_write(00000283A3378880, 000000D98A6FCC80, 276, 500) called.
sp: Writing 276 bytes to port COM3, timeout 500 ms.
sp: await_write_completion(00000283A3378880) called.
sp: await_write_completion returning SP_OK.
sp: Waiting for write to complete.
sp: Write completed, 276/276 bytes written.
sp: sp_blocking_write returning 276.
sp: sp_drain(00000283A3378880) called.
sp: Draining port COM3.
sp: sp_drain returning SP_OK.
sp: sp_flush(00000283A3378880, 0x1) called.
sp: Flushing input buffers on port COM3.
sp: Previous wait completed.
sp: New wait running in background.
sp: restart_wait returning SP_OK.
sp: sp_flush returning SP_OK.
sp: sp_blocking_read(00000283A3378880, 000000D98A6FD148, 2, 50) called.
sp: Reading 2 bytes from port COM3, timeout 50 ms.
sp: Read completed immediately.
sp: restart_wait_if_needed returning SP_OK.
sp: sp_blocking_read returning 2.
sp: sp_blocking_write(00000283A3378880, 000000D98A6FCC80, 276, 500) called.
sp: Writing 276 bytes to port COM3, timeout 500 ms.
sp: await_write_completion(00000283A3378880) called.
sp: await_write_completion returning SP_OK.
sp: Waiting for write to complete.
sp: Write completed, 276/276 bytes written.
sp: sp_blocking_write returning 276.
sp: sp_drain(00000283A3378880) called.
sp: Draining port COM3.
sp: sp_drain returning SP_OK.
sp: sp_flush(00000283A3378880, 0x1) called.
sp: Flushing input buffers on port COM3.
sp: Previous wait completed.
sp: New wait running in background.
sp: restart_wait returning SP_OK.
sp: sp_flush returning SP_OK.
sp: sp_blocking_read(00000283A3378880, 000000D98A6FD148, 2, 50) called.
sp: Reading 2 bytes from port COM3, timeout 50 ms.
sp: Waiting for read to complete.
sp: Read completed, 0/2 bytes read.
sp: restart_wait_if_needed returning SP_OK.
sp: sp_blocking_read returning 0.
Received no response from chip.
Failed to handshake with device.
sp: sp_close(00000283A3378880) called.
sp: Closing port COM3.
sp: sp_close returning SP_OK.
gamelaster commented 1 year ago

Because on you are specifying chip bl60x, but Pinecil have BL706 chip, thus use bl70x instead.

L-udo commented 1 year ago

Sorry, forgot to add it to the issue, i have tried using bl70x, same issue with both

gamelaster commented 1 year ago

Did you tried another pc / cable? Are you sure you have correct COM port? (you don't need to specify com port on BL70X)

L-udo commented 1 year ago

Did you tried another pc / cable? Are you sure you have correct COM port? (you don't need to specify com port on BL70X)

I will try a new pc later. I have tried all of the above sadly

kajgies commented 10 months ago

I am having the same issue, here is the log:

.\blisp.exe write --port=COM3 --chip=bl70x --reset .\Pinecilv2_EN.bin

Sending a handshake...
Received no response from chip.
Failed to handshake with device.

I got the same error with 5 different USB cables on both my PC & laptop. Tried both USB C to C, and C to A cables. I also tried manually setting the COM of my device to COM10 but got the same error. Could it be that something changed on newer batches of the pinecil 2?

gamelaster commented 10 months ago

@kajgies what is the output when --port is not specified?

kajgies commented 10 months ago
.\blisp.exe write --chip=bl70x --reset .\Pinecilv2_EN.bin
Device not found

I am sure that COM3 is the pinecil.

gamelaster commented 10 months ago

@kajgies please, can you open device manager, find the COM3, and find VID & PID?

kajgies commented 10 months ago

It says: USB\VID_FFFF&PID_FFFF&REV_0200

gamelaster commented 10 months ago

This is very interesting, it is correct VID & PID. Did you tried to launch it as Admin?

kajgies commented 10 months ago

I tried both cmd & powershell. Tried it as admin too, same result

gamelaster commented 10 months ago

@kajgies This is really interesting that even when device is connected and visible, it can't auto-detect or use the port... Maybe antivirus or something? I really never seen this happening.

kajgies commented 10 months ago

Just Windows antivirus. If there's anything else I can try or do to help solve the problem, please let me know.

kajgies commented 10 months ago

I tried linux and here it worked instantly. So for me the problem is resolved. Weird that it didn't work on Windows tho. I tried all the USB ports on a PC & a laptop, very strange.