Update send files over UART.md

pull/127/head
naksper 2023-08-26 09:24:48 +02:00 committed by GitHub
parent d62a557e62
commit 0d6e9d3f85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 12 deletions

View File

@ -4,17 +4,17 @@
How to send files over UART How to send files over UART
--------------------------- ---------------------------
If SD card reader failt and there is no network configured on your cam you may need to send a new firmware over UART interface to update the camera. If SD card reader failt and there is no network configured on your cam, you may need to send a new firmware over UART interface to update the camera.
## Sender: ## Sender:
First we encode the files 1- First we encode the files
```bash ```bash
base64 uImage > uImage.b base64 uImage > uImage.b
``` ```
Now make sure your com send-file command is, ascii-xfr, this was my connection command line 2- Now make sure your com send-file command is, ascii-xfr, this was my connection command line
```bash ```bash
picocom -f n -p n -d 8 -b 115200 --send-cmd "ascii-xfr -snv" /dev/ttyUSB0 picocom -f n -p n -d 8 -b 115200 --send-cmd "ascii-xfr -snv" /dev/ttyUSB0
@ -27,31 +27,32 @@ Normally we want ascii-xfr on the receiving side, but since we don't have it,
## Receiver: ## Receiver:
Now that we've connected, go to the directory where you want the received file. 3- Now that we've connected, go to the directory where you want the received file.
```bash ```bash
cd /tmp/ cd /tmp/
``` ```
4- Start receiving the file by uart
```bash ```bash
cat > uImage.b cat > uImage.b
``` ```
On picocom, I just CTRL+a+s, and enter the full path of the file I'm sending. Once the transfer completes, you'll need to CTRL+c to break that cat. 5- On picocom, I just CTRL+a+s, and enter the full path of the file I'm sending. Once the transfer completes, you'll need to CTRL+c to break that cat.
Now we decode the file,
6- Now we decode the file,
```bash ```bash
base64 -d uImage.b > uImage base64 -d uImage.b > uImage
``` ```
```bash 7- Do whatever you can to verify that file is IDENTICAL to the one you sent, because an ASCII transfer has no checksum protection.
base64 -d rootfs.squashfs.b > rootfs.squashfs Openipc had sha512sum, but any checksum command would suffice.
```
Do whatever you can to verify that file is IDENTICAL to the one you sent, because an ASCII transfer has no checksum protection. Openipc had sha512sum, but any checksum command would suffice. Once you manually confirm the sums match, you can assume the transfer was successful!
```bash ```bash
sha256sum uImage sha256sum uImage
``` ```
Once you manually confirm the sums match, you can assume the transfer was successful!
Repeat for rootfs, and now you will be able to upgrade with sysupgrade Repeat for rootfs steps 4,5 & 6, and now you will be able to upgrade with sysupgrade
```bash ```bash
sysupgrade --kernel=/tmp/uImage --rootfs=/tmp/rootfs.squashfs --force_ver -z sysupgrade --kernel=/tmp/uImage --rootfs=/tmp/rootfs.squashfs --force_ver -z