Heinrich Schuchardt | 1f8b29b | 2021-01-22 19:18:01 +0100 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+: |
| 2 | |
Heinrich Schuchardt | 1b0c316 | 2024-01-14 14:53:13 +0100 | [diff] [blame] | 3 | .. index:: |
| 4 | single: loady (command) |
| 5 | |
Heinrich Schuchardt | 1f8b29b | 2021-01-22 19:18:01 +0100 | [diff] [blame] | 6 | loady command |
| 7 | ============= |
| 8 | |
| 9 | Synopsis |
| 10 | -------- |
| 11 | |
| 12 | :: |
| 13 | |
| 14 | loady [addr [baud]] |
| 15 | |
| 16 | Description |
| 17 | ----------- |
| 18 | |
| 19 | The loady command is used to transfer a file to the device via the serial line |
| 20 | using the YMODEM protocol. |
| 21 | |
| 22 | The number of transferred bytes is saved in environment variable filesize. |
| 23 | |
| 24 | addr |
| 25 | load address, defaults to environment variable loadaddr or if loadaddr is |
| 26 | not set to configuration variable CONFIG_SYS_LOAD_ADDR |
| 27 | |
| 28 | baud |
| 29 | baud rate for the ymodem transmission. After the transmission the baud |
| 30 | rate is reset to the original value. |
| 31 | |
| 32 | Example |
| 33 | ------- |
| 34 | |
| 35 | In the example below the terminal emulation program picocom was used to |
| 36 | transfer a file to the device. |
| 37 | |
| 38 | After entering the loady command the key sequence <CTRL-A><CTRL-S> is used to |
| 39 | let picocom prompt for the file name. Picocom invokes the program sz for the |
| 40 | file transfer. |
| 41 | |
| 42 | :: |
| 43 | |
| 44 | => loady 80064000 115200 |
| 45 | ## Ready for binary (ymodem) download to 0x80064000 at 115200 bps... |
| 46 | C |
| 47 | *** file: BOOTRISCV64.EFI |
| 48 | $ sz -b -vv BOOTRISCV64.EFI |
| 49 | Sending: BOOTRISCV64.EFI |
| 50 | Bytes Sent: 398976 BPS:7883 |
| 51 | Sending: |
| 52 | Ymodem sectors/kbytes sent: 0/ 0k |
| 53 | Transfer complete |
| 54 | |
| 55 | *** exit status: 0 *** |
| 56 | /1(CAN) packets, 4 retries |
| 57 | ## Total Size = 0x0006165f = 398943 Bytes |
| 58 | => echo ${filesize} |
| 59 | 6165f |
| 60 | => |
| 61 | |
Heinrich Schuchardt | 8f75d59 | 2023-05-16 07:45:05 +0200 | [diff] [blame] | 62 | Transfer can be cancelled by pressing 3 times <CTRL+C> after two seconds |
| 63 | of inactivity on terminal. |
| 64 | |
Heinrich Schuchardt | 1f8b29b | 2021-01-22 19:18:01 +0100 | [diff] [blame] | 65 | Configuration |
| 66 | ------------- |
| 67 | |
| 68 | The command is only available if CONFIG_CMD_LOADB=y. |
| 69 | |
Pali Rohár | 10f7135 | 2022-08-29 17:36:23 +0200 | [diff] [blame] | 70 | Initial timeout in seconds while waiting for transfer is configured by |
| 71 | config option CMD_LOADXY_TIMEOUT or by env variable $loadxy_timeout. |
| 72 | Setting it to 0 means infinite timeout. |
| 73 | |
Heinrich Schuchardt | 1f8b29b | 2021-01-22 19:18:01 +0100 | [diff] [blame] | 74 | Return value |
| 75 | ------------ |
| 76 | |
Heinrich Schuchardt | 8f75d59 | 2023-05-16 07:45:05 +0200 | [diff] [blame] | 77 | The return value $? is 0 (true) on success, 1 (false) otherwise. |