[U-Boot] Error reading cluster" from fs/fat/fat.c

Oliver Graute oliver.graute at kococonnector.com
Mon Aug 26 07:39:55 UTC 2019


On 22/08/19, Oliver Graute wrote:
> Hello list,
> 
> I have a annoying problem with u-boot 2019.07. I try to boot a Linux
> Image from a fat16 partition on a SD-Card. But I got the "Error reading
> cluster" Message from fs/fat/fat.c
> 
> => boot
> switch to partitions #0, OK
> mmc2 is current device
> Error reading cluster
> ** Unable to read file Image **
> 
> => mmc part
> Partition Map for MMC device 2  --   Partition Type: DOS
> Part    Start Sector    Num Sectors     UUID            Type
>   1     16384           266240          d38187c8-01     06
>   2     282624          7491584         d38187c8-02     83
> 
> After some debugging I end up in blk_dread() from drivers/block/blk-uclass.c
> 
> blks_read = ops->read(dev, start, blkcnt, buffer);
> 
> here I got blks_read=0 which seems is the cause for the "Error reading cluster"
> later in get_cluster().

After some more digging I found out that this error is related to the
file size. I can fatload files up to 16MB but no files with 24MB like the
Kernel Image. Is there some limitation somewhere?


U-Boot 2019.07-00001-g1c0a4f90ca-dirty (Aug 26 2019 - 08:36:06 +0200)

CPU:   NXP i.MX8QM RevB A53 at 1200 MHz

Model: Advantech iMX8QM Qseven series
Board: ROM-7720-A1 4GB
Build: SCFW 65afe5f6
Boot:  SD2
DRAM:  3.9 GiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 2
Loading Environment from MMC... *** Warning - bad CRC, using default environment

In:    serial at 5a060000
Out:   serial at 5a060000
Err:   serial at 5a060000
Net:   eth0: ethernet at 5b040000Could not get PHY for FEC1: addr 1
, eth-1: ethernet at 5b050000
Hit any key to stop autoboot:  0
=> fatls mmc 2:1
            dtbs/
 24838656   Image
 10671566   Image.gz
 18734584   initramfs-linux-fallback.img
  7263143   initramfs-linux.img
    19136   imx8qm-rom7720-a1.dtb
   102464   hdmitxfw.bin
  1048576   1mb.txt
  2097152   2MB.txt
   524288   512kb.txt
   786432   768kb.txt
 16777216   16MB.txt
 25165824   24MB.txt
  4194304   4MB.txt
  8388608   8MB.txt

14 file(s), 1 dir(s)

=> fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} 512kb.txt
524288 bytes read in 33 ms (15.2 MiB/s)
=> fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} 768kb.txt
786432 bytes read in 43 ms (17.4 MiB/s)
=> fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} 1mb.txt
1048576 bytes read in 58 ms (17.2 MiB/s)
=> fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} 2mb.txt
2097152 bytes read in 98 ms (20.4 MiB/s)
=> fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} 4mb.txt
4194304 bytes read in 190 ms (21.1 MiB/s)
=> fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} 8mb.txt
8388608 bytes read in 365 ms (21.9 MiB/s)
=> fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} 16mb.txt
16777216 bytes read in 724 ms (22.1 MiB/s)
=> fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} 24mb.txt
Error reading cluster 3
** Unable to read file 24mb.txt **
=>


Best regards,

Oliver


More information about the U-Boot mailing list