]> git.ipfire.org Git - thirdparty/u-boot.git/blame - doc/usage/cmd/saves.rst
doc: create index entries for commands
[thirdparty/u-boot.git] / doc / usage / cmd / saves.rst
CommitLineData
cf376808
HS
1.. SPDX-License-Identifier: GPL-2.0+:
2
60971e63
HS
3.. index::
4 single: saves (command)
5
cf376808
HS
6saves command
7=============
8
9Synopsis
10--------
11
12::
13
14 saves [offset [size [baud]]]
15
16Description
17-----------
18
19The *saves* command is used to transfer a file from the device via the serial
20line using the Motorola S-record file format.
21
22offset
23 start address of memory area to save, defaults to 0x0
24
25size
26 size of memory area to save, defaults to 0x0
27
28baud
29 baud rate to use for upload. This parameter is only available if
30 CONFIG_SYS_LOADS_BAUD_CHANGE=y
31
32Example
33-------
34
35In the example the *screen* command is used to connect to the U-Boot serial
36console.
37
38In a first screen session a file is loaded from the SD-card and the *saves*
39command is invoked. <CTRL+A><k> is used to kill the screen session.
40
41A new screen session is started which logs the output to a file and the
42<ENTER> key is hit to start the file output. <CTRL+A><k> is issued to kill the
43screen session.
44
45The log file is converted to a binary file using the *srec_cat* command.
46A negative offset of -1337982976 (= -0x4c000000) is applied to compensate for
47the offset used in the *saves* command.
48
49.. code-block::
50
51 $ screen /dev/ttyUSB0 115200
52 => echo $scriptaddr
53 0x4FC00000
54 => load mmc 0:1 $scriptaddr boot.txt
55 124 bytes read in 1 ms (121.1 KiB/s)
56 => saves $scriptaddr $filesize
57 ## Ready for S-Record upload, press ENTER to proceed ...
58 Really kill this window [y/n]
59 $ screen -Logfile out.srec -L /dev/ttyUSB0 115200
60 S0030000FC
61 S3154FC00000736574656E76206175746F6C6F616420AD
62 S3154FC000106E6F0A646863700A6C6F6164206D6D633E
63 S3154FC0002020303A3120246664745F616464725F72B3
64 S3154FC00030206474620A6C6F6164206D6D6320303AC0
65 S3154FC000403120246B65726E656C5F616464725F72DA
66 S3154FC0005020736E702E6566690A626F6F74656669C6
67 S3154FC0006020246B65726E656C5F616464725F7220CB
68 S3114FC00070246664745F616464725F720A38
69 S70500000000FA
70 ## S-Record upload complete
71 =>
72 Really kill this window [y/n]
73 $ srec_cat out.srec -offset -1337982976 -Output out.txt -binary 2>/dev/null
74 $ cat out.txt
75 setenv autoload no
76 dhcp
77 load mmc 0:1 $fdt_addr_r dtb
78 load mmc 0:1 $kernel_addr_r snp.efi
79 bootefi $kernel_addr_r $fdt_addr_r
80 $
81
82Configuration
83-------------
84
85The command is only available if CONFIG_CMD_SAVES=y. The parameter to set the
86baud rate is only available if CONFIG_SYS_LOADS_BAUD_CHANGE=y
87
88Return value
89------------
90
91The return value $? is 0 (true) on success, 1 (false) otherwise.