Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document XMODEM behavior with good/bad chips #6

Open
bluecmd opened this issue Jul 13, 2023 · 7 comments
Open

Document XMODEM behavior with good/bad chips #6

bluecmd opened this issue Jul 13, 2023 · 7 comments

Comments

@bluecmd
Copy link

bluecmd commented Jul 13, 2023

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
Copy link

misuzu commented Jul 13, 2023

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
Copy link
Author

bluecmd commented Jul 13, 2023

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
Copy link

misuzu commented Jul 13, 2023

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

@strlcat
Copy link
Contributor

strlcat commented Aug 1, 2023

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 #6 (comment), but mine shows as
067b:2303 Prolific Technology, Inc. PL2303 Serial Port / Mobile Action MA-8910P (note additional P)
Might be difference.

@eshattow
Copy link

eshattow commented Jan 5, 2024

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

@Muzuwi
Copy link

Muzuwi commented Nov 25, 2024

Just chiming in for posterity as I encountered the same issue OP has described while experimenting with my VisionFive2 board. In my case however, the FT232 refuses to work with xmodem unfortunately. I'm using a Waveshare TTL-USB dongle with supposedly a FT232RL on-board, but judging by the issues it may not be genuine after all (or there's some other variable at play that makes xmodem fail here).

Appears the same in lsusb:

$ lsusb
...
Bus 001 Device 007: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC

Failure looks similar (using screen, minicom yields the same result):

CCCCCCCCCCCCCCCCCCCSending jh7110-recovery-20221205.bin, 1291 blocks: Give your local XMODEM receive command now.
Xmodem sectors/kbytes sent:   0/ 0kRetry 0: NAK on sector
Retry 0: NAK on sector
Retry 0: NAK on sector
Retry 0: NAK on sector
Retry 0: NAK on sector
Xmodem sectors/kbytes sent:  13/ 1kRetry 0: NAK on sector
Retry 0: NAK on sector
Retry 0: NAK on sector
Retry 0: NAK on sector
Retry 0: NAK on sector
Retry 0: NAK on sector
Retry 0: NAK on sector
Retry 0: NAK on sector
Retry 0: NAK on sector
Retry 0: NAK on sector
Retry 0: NAK on sector
Retry 0: Retry Count Exceeded

Transfer incomplete
 Error

Will update this issue if I can figure out something more than the chip just being plain bad.

@eshattow
Copy link

Useless to spend more time on StarFive tools, they do not release source code.

There are tools to do this work that have source code available, now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants