Lvgl file system on esp32 help needed

Description

Sorry for my bad english…

i’m tring to use the file system abstraction, because i want load some png’s from an sd card
for the imagebutton’s of my project, but i didn’t found a working example

this is my last try but i have compiling errors, where is the error? what i’m doing wrong?

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

i’m using a display with esp32 model: 3.2inch_ESP32-2432S032
and i’m working with platformio on visual studio code

What LVGL version are you using?

8.3

What do you want to achieve?

i want use the file system lvgl abstraction

What have you tried so far?

i tried to follow all guidelines but i dont’ have found a working example
i’ve added the ff15 library in my .pio/libdeps/esp32dev folder

Code to reproduce

/*You code here*/
#include <Arduino.h>
#include <SD.h>
#include "SPI.h"
#include <extra/libs/fsdrv/lv_fsdrv.h>

#define SD_CS 5
#define SPI_MOSI 23
#define SPI_MISO 19
#define SPI_SCK 18
#define DRIVE_LETTER 'S'

File root;

void printDirectory(File dir, int numTabs);

SPIClass spi = SPIClass(VSPI);

/*Initialize your Storage device and File system.*/
void Helix_Memory_init()
{
    pinMode(SD_CS, OUTPUT);
    digitalWrite(SD_CS, HIGH);
    SPI.begin(SPI_SCK, SPI_MISO, SPI_MOSI);
    SPI.setFrequency(1000000);

    if (!SD.begin())
    {
        Serial.println("Card Mount Failed");
        return;
    }

    uint8_t cardType = SD.cardType();

    if (cardType == CARD_NONE)
    {
        Serial.println("No SD card attached");
        return;
    }

    Serial.print("SD Card Type: ");
    if (cardType == CARD_MMC)
    {
        Serial.println("MMC");
    }
    else if (cardType == CARD_SD)
    {
        Serial.println("SDSC");
    }
    else if (cardType == CARD_SDHC)
    {
        Serial.println("SDHC");
    }
    else
    {
        Serial.println("UNKNOWN");
    }

    uint64_t cardSize = SD.cardSize() / (1024 * 1024);
    Serial.printf("SD Card Size: %lluMB\n", cardSize);

  root = SD.open("/");

  printDirectory(root, 0);

  Serial.println("done!");

//  LV_FileSystem_Initialize();

    lv_fs_fatfs_init();

   // lv_obj_t * img_bin = lv_img_create(lv_scr_act());
    //lv_img_set_src(img_bin, "S:/Baboon40.bin");
    //lv_obj_align(img_bin, LV_ALIGN_CENTER, 0, 0);
    //lv_obj_set_size(img_bin, 320,480);


  Serial.println("Setup done");
}
void Helix_Memory_loop()
{
}

void printDirectory(File dir, int numTabs) {
  while (true) {

    File entry =  dir.openNextFile();
    if (! entry) {
      // no more files
      break;
    }
    for (uint8_t i = 0; i < numTabs; i++) {
      Serial.print('\t');
    }
    Serial.print(entry.name());
    if (entry.isDirectory()) {
      Serial.println("/");
      printDirectory(entry, numTabs + 1);
    } else {
      // files have sizes, directories do not
      Serial.print("\t\t");
      Serial.println(entry.size(), DEC);
    }
    entry.close();
  }
}

Errors

.pio/libdeps/esp32dev/lvgl/src/extra/libs/fsdrv/lv_fs_fatfs.c: In function ‘fs_dir_open’:
.pio/libdeps/esp32dev/lvgl/src/extra/libs/fsdrv/lv_fs_fatfs.c:228:5: error: unknown type name ‘DIR’; did you mean ‘DDR’?
DIR * d = lv_mem_alloc(sizeof(DIR));
^~~
DDR
.pio/libdeps/esp32dev/lvgl/src/extra/libs/fsdrv/lv_fs_fatfs.c:228:35: error: ‘DIR’ undeclared (first use in this function); did you mean ‘DDR’?
DIR * d = lv_mem_alloc(sizeof(DIR));
^~~
DDR
.pio/libdeps/esp32dev/lvgl/src/extra/libs/fsdrv/lv_fs_fatfs.c:228:35: note: each undeclared identifier is reported only once for each function it appears in
.pio/libdeps/esp32dev/lvgl/src/extra/libs/fsdrv/lv_fs_fatfs.c:231:29: warning: passing argument 1 of ‘f_opendir’ from incompatible pointer type [-Wincompatible-pointer-types]
FRESULT res = f_opendir(d, path);
^
In file included from .pio/libdeps/esp32dev/lvgl/src/extra/libs/fsdrv/lv_fs_fatfs.c:12:
C:/Users/stefa/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/include/fatfs/src/ff.h:290:28: note: expected 'FF_DIR ’ {aka 'struct '} but argument is of type 'int
FRESULT f_opendir (FF_DIR
dp, const TCHAR
path); /
Open a directory */
~~~~~~~~^~
*** [.pio\build\esp32dev\libc58\lvgl\extra\libs\fsdrv\lv_fs_fatfs.c.o] Error 1
========================================================================= [FAILED] Took 8.19 seconds =========================================================================

  • The terminal process “C:\Users\stefa.platformio\penv\Scripts\platformio.exe ‘run’” terminated with exit code: 1.
  • Terminal will be reused by tasks, press any key to close it.

I hope this example reference can help you::https://github.com/100askTeam/esp-arduino-learn/blob/master/examples/08_integrated/01_lcd_sd_card_fc_joypad_fs_lv_lib_100ask/01_lcd_sd_card_fc_joypad_fs_lv_lib_100ask.ino

i’v modified my code a bit, and now i’m able to compile.

#include <Arduino.h>
#include <SD.h>
#include "SPI.h"
#include <lvgl.h>

#define SD_CS 5
#define SPI_MOSI 23
#define SPI_MISO 19
#define SPI_SCK 18
#define DRIVE_LETTER 'S'

File root;

void printDirectory(File dir, int numTabs);
void lv_port_sd_fs_init(void);
static SPIClass spi = SPIClass(VSPI);

/*Initialize your Storage device and File system.*/
void Helix_Memory_init() {
  lv_port_sd_fs_init();
}

void Helix_SD_init()
{

    pinMode(SD_CS, OUTPUT);
    digitalWrite(SD_CS, HIGH);
    SPI.begin(SPI_SCK, SPI_MISO, SPI_MOSI);
    SPI.setFrequency(1000000);

    if (!SD.begin())
    {
        Serial.println("Card Mount Failed");
        return;
    }

    uint8_t cardType = SD.cardType();

    if (cardType == CARD_NONE)
    {
        Serial.println("No SD card attached");
        return;
    }

    Serial.print("SD Card Type: ");
    if (cardType == CARD_MMC)
    {
        Serial.println("MMC");
    }
    else if (cardType == CARD_SD)
    {
        Serial.println("SDSC");
    }
    else if (cardType == CARD_SDHC)
    {
        Serial.println("SDHC");
    }
    else
    {
        Serial.println("UNKNOWN");
    }

    uint64_t cardSize = SD.cardSize() / (1024 * 1024);
    Serial.printf("SD Card Size: %lluMB\n", cardSize);

  Serial.println("done!");

}
void Helix_Memory_loop()
{
}

/*------*/

static void *sd_fs_open(lv_fs_drv_t *drv, const char *path, lv_fs_mode_t mode) {
  LV_UNUSED(drv);

  const char *flags = "";

  if (mode == LV_FS_MODE_WR)
    flags = FILE_WRITE;
  else if (mode == LV_FS_MODE_RD)
    flags = FILE_READ;
  else if (mode == (LV_FS_MODE_WR | LV_FS_MODE_RD))
    flags = FILE_WRITE;

  File f = SD.open(path, flags);
  if (!f) {
    Serial.println("Failed to open file!");
    return NULL;
  }

  File *lf = new File{ f };

  //make sure at the beginning
  //fp->seek(0);

  return (void *)lf;
}

static lv_fs_res_t sd_fs_close(lv_fs_drv_t *drv, void *file_p) {
  LV_UNUSED(drv);

  File *fp = (File *)file_p;

  fp->close();

  delete (fp);  // when close
  return LV_FS_RES_OK;
}

static lv_fs_res_t sd_fs_read(lv_fs_drv_t *drv, void *file_p, void *fileBuf, uint32_t btr, uint32_t *br) {
  LV_UNUSED(drv);

  File *fp = (File *)file_p;

  *br = fp->read((uint8_t *)fileBuf, btr);

  return (int32_t)(*br) < 0 ? LV_FS_RES_UNKNOWN : LV_FS_RES_OK;
}

static lv_fs_res_t sd_fs_write(lv_fs_drv_t *drv, void *file_p, const void *buf, uint32_t btw, uint32_t *bw) {
  LV_UNUSED(drv);

  File *fp = (File *)file_p;

  *bw = fp->write((const uint8_t *)buf, btw);

  return (int32_t)(*bw) < 0 ? LV_FS_RES_UNKNOWN : LV_FS_RES_OK;
}

static lv_fs_res_t sd_fs_seek(lv_fs_drv_t *drv, void *file_p, uint32_t pos, lv_fs_whence_t whence) {
  LV_UNUSED(drv);

  File *fp = (File *)file_p;

  SeekMode mode;
  if (whence == LV_FS_SEEK_SET)
    mode = SeekSet;
  else if (whence == LV_FS_SEEK_CUR)
    mode = SeekCur;
  else if (whence == LV_FS_SEEK_END)
    mode = SeekEnd;

  fp->seek(pos, mode);

  return LV_FS_RES_OK;
}

static lv_fs_res_t sd_fs_tell(lv_fs_drv_t *drv, void *file_p, uint32_t *pos_p) {
  LV_UNUSED(drv);

  File *fp = (File *)file_p;

  *pos_p = fp->position();

  return LV_FS_RES_OK;
}

static void *sd_dir_open(lv_fs_drv_t *drv, const char *dirpath) {
  LV_UNUSED(drv);

  File root = SD.open(dirpath);
  if (!root) {
    Serial.println("Failed to open directory!");
    return NULL;
  }

  if (!root.isDirectory()) {
    Serial.println("Not a directory!");
    return NULL;
  }

  File *lroot = new File{ root };

  return (void *)lroot;
}

static lv_fs_res_t sd_dir_read(lv_fs_drv_t *drv, void *dir_p, char *fn) {
  LV_UNUSED(drv);

  File *root = (File *)dir_p;
  fn[0] = '\0';

  File file = root->openNextFile();
  while (file) {
    if (strcmp(file.name(), ".") == 0 || strcmp(file.name(), "..") == 0) {
      continue;
    } else {
      if (file.isDirectory()) {
        Serial.print("  DIR : ");
        Serial.println(file.name());
        fn[0] = '/';
        strcpy(&fn[1], file.name());
      } else {
        Serial.print("  FILE: ");
        Serial.print(file.name());
        Serial.print("  SIZE: ");
        Serial.println(file.size());

        strcpy(fn, file.name());
      }
      break;
    }
    file = root->openNextFile();
  }

  return LV_FS_RES_OK;
}

static lv_fs_res_t sd_dir_close(lv_fs_drv_t *drv, void *dir_p) {
  LV_UNUSED(drv);

  File *root = (File *)dir_p;

  root->close();

  delete (root);  // when close

  return LV_FS_RES_OK;
}

void lv_port_sd_fs_init(void) {
  /*----------------------------------------------------
    * Initialize your storage device and File System
    * -------------------------------------------------*/

Helix_SD_init();
  //fs_init();

  /*---------------------------------------------------
    * Register the file system interface in LVGL
    *--------------------------------------------------*/

  /*Add a simple drive to open images*/
  static lv_fs_drv_t fs_drv;
  lv_fs_drv_init(&fs_drv);
  Serial.println("drv_init");
  /*Set up fields...*/
  fs_drv.letter = 'S';
  fs_drv.cache_size = 0;

  fs_drv.open_cb = sd_fs_open;
  fs_drv.close_cb = sd_fs_close;
  fs_drv.read_cb = sd_fs_read;
  fs_drv.write_cb = sd_fs_write;
  fs_drv.seek_cb = sd_fs_seek;
  fs_drv.tell_cb = sd_fs_tell;

  fs_drv.dir_close_cb = sd_dir_close;
  fs_drv.dir_open_cb = sd_dir_open;
  fs_drv.dir_read_cb = sd_dir_read;
  Serial.println("callbacks ok");
  lv_fs_drv_register(&fs_drv);
  Serial.println("drv_registered");
}

but on the lv_fs_drv_register(&fs_drv);
the esp crash and reboot.
this is my terminal output:

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:1184
load:0x40078000,len:13192
load:0x40080400,len:3028
entry 0x400805e4
Serial: Initialized
Software Version: 1.4 OTA
SD Card Type: SDHC
SD Card Size: 7624MB
done!
drv_init
callbacks ok
Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.

Core  1 register dump:
PC      : 0x400e6d57  PS      : 0x00060c30  A0      : 0x800e6f41  A1      : 0x3ffb2160  
A2      : 0x00000000  A3      : 0x0000000c  A4      : 0x00000010  A5      : 0xffffffff  
A6      : 0x3ffb833c  A7      : 0x00000000  A8      : 0x00000000  A9      : 0x00000003  
A10     : 0xffffffff  A11     : 0x3ffb2168  A12     : 0x3ffb216c  A13     : 0x00000000  
A14     : 0x3ffb833c  A15     : 0x00000000  SAR     : 0x00000004  EXCCAUSE: 0x0000001c  
EXCVADDR: 0x00000014  LBEG    : 0x40087605  LEND    : 0x40087615  LCOUNT  : 0xfffffffc  


Backtrace: 0x400e6d54:0x3ffb2160 0x400e6f3e:0x3ffb2190 0x400e54a2:0x3ffb21b0 0x400e5210:0x3ffb21d0 0x400e50ce:0x3ffb21f0 0x400d240d:0x3ffb2220 0x400d241f:0x3ffb2240 0x400d2795:0x3ffb2260 0x400ffe66:0x3ffb2290

  #0  0x400e6d54:0x3ffb2160 in search_suitable_block at .pio/libdeps/esp32dev/lvgl/src/misc/lv_tlsf.c:564
      (inlined by) block_locate_free at .pio/libdeps/esp32dev/lvgl/src/misc/lv_tlsf.c:770
  #1  0x400e6f3e:0x3ffb2190 in lv_tlsf_malloc at .pio/libdeps/esp32dev/lvgl/src/misc/lv_tlsf.c:1102
  #2  0x400e54a2:0x3ffb21b0 in lv_mem_alloc at .pio/libdeps/esp32dev/lvgl/src/misc/lv_mem.c:134
      (inlined by) lv_mem_alloc at .pio/libdeps/esp32dev/lvgl/src/misc/lv_mem.c:125
  #3  0x400e5210:0x3ffb21d0 in _lv_ll_ins_head at .pio/libdeps/esp32dev/lvgl/src/misc/lv_ll.c:71
  #4  0x400e50ce:0x3ffb21f0 in lv_fs_drv_register at .pio/libdeps/esp32dev/lvgl/src/misc/lv_fs.c:402
  #5  0x400d240d:0x3ffb2220 in lv_port_sd_fs_init() at src/Helix_Memory.cpp:288
  #6  0x400d241f:0x3ffb2240 in Helix_Memory_init() at src/Helix_Memory.cpp:21
  #7  0x400d2795:0x3ffb2260 in setup() at src/main.cpp:19
  #8  0x400ffe66:0x3ffb2290 in loopTask(void*) at C:/Users/stefa/.platformio/packages/framework-arduinoespressif32/cores/esp32/main.cpp:42




ELF file SHA256: fb088012637efe99

Rebooting...

any suggestions?
what i’m doing wrong now?

i’ve modified again my code

this is my Helix_Memory.cpp

#include <Arduino.h>
#include <SD.h>
#include "SPI.h"
#include <lvgl.h>
#include <FS.h>

#define SD_CS 5
#define SPI_MOSI 23
#define SPI_MISO 19
#define SPI_SCK 18
#define DRIVE_LETTER 'S'

File root;

void printDirectory(File dir, int numTabs);
void lv_port_sd_fs_init(void);
static SPIClass spi = SPIClass(VSPI);

/*Initialize your Storage device and File system.*/
void Helix_Memory_init() {

  lv_port_sd_fs_init();
}

void Helix_SD_init()
{

    pinMode(SD_CS, OUTPUT);
    digitalWrite(SD_CS, HIGH);
    SPI.begin(SPI_SCK, SPI_MISO, SPI_MOSI);
    SPI.setFrequency(1000000);

    if (!SD.begin())
    {
        Serial.println("Card Mount Failed");
        return;
    }

    uint8_t cardType = SD.cardType();

    if (cardType == CARD_NONE)
    {
        Serial.println("No SD card attached");
        return;
    }

    Serial.print("SD Card Type: ");
    if (cardType == CARD_MMC)
    {
        Serial.println("MMC");
    }
    else if (cardType == CARD_SD)
    {
        Serial.println("SDSC");
    }
    else if (cardType == CARD_SDHC)
    {
        Serial.println("SDHC");
    }
    else
    {
        Serial.println("UNKNOWN");
    }

    uint64_t cardSize = SD.cardSize() / (1024 * 1024);
    Serial.printf("SD Card Size: %lluMB\n", cardSize);


  root = SD.open("/");

  printDirectory(root, 0);

  Serial.println("done!");

}
void Helix_Memory_loop()
{
}

/*------*/

static void *sd_fs_open(lv_fs_drv_t *drv, const char *path, lv_fs_mode_t mode) {
  LV_UNUSED(drv);

  const char *flags = "";

  if (mode == LV_FS_MODE_WR)
    flags = FILE_WRITE;
  else if (mode == LV_FS_MODE_RD)
    flags = FILE_READ;
  else if (mode == (LV_FS_MODE_WR | LV_FS_MODE_RD))
    flags = FILE_WRITE;

  File f = SD.open(path, flags);
  if (!f) {
    Serial.println("Failed to open file!");
    return NULL;
  }

  File *lf = new File{ f };

  //make sure at the beginning
  //fp->seek(0);

  return (void *)lf;
}

static lv_fs_res_t sd_fs_close(lv_fs_drv_t *drv, void *file_p) {
  LV_UNUSED(drv);

  File *fp = (File *)file_p;

  fp->close();

  delete (fp);  // when close
  return LV_FS_RES_OK;
}

static lv_fs_res_t sd_fs_read(lv_fs_drv_t *drv, void *file_p, void *fileBuf, uint32_t btr, uint32_t *br) {
  LV_UNUSED(drv);

  File *fp = (File *)file_p;

  *br = fp->read((uint8_t *)fileBuf, btr);

  return (int32_t)(*br) < 0 ? LV_FS_RES_UNKNOWN : LV_FS_RES_OK;
}

static lv_fs_res_t sd_fs_write(lv_fs_drv_t *drv, void *file_p, const void *buf, uint32_t btw, uint32_t *bw) {
  LV_UNUSED(drv);

  File *fp = (File *)file_p;

  *bw = fp->write((const uint8_t *)buf, btw);

  return (int32_t)(*bw) < 0 ? LV_FS_RES_UNKNOWN : LV_FS_RES_OK;
}

static lv_fs_res_t sd_fs_seek(lv_fs_drv_t *drv, void *file_p, uint32_t pos, lv_fs_whence_t whence) {
  LV_UNUSED(drv);

  File *fp = (File *)file_p;

  SeekMode mode;
  if (whence == LV_FS_SEEK_SET)
    mode = SeekSet;
  else if (whence == LV_FS_SEEK_CUR)
    mode = SeekCur;
  else if (whence == LV_FS_SEEK_END)
    mode = SeekEnd;

  fp->seek(pos, mode);

  return LV_FS_RES_OK;
}

static lv_fs_res_t sd_fs_tell(lv_fs_drv_t *drv, void *file_p, uint32_t *pos_p) {
  LV_UNUSED(drv);

  File *fp = (File *)file_p;

  *pos_p = fp->position();

  return LV_FS_RES_OK;
}

static void *sd_dir_open(lv_fs_drv_t *drv, const char *dirpath) {
  LV_UNUSED(drv);

  File root = SD.open(dirpath);
  if (!root) {
    Serial.println("Failed to open directory!");
    return NULL;
  }

  if (!root.isDirectory()) {
    Serial.println("Not a directory!");
    return NULL;
  }

  File *lroot = new File{ root };

  return (void *)lroot;
}

static lv_fs_res_t sd_dir_read(lv_fs_drv_t *drv, void *dir_p, char *fn) {
  LV_UNUSED(drv);

  File *root = (File *)dir_p;
  fn[0] = '\0';

  File file = root->openNextFile();
  while (file) {
    if (strcmp(file.name(), ".") == 0 || strcmp(file.name(), "..") == 0) {
      continue;
    } else {
      if (file.isDirectory()) {
        Serial.print("  DIR : ");
        Serial.println(file.name());
        fn[0] = '/';
        strcpy(&fn[1], file.name());
      } else {
        Serial.print("  FILE: ");
        Serial.print(file.name());
        Serial.print("  SIZE: ");
        Serial.println(file.size());

        strcpy(fn, file.name());
      }
      break;
    }
    file = root->openNextFile();
  }

  return LV_FS_RES_OK;
}

static lv_fs_res_t sd_dir_close(lv_fs_drv_t *drv, void *dir_p) {
  LV_UNUSED(drv);

  File *root = (File *)dir_p;

  root->close();

  delete (root);  // when close

  return LV_FS_RES_OK;
}

void lv_port_sd_fs_init(void) {
  /*----------------------------------------------------
    * Initialize your storage device and File System
    * -------------------------------------------------*/

//Helix_SD_init();
  //fs_init();

  /*---------------------------------------------------
    * Register the file system interface in LVGL
    *--------------------------------------------------*/

  /*Add a simple drive to open images*/
  static lv_fs_drv_t fs_drv;
  lv_fs_drv_init(&fs_drv);
  Serial.println("drv_init");
  /*Set up fields...*/
  fs_drv.letter = 'S';
  fs_drv.cache_size = 0;

  fs_drv.open_cb = sd_fs_open;
  fs_drv.close_cb = sd_fs_close;
  fs_drv.read_cb = sd_fs_read;
  fs_drv.write_cb = sd_fs_write;
  fs_drv.seek_cb = sd_fs_seek;
  fs_drv.tell_cb = sd_fs_tell;

  fs_drv.dir_close_cb = sd_dir_close;
  fs_drv.dir_open_cb = sd_dir_open;
  fs_drv.dir_read_cb = sd_dir_read;
  Serial.println("callbacks ok");
  lv_fs_drv_register(&fs_drv);
  Serial.println("drv_registered");
}



void printDirectory(File dir, int numTabs) {
  while (true) {

    File entry =  dir.openNextFile();
    if (! entry) {
      // no more files
      break;
    }
    for (uint8_t i = 0; i < numTabs; i++) {
      Serial.print('\t');
    }
    Serial.print(entry.name());
    if (entry.isDirectory()) {
      Serial.println("/");
      printDirectory(entry, numTabs + 1);
    } else {
      // files have sizes, directories do not
      Serial.print("\t\t");
      Serial.println(entry.size(), DEC);
    }
    entry.close();
  }
}

and this is my Main.cpp

#include <Arduino.h>
#include "Helix_Display.h"
#include "Helix_Sensors.h"
#include "Helix_Memory.h"
#include "lvgl.h"
#include "ui.h"

#define VERSION "1.4 OTA"


void setup()
{
  Serial.begin(115200);

  while (!Serial)
    // time to get serial running
  Serial.println("System Starting...");
  Serial.println("Serial: Initialized");
  Serial.print("Software Version: ");
  Serial.println(VERSION);

  //lv_log_register_print_cb(my_print);
  Helix_SD_init();
  Helix_Display_init();
  Helix_Sensors_init();
  Helix_Memory_init();

lv_img_set_src(ui_Image1,  "S:/Background.bin");

}

void loop()
{
  Helix_Sensors_loop();
}

so :

  • i initialize the sd with Helix_SD_init();
  • i start LVGL with Helix_Display_init(); in this function i call lv_init() (this is the solution of the crash, i forget to call lv_init() before register the drive)
  • then i Register the file system interface in LVGL with Helix_Memory_init();

but when i call: lv_img_set_src(ui_Image1, “S:Background.bin”);
(i made my ui with squareline studio) this is the response:

[  3468][E][vfs_api.cpp:29] open(): Background.bin does not start with /
Failed to open file!

and this is the full log

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:1184 
load:0x40078000,len:13192
load:0x40080400,len:3028 
entry 0x400805e4
Serial: Initialized      
Software Version: 1.4 OTA
SD Card Type: SDHC        
SD Card Size: 7624MB      
System Volume Information/
        WPSettings.dat          12
        IndexerVolumeGuid               76
Background.png          44838
Background.bin          76804
Background.jpg          6607 
Background.bmp          77878      
done!
Initializing display
Setting display Communication speed
Configuring backlight
Display colors test  
Initializing GUI Library
Initializing Touch Screen Library
Adapt GUI to display size        
Allocating LVGL disp_draw_buf    
LVGL disp_draw_buf allocate succeeded!
LVGL display buffer initialized!      
LVGL display driver initialized!      
LVGL display driver registered!
LVGL touch driver Initialized! 
LVGL touch driver registered!  
User Interface initialized!
guiLoop: Allocated
Setup done
guiLoop: Started
drv_init
callbacks ok
drv_registered
[  3468][E][vfs_api.cpp:29] open(): Background.bin does not start with /
Failed to open file!
Read Sensors
Temp: 23.55      Humidity: 48.07

as you can see when i initialize the sd card i list the files in the root.
but i’m unable to load it with lvgl.
i’ve tried with different paths ( “S:/Background.bin” or “S/Background.bin” or “/Background.bin”) but there is always errors

with “S:\0:Background.bin” there is no errors but nothing happen,
no image shown
with “S:Background.bin” the error is:

[  3467][E][vfs_api.cpp:29] open(): Background.bin does not start with /
Failed to open file!

and in the : https://github.com/100askTeam/esp-arduino-learn/blob/master/examples/08_integrated/01_lcd_sd_card_fc_joypad_fs_lv_lib_100ask/01_lcd_sd_card_fc_joypad_fs_lv_lib_100ask.ino
i don’t understand where is used FS.h library