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