0

I am working with an embedded board which supports u-boot.

I am trying to write and read the emmc device connected to the board, After read, i need to have a look at the contents and compare it with the data that I have written to it.

Is there a way I can log the output of the a u-boot command, when I read a block from eMMC and store it in an address and try to view the contents of it using:

mmc read 0x10700000 133120 1

mm.l 0x10700000

into a file and then can store the file in an emmc partition or a tftp server ?

Thank you for your time,

Nishad

nishad kamdar
  • 67
  • 2
  • 11
  • If you're typing U-Boot command at its CLI prompt, then you're probably using a (serial) terminal emulation program. The better terminal emulation programs have a logging capability. E.G. I typically use **minicom**, and can log (to a file on the host PC) the the entire boot dialog plus the Linux shell session. – sawdust Feb 07 '19 at 08:10
  • Hey, Thanks for the response, but I am using minicom too. What I am actually looking to find out is there a way to create a log file on the lines of – `mm.l 0x10700000 > filexxx.txt` – nishad kamdar Feb 12 '19 at 06:54

1 Answers1

0

The save command can be used to write memory to a file.

save file to a filesystem

save <interface> <dev[:part]> <addr> <filename> bytes [pos]
    - Save binary file 'filename' to partition 'part' on device
      type 'interface' instance 'dev' from addr 'addr' in memory.
      'bytes' gives the size to save in bytes and is mandatory.
      'pos' gives the file byte position to start writing to.
      If 'pos' is 0 or omitted, the file is written from the start.

Of cause this requires the file system to be writable. For FAT this implies building with CONFIG_FAT_WRITE=y.

Xypron
  • 2,215
  • 1
  • 12
  • 24
  • Hi, Thanks for the response, The save command does work, but it seems that the non-zero file position offsets are not yet supported. I am using Beagle Bone Black with u-boot-2018.01. `save mmc 0:1 0x10700000 hello.txt 1 0x45C0000 Error: non zero offset is currently not supported. ** Unable to write file hello.txt **` – nishad kamdar Feb 16 '19 at 06:50
  • In elder versions the FAT driver did not support this. You will have to upgrade your U-Boot to a current version (v2018.11 or later). – Xypron Feb 17 '19 at 08:08