Heinrich Schuchardt | 7349306 | 2023-05-16 07:43:01 +0200 | [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: loadb (command) |
| 5 | |
Heinrich Schuchardt | 7349306 | 2023-05-16 07:43:01 +0200 | [diff] [blame] | 6 | loadb command |
| 7 | ============= |
| 8 | |
| 9 | Synopsis |
| 10 | -------- |
| 11 | |
| 12 | :: |
| 13 | |
| 14 | loadb [addr [baud]] |
| 15 | |
| 16 | Description |
| 17 | ----------- |
| 18 | |
Heinrich Schuchardt | 9546a0e | 2023-06-25 23:22:44 +0200 | [diff] [blame] | 19 | The loadb command is used to transfer a file to the device via the serial line |
Heinrich Schuchardt | 7349306 | 2023-05-16 07:43:01 +0200 | [diff] [blame] | 20 | using the Kermit 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 Kermit 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 and G-Kermit |
| 36 | serve to transfer a file to a device. |
| 37 | |
| 38 | .. code-block:: bash |
| 39 | |
| 40 | picocom --baud 115200 --send-cmd "gkermit -iXvs" /dev/ttyUSB0 |
| 41 | |
| 42 | After entering the loadb command the key sequence <CTRL-A><CTRL-S> is used to |
| 43 | let picocom prompt for the file name. Picocom invokes G-Kermit for the file |
| 44 | transfer. |
| 45 | |
| 46 | :: |
| 47 | |
| 48 | => loadb 60800000 115200 |
| 49 | ## Ready for binary (kermit) download to 0x60800000 at 115200 bps... |
| 50 | |
| 51 | *** file: helloworld.efi |
| 52 | $ gkermit -iXvs helloworld.efi |
| 53 | G-Kermit 2.01, The Kermit Project, 2021-11-15 |
| 54 | Escape back to your local Kermit and give a RECEIVE command. |
| 55 | |
| 56 | KERMIT READY TO SEND... |
| 57 | | |
| 58 | *** exit status: 0 *** |
| 59 | ## Total Size = 0x00000c00 = 3072 Bytes |
| 60 | ## Start Addr = 0x60800000 |
| 61 | => |
| 62 | |
| 63 | The transfer can be cancelled by pressing <CTRL+C>. |
| 64 | |
| 65 | Configuration |
| 66 | ------------- |
| 67 | |
| 68 | The command is only available if CONFIG_CMD_LOADB=y. |
| 69 | |
| 70 | Return value |
| 71 | ------------ |
| 72 | |
| 73 | The return value $? is 0 (true) on success, 1 (false) on error. |