starfive-tech / Tools

19 stars 5 forks source link

Document XMODEM behavior with good/bad chips #6

Open bluecmd opened 1 year ago

bluecmd commented 1 year ago

Hi!

I was playing around with the recovery feature on VisionFive2 and I had no luck getting it to work at all with a TTL-USB converter using this device:

Prolific Technology, Inc. PL2303 Serial Port / Mobile Action MA-8910

This is the errors:


Welcome to minicom 2.8                                                                        

OPTIONS: I18n                                                                                 
Comp+----------------[xmodem upload - Press CTRL-C to quit]----------------+                  
Port|Sending jh7110-recovery-20230322.bin, 1291 blocks: Give your local XMO|                  
    |DEM receive command now.                                              |                  
Pres|Xmodem sectors/kbytes sent: 1192/149kRetry 0: NAK on sector           |                  
    |                                                                      |                  
CCCC|                                                                      |                  
(C)S|                                                                      |                  
CCCC|                                                                      |                  
    +----------------------------------------------------------------------+                  

However, when I switch to using my trusty Future Technology Devices International, Ltd FT232 Serial (UART) IC based one the XMODEM inside Minicom worked on the first try. (115200 8N1, No flow control).

Welcome to minicom 2.8                                                                        

OPTIONS: I18n                                                                                 
Compiled on Jan 19 2023, 00:00:00.                                                            
Port /dev/ttyUSB0, 14:01:37                                                                   

Press CTRL-A Z for help on special keys                                                       

CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
JH7110 secondboot version: 230322-c514da9                                                     
CPU freq: 1250MHz                                                                             
idcode: 0x1860C8                                                                              
ddr 0x00000000, 4M test                                                                       
ddr 0x00400000, 8M test                                                                       
DDR clk 2133M, size 4GB                                                                       

*********************************************************                                     
****************** JH7110 program tool ******************                                     
*********************************************************                                     
0: update 2ndboot/SPL in flash                                                                
1: update 2ndboot/SPL in emmc                                                                 
2: update fw_verif/uboot in flash                                                             
3: update fw_verif/uboot in emmc                                                              
4: update otp, caution!!!!                                                                    
5: exit                                                                                       
NOTE: current xmodem receive buff = 0x40000000, 'load 0x********' to change.                  
select the function to test:                                                                  

Might be worth mentioning on the recovery guide so that people don't pull their hair out trying to debug something that is due to a less-than-ideal TTL-serial-converter.

I repeated this experiement more than three times to ensure it was conclusive and it is. 0% success rate with my PL2303 adapter, 100% success rate with my FT232 one.

misuzu commented 1 year ago

I have this one and had no issues flashing the firmware:

Bus 003 Device 010: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port / Mobile Action MA-8910P
bluecmd commented 1 year ago

I have this one and had no issues flashing the firmware:

Bus 003 Device 010: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port / Mobile Action MA-8910P

Interesting. I have this one: https://vi.aliexpress.com/item/2027583503.html - do you have something else? Granted, I have no idea if it is an actual PL2303 or a clone IC that just pretends to be one. My IC is totally clean of any markings, so that makes me suspect it might be a clone.

misuzu commented 1 year ago

Mine is already unlisted unfortunately, but it looks like this one.

strlcat commented 1 year ago

Retry 0: NAK on sector should not be the problem, and process shall continue, on normal xmodem devices I have exactly same looking device as yours from https://github.com/starfive-tech/Tools/issues/6#issuecomment-1634182961, but mine shows as 067b:2303 Prolific Technology, Inc. PL2303 Serial Port / Mobile Action MA-8910P (note additional P) Might be difference.

eshattow commented 8 months ago

Reporting success with CP2102N Friend adapter from Adafruit web store and tio serial terminal software on Linux host.