Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spiffs_create_partition_image fails on Clean Project. (IDFGH-2053) #4236

Closed
Nulifier opened this issue Oct 23, 2019 · 2 comments
Closed

spiffs_create_partition_image fails on Clean Project. (IDFGH-2053) #4236

Nulifier opened this issue Oct 23, 2019 · 2 comments

Comments

@Nulifier
Copy link

Environment

  • Development Kit: [none]
  • Module or chip used: [ESP32-WROOM-32U]
  • IDF version (run git describe --tags to find it):
    v4.0-beta1-134-gef17d8bba
  • Build System: [CMake]
  • Compiler version (run xtensa-esp32-elf-gcc --version to find it):
    xtensa-esp32-elf-gcc (crosstool-NG esp32-2019r1) 8.2.0
  • Operating System: [Windows]
  • Power Supply: [USB]

Problem Description

When I try to run idf menuconfig after a clean build and with no pre-existing sdkconfig file, the command does not complete.

Expected Behavior

The command configures the project and brings up the menu.

Actual Behavior

Cmake throws an error during the configure and the configure does not complete.

CMake Error at C:/node/libs/esp-idf/components/esptool_py/project_include.cmake:171 (file):
  file RELATIVE_PATH must be passed a full path to the file: FLASH_IN_PROJECT
Call Stack (most recent call first):
  C:/node/libs/esp-idf/components/spiffs/project_include.cmake:45 (esptool_py_flash_project_args)
  main/CMakeLists.txt:11 (spiffs_create_partition_image)

Steps to repropduce

I created a minimal reproduction here

  1. git clone --single-branch --branch spiffs-missing-partition https://github.com/Nulifier/esp-test.git
  2. cd esp-test
  3. idf.py menuconfig

Probable Cause

I did some poking around in components/spiffs/project_include.cmake and it looks like what is failing is it isn't getting an offset from parttool.py. I think what the problem is that the parttool.py cannot determine the offset of the storage partition as I can't run menuconfig to set the custom partitions.

I have tested that this problem is solvable by manually setting the custom partitions in sdkconfig and that is a workaround but there should be at least a better error message in the configuration when it cannot find the partition as this would also happen if the partition name was misspelled.

@github-actions github-actions bot changed the title spiffs_create_partition_image fails on Clean Project. spiffs_create_partition_image fails on Clean Project. (IDFGH-2053) Oct 23, 2019
@igrr
Copy link
Member

igrr commented Oct 23, 2019

In the case when a custom partition table is used, one would normally set it in sdkconfig.defaults file. This way the option will be applied when doing a clean build (without an sdkconfig file).

@Nulifier
Copy link
Author

That's good information to have and it resolves my initial error. This still does happen if you have the partition name misspelled. I think it would be beneficial to have a proper error message returned from parttool.py when the partition is missing as the current message would have you thinking that the path for the files you want to add to the partition is wrong.

I did some looking into where this error could be added and I noticed that when a partition cannot be found in parttool.py, the function just returns without throwing an error. See this line.

Would the solution be to raise a KeyError on this line instead of returning? I could create a pull request if thats a good solution.

espressif-bot pushed a commit that referenced this issue Nov 19, 2019
From issue:

I did some poking around in components/spiffs/project_include.cmake and
it looks like what is failing is it isn't getting an offset from
parttool.py. I think what the problem is that the parttool.py cannot
determine the offset of the storage partition as I can't run menuconfig
to set the custom partitions.

I have tested that this problem is solvable by manually setting the
custom partitions in sdkconfig and that is a workaround but there should
be at least a better error message in the configuration when it cannot
find the partition as this would also happen if the partition name was
misspelled.

Closes #4236
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants