-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
Cant build Encryption flash, always partition orverlap or error (IDFGH-2344) #4474
Comments
Hi @filzek , Can you please give a little more detail: which configuration do you have set for flash encryption? what partition configuration do you have set, if it's a custom partition table then you share the contents of the CSV please? Also, what is the full output from the build both before and after the error output? Thanks, Angus |
send in private e-mail the files you requested |
Maybe this is the case: Please check bootloader size. |
Hi @filzek, Thanks for sending those files and logs. Will reply here as this may help other people who find similar problems.
You can ignore this error, it's a shortcoming in
If partition table offset is set to 0x9000, then the custom partition file (partitions.csv in your case) can't specify any partition at an offset less than 0xa000 - otherwise the partition collides with the partition table (which is 0x1000 bytes long). Please check the contents of your partitions.csv against the partition offset value set in sdkconfig. |
this is not the true problem, as even if try to build the example in esp-idf\examples\security\flash_encryption it return the same error. we did try to full remove esp-idf, uninstall esp-idf tool, and we reinstalled everything. still same error. now also, the idf.py menuconfig doesnt work. C:\Users\filze\Desktop\esp-idf\examples\security\flash_encryption>idf.py menuconfig C:\Users\filze\Desktop\esp-idf\examples\security\flash_encryption> |
Problem still, when following the example in flash_encryption the problem stills happen. C:\Users\filze\Desktop\esp-idf\examples\security\flash_encryption>idf.py build flash monitor During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): CMake Error at ../../../components/esptool_py/project_include.cmake:203 (file): Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): C:\Users\filze\Desktop\esp-idf\examples\security\flash_encryption> cant solve the problem |
We figure out all the problem, its beacuse its missing a basic information about the true offset for the initial partition table in menuconfig and the correct initial in the partition file, so, if fix both it will work great. To solve the problem, the example partitions_example.csv need to be fixed Name, Type, SubType, Offset, Size, Flagsnvs, data, nvs, 0xaa00, 0x6000, #the 0xaa00 example was incorrect related to 0x9000 Extra partition to demonstrate reading/writing of encrypted flashstorage, data, 0xff, 0x10A00, 0x1000, encrypted So, a mistake to increase both numbers in CSV and in menuconfig. Menuconfig 0x9000 is perfect, so, but in CSX it need to be at least 0xaa00 to do not colide. Example and messages are showing incorrect. doing it will build and boot. |
@filzek Glad you figured out. Suggest aligning your partition starts to multiples of 0x1000, ie use 0xa000 instead of 0xaa00 and 0x10000 instead of 0x10a00. Having first partition at 0xa000 with partition table at 0x9000 will not collide. |
Previous version used exception handling for program control flow, which makes for long and confusing backtrace messages if an error occurs while parsing the CSV (as it also prints the phony error that occurred while trying to parse as a binary, then prints "During handling of the above exception, another exception occurred:", then prints the real error). Use the same heuristic that is applied in gen_esp32_part, instead. Also, avoid printing the entire backtrace if the error is a gen_esp32_part InputError, same as gen_esp32part does. Found while looking into #4474
Previous version used exception handling for program control flow, which makes for long and confusing backtrace messages if an error occurs while parsing the CSV (as it also prints the phony error that occurred while trying to parse as a binary, then prints "During handling of the above exception, another exception occurred:", then prints the real error). Use the same heuristic that is applied in gen_esp32_part, instead. Also, avoid printing the entire backtrace if the error is a gen_esp32_part InputError, same as gen_esp32part does. Found while looking into #4474
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Project version: v4.1-dev-1086-g93a8603c5-dirty
-- Building ESP-IDF components for target esp32
-- Could NOT find Perl (missing: PERL_EXECUTABLE)
Traceback (most recent call last):
File "C:/Users/dev/Desktop/esp-idf/components/partition_table/parttool.py", line 98, in init
partition_table = gen.PartitionTable.from_binary(f.read())
File "C:\Users\dev\Desktop\esp-idf\components\partition_table\gen_esp32part.py", line 231, in from_binary
result.append(PartitionDefinition.from_binary(data))
File "C:\Users\dev\Desktop\esp-idf\components\partition_table\gen_esp32part.py", line 383, in from_binary
raise InputError("Invalid magic bytes (%r) for partition definition" % magic)
gen_esp32part.InputError: Invalid magic bytes (b'nv') for partition definition
seens that partitions overlap and problems, trying to do everything but always return erro.
The text was updated successfully, but these errors were encountered: