Search code examples
linuxfileu-boot

Read files in u-boot


How can I read the file which is located on boot partition in u-boot? I can use fatload to read this file to ram but how then I can read it? I can write some additional command by u-boot makro U_BOOT_CMD but don't know how to use emmc and file there.


Solution

  • You could probably use a two steps approach, this would avoid using emmc specific code in your u-boot custom command:

    1. loading the file into memory,
    2. use a custom u-boot command for reading it from memory.

    For example:

    fatload mmc 0 0x3000000 file.bin
    m4xell 0x3000000
    

    Your custom m4xell u-boot command would then be able to access the file content at 0x3000000.