LittleFS: fail to create partition image

anees.ahmad.jaffer
Posts: 16
Joined: Wed Sep 13, 2023 11:12 am

LittleFS: fail to create partition image

Postby anees.ahmad.jaffer » Mon Feb 09, 2026 11:03 am

I'm trying to use the CMakeLists.txt compile command to create and upload the file partition when I run the idf.py build command. I'm using IDF version 5.3.4.

I'm porting my code from using SPIFFS to LittleFS. I'm using joltwallet/littlefs. I've added it as a dependency using

Code: Select all

idf.py add-dependency joltwallet/littlefs==1.20.4
I am able to build successfully, but I want to be able to use the compile command to create and upload the file partition when I run the build command. On the ESP Component Registry page url=https://components.espressif.com/co ... anguage=en, it says to add the littlefs_create_partition_image command to the project CMakeList file. For my partition table:

Code: Select all

storage,    data,	littlefs,	0xac0000,	0x540000
I use this command:

Code: Select all

littlefs_create_partition_image(storage html FLASH_IN_PROJECT)
I get the error:

Code: Select all

PS C:\Users\Anees-Ahmad\Documents\ESP-IDF_Workspace\OTA\OTA-in-facekey\espota\FaceKey_ESPIDF> idf.py fullclean build
Executing action: fullclean
Executing action: remove_managed_components
Executing action: all (aliases: build)
Running cmake in directory C:\Users\Anees-Ahmad\Documents\ESP-IDF_Workspace\OTA\OTA-in-facekey\espota\FaceKey_ESPIDF\build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DPYTHON=c:\esp\tools\python_env\idf5.3_py3.11_env\Scripts\python.exe -DESP_PLATFORM=1 -DCCACHE_ENABLE=1 C:\Users\Anees-Ahmad\Documents\ESP-IDF_Workspace\OTA\OTA-in-facekey\espota\FaceKey_ESPIDF"...
-- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.50.0.windows.1")
CMake Error at CMakeLists.txt:17 (littlefs_create_partition_image):
  Unknown CMake command "littlefs_create_partition_image".


-- Configuring incomplete, errors occurred!
cmake failed with exit code 1, output of the command is in the C:\Users\Anees-Ahmad\Documents\ESP-IDF_Workspace\OTA\OTA-in-facekey\espota\FaceKey_ESPIDF\build\log\idf_py_stderr_output_35560 and C:\Users\Anees-Ahmad\Documents\ESP-IDF_Workspace\OTA\OTA-in-facekey\espota\FaceKey_ESPIDF\build\log\idf_py_stdout_output_35560
PS C:\Users\Anees-Ahmad\Documents\ESP-IDF_Workspace\OTA\OTA-in-facekey\espota\FaceKey_ESPIDF>

anees.ahmad.jaffer
Posts: 16
Joined: Wed Sep 13, 2023 11:12 am

Re: LittleFS: fail to create partition image

Postby anees.ahmad.jaffer » Mon Feb 09, 2026 11:13 am

Solved. You need to add the littlefs_create_partition_image() command after the line project(yourprojectname) in the main CMakeLists file. If its done before, the compiler doesn't know about the existence of the littlefs_create_partition_image() command yet

Who is online

Users browsing this forum: No registered users and 13 guests