The problem of partial image loading via FatFs

Description

Hi everyone, They are developing one project, I include image files as arrays, everything works perfectly. I decided to switch to storing files on a USB flash drive. Enabled Ntfs support, files are successfully written and read. In the image loading code, I changed the line: it was - /lv_img_set_src(img1, &bg_block); it became - lv_img_set_src(img1, "F:/bg_clock_passat.bin ");
I run the program: the picture is loaded partially (see photo # 1), when debugging is enabled, this is written:
[Warn] (1.357, +272) _lv_img_cache_open: Image draw cannot open the image resource (in lv_img_cache.c line #125)
[Warn] (1.357, +0) lv_draw_img: Image draw error (in lv_draw_img.c line #81)
[Warn] (1.389, +32) _lv_img_cache_open: Image draw cannot open the image resource (in lv_img_cache.c line #125)
[Warn] (1.390, +1) lv_draw_img: Image draw error (in lv_draw_img.c line #81)
[Warn] (1.394, +4) _lv_img_cache_open: Image draw cannot open the image resource (in lv_img_cache.c line #125)
[Warn] (1.395, +1) lv_draw_img: Image draw error (in lv_draw_img.c line #81)
[Warn] (1.399, +4) _lv_img_cache_open: Image draw cannot open the image resource (in lv_img_cache.c line #125)
[Warn] (1.400, +1) lv_draw_img: Image draw error (in lv_draw_img.c line #81)
I raise the debugging level to Trace and the picture starts loading completely (see photo #2)

The image file is successfully read through the FATF:
lv_fs_fatfs_init OK;
Initializing W25Q: OK
f_mount(&FileSystemObject,3 ,1) → 0
f_chdrive(3:) → 0
f_get free(0:, &fre_clust, &FileSystemObject) → 0
The total amount of disk space is 2013 KB. A library of 1989 is available.

Root directory:
FILE log.txt size 53
FILE log1.txt size 526
FILE log2.txt size 1100
The size of the bg_clock_passat file.bin 58628
THE test_o_cr_file FILE.hopper size 115204
(total: 0 folders, 5 files)

What could be my mistake?

What MCU/Processor/Board and compiler are you using?

STM32F413

What LVGL version are you using?

v.8.3.3

What do you want to achieve?

What have you tried so far

What have you tried so far?

changed the display update time in lv_conf.h, tried to pass the debugger on the code

Code to reproduce

The code block(s) should be formatted like:

/*API for FATFS (needs to be added separately). Uses f_open, f_read, etc*/
#define LV_USE_FS_FATFS 1
#if LV_USE_FS_FATFS
    #define LV_FS_FATFS_LETTER 'F'     /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
    #define LV_FS_FATFS_CACHE_SIZE 0    /*>0 to cache this number of bytes in lv_fs_read()*/
#endif


		 lv_obj_t * img1 = lv_img_create(screen_metrics_clock);
		 lv_img_set_src(img1, "F:/bg_clock_passat.bin");
		 lv_obj_align(img1, LV_ALIGN_CENTER, 0, 0);
		 lv_obj_set_style_img_recolor_opa(img1, 50, 0);
		 lv_obj_set_size(img1, GetWidthLCD(), GetHeightLCD());

Screenshot and/or video

Photo1 -


Photo2 -

You can try another fs mode.

    #define LV_USE_FS_STDIO 1

I use this one, works well. But I comment out this line:

    if((*drv)->letter == letter) {

Because I don’t want to specify a drive letter.

Your img path “F:/bg_clock_passat.bin” seems strange. lvgl cannot undstand the format of “.bin”, please specify bmp, png, jpg or gif, to let lvgl choose a correct img decoder.