Found 2 other functions taking a
spiffs_config
argument:
Initializes the file system dynamic parameters and mounts the filesystem. If SPIFFS_USE_MAGIC is enabled the mounting may fail with SPIFFS_ERR_NOT_A_FS if the flash does not contain a recognizable file system. In this case, SPIFFS_format must be called prior to remounting.
Special function. This takes a spiffs config struct and returns the number of blocks this file system was formatted with. This function relies on that following info is set correctly in given config struct: phys_addr, log_page_size, and log_block_size. Also, hal_read_f must be set in the config struct. One must be sure of the correct page size and that the physical address is correct in the probed file system when calling this function. It is not checked if the phys_addr actually points to the start of the file system, so one might get a false positive if entering a phys_addr somewhere in the middle of the file system at block boundary. In addition, it is not checked if the page size is actually correct. If it is not, weird file system sizes will be returned. If this function detects a file system it returns the assumed file system size, which can be used to set the phys_size. Otherwise, it returns an error indicating why it is not regarded as a file system. Note: this function is not protected with SPIFFS_LOCK and SPIFFS_UNLOCK macros. It returns the error code directly, instead of as read by SPIFFS_errno.