[U-Boot] SPL: Reading large files with file_fat_read()

bin4ry 0xbin4ry at gmail.com
Tue Oct 1 17:06:38 CEST 2013


Hi,

I need to read a file in spl.c, which is about 675 bytes. I used the
following code:

static unsigned char helperData[675] = {0x00};
s32 err;
uint8_t i = 0;

printf("\n[D] - Reading Helper Data\r\n\n");
err = file_fat_read(filename, helperData, length);
    if(err > 0){
        printf("[D] - Received Helper Data (%d bytes):\n", err);
        for(i = 0; i < err; i++){
            if((i%9==0)&&i>0)    printf("\n");
            printf("0x%02x ", helperData[i]);
        }
    }else{
        printf("[E] - Error reading Helper Data file %s from MMC\n",
filename);
    }
    puts("");

However, during boot time it stucks while reading the file. It only outputs:

reading foo.bar

It works with smaller files fine. Do I need to implement changes to
do_fat_read() in fat.c or what could be the problem?

Best regards,
-b


More information about the U-Boot mailing list