Guide: Upgrading firmware with only a serial/uart connection via u-boot

Painfully, editing is no longer possible.

On Linux, the recommended terminal is minicom. Shows a nice menu on C-a s for sending files.

It is possible to do YMODEM with GNU screen, but it’s relatively painful as it doesn’t have an UI for that. In long command mode, exec !! sx --ymodem <filepath> .

edit: It is possible again, so I just fixed it. Either reputation based, or perhaps too any edits in a row do temporarily lock editing.

3 Likes

On Windows I would recommend TeraTerm Pro. I just flash my board using your method with it.

4 Likes

Thank you for this straight forward set of instructions. I was having some trouble getting TFTP on my PC talking to the board properly.

I’d like to echo what @cwt said about TeraTerm as well, has YMODEM support and worked perfectly.

1 Like

The open source Tera Term is what I have used on Windows, too.

Which I installed via chocolatey.

Note that Tera Term does also support Kermit, which is a better protocol overall. (use loadb instead of loady)

1 Like

I got my adafruit serial adapter just today, this worked wonderfully and I’m running image69 perfectly now! Thank you so much for making this guide!

4 Likes

@rvalles how did you transfer the file?

Thanks to @rvalles , nice work.
While you’re transferring firmwre, though, you can go get a cup of coffee. since it needs almost 5minutes

3 Likes

Screen has always worked better for me and I have used X, Y, and Z modem transfers, but I agree it’s not super intuitive.

1 Like

Ironically, Konsole (the KDE/Plasma terminal) has file transfers, but for some reason it’s only ZMODEM. Somebody must really like ZMODEM :sweat_smile:

Implementing X/YMODEM for them is one item in my “maybe TODO” list, for a day of boredom.

Yep, perfect if you do, like me, love your coffee.

But if you hate coffee, it is possible to change the baudrate to something faster on both ends. 115200 is only the default.

I have not tested other speeds, but loady is like loady [addr [baud]].

Current usb-ttl adapters typically do 1mbit/s, sometimes more. I have successfully done 10mbit/s before, with different boards/setups.

I know Z implements a sliding window so it’s more efficient, especially at higher speeds (no pauses inserted, waiting for acknowledgements). I’m not sure how X and Y compare to each other, but presumably complexity goes up X → Y → Z.

1 Like

After XMODEM appeared, there were a bunch of extensions to it, most notably XMODEM-CRC (crc16-xmodem instead of a crude 8bit sum, easily identified by the use of ‘C’ as handshake in the receiver) and XMODEM-1K (1K blocks instead of 128 byte, implies CRC).

YMODEM requires both of these extensions, and adds a zero packet that contains metadata like filename and size (thus there isn’t trailing garbage as padding as with XMODEM), as well as the ability to send/receive multiple files in one batch.

If I have to get more complex than YMODEM, I’d go to Kermit, much older protocol yet highly reliable and also capable of high speeds with sliding windows.

ZMODEM is a totally different protocol vs X/YMODEM, relatively complex.

X/YMODEM and Kermit still work over TCP, whereas ZMODEM in my experience has a lot of trouble in that situation, thus my distrust of ZMODEM.

3 Likes

Thanks @rvalles. I didn’t have access to ethernet so couldn’t load the new firmware. I did have a serial connector and was able to make it work and finally installed image-69.

1 Like

Successfully flashed v2.10.4 with this method. All good.

And v3.0.4 today, without issue.

This version of u-boot sees my SSD. :slight_smile:

starfive_pcie pcie@2C000000: Starfive PCIe bus probed.
PCI: Failed autoconfig bar 10
pci enum ...

IDE device 0: Vendor: 0x1e4b Rev: H220902a Prod: P300ADBB221125357
            Type: Hard Disk
            Capacity: 1953514.3 MB = 1907.7 GB (4000797360 x 512)
bootmode flash device 1/0
1 Like

Processing: teraterm starfive console output serial settings.png…

I’m having some issues connecting to my StarFive’s console. I just purchased this TTL adapter (DSD TECH SH-U09C USB to TTL Serial Adapter with FTDI FT232RL Chip) and this is the first time to use it. I’m getting garbled characters with both Tera Term and Putty with the serial port set to 115200 8N1 OFF. I think my settings are correct, so looking for advice/thoughts. Could my TTL be bad? Is there a way to test? Could my board be bad? Could its firmware be corrupt in some way?

The board is booting into Debian currently off an SD card. My main reason for ordering the TTL was to get the version of my firmware to see if it even needed updating to boot off NVME.

2 Likes

Did you not connect the adapter’s GND to VF2’s GND?

Your settings are correct; this is all I can come up with.

3 Likes

Thank you. I did not. That fixed it. Working beautifully now. I’ve never used one of these USB to TTL converters before and didn’t even think about it. I only connected TX and RX to the board.

3 Likes

@rvalles Thank you for pointing me to this guide from the other thread.

But I’m missing something in your guide, when exactly am I selecting the files from the file dialog?

Edit: I figured it out myself, directly after “loady” you send the file via the dialog.

First the .out and after a second “loady” the .img file.

Tera_Term_filetransfer

Tera_Term_flash

At last “reset”.

1 Like

All good, although one sfprobe is enough; u-boot does not forget the flash devices along the way.