blob: 8367759471e3a56d628149a0d10dd47378a7e4fa [file] [log] [blame]
Heinrich Schuchardt1f8b29b2021-01-22 19:18:01 +01001.. SPDX-License-Identifier: GPL-2.0+:
2
Heinrich Schuchardt1b0c3162024-01-14 14:53:13 +01003.. index::
4 single: loady (command)
5
Heinrich Schuchardt1f8b29b2021-01-22 19:18:01 +01006loady command
7=============
8
9Synopsis
10--------
11
12::
13
14 loady [addr [baud]]
15
16Description
17-----------
18
19The loady command is used to transfer a file to the device via the serial line
20using the YMODEM protocol.
21
22The number of transferred bytes is saved in environment variable filesize.
23
24addr
25 load address, defaults to environment variable loadaddr or if loadaddr is
26 not set to configuration variable CONFIG_SYS_LOAD_ADDR
27
28baud
29 baud rate for the ymodem transmission. After the transmission the baud
30 rate is reset to the original value.
31
32Example
33-------
34
35In the example below the terminal emulation program picocom was used to
36transfer a file to the device.
37
38After entering the loady command the key sequence <CTRL-A><CTRL-S> is used to
39let picocom prompt for the file name. Picocom invokes the program sz for the
40file 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 Schuchardt8f75d592023-05-16 07:45:05 +020062Transfer can be cancelled by pressing 3 times <CTRL+C> after two seconds
63of inactivity on terminal.
64
Heinrich Schuchardt1f8b29b2021-01-22 19:18:01 +010065Configuration
66-------------
67
68The command is only available if CONFIG_CMD_LOADB=y.
69
Pali Rohár10f71352022-08-29 17:36:23 +020070Initial timeout in seconds while waiting for transfer is configured by
71config option CMD_LOADXY_TIMEOUT or by env variable $loadxy_timeout.
72Setting it to 0 means infinite timeout.
73
Heinrich Schuchardt1f8b29b2021-01-22 19:18:01 +010074Return value
75------------
76
Heinrich Schuchardt8f75d592023-05-16 07:45:05 +020077The return value $? is 0 (true) on success, 1 (false) otherwise.