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

create_esp_enc_img does not run when input file is present (IDFGH-13194) (IEC-133) #349

Closed
3 tasks done
bonnee opened this issue Jul 3, 2024 · 1 comment · Fixed by #350
Closed
3 tasks done

Comments

@bonnee
Copy link

bonnee commented Jul 3, 2024

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

5.2.2

Operating System used.

Linux

How did you build your project?

VS Code IDE

If you are using Windows, please specify command line type.

None

What is the expected behavior?

I expect create_esp_enc_img to keep the encrypted image updated

What is the actual behavior?

The output image is created once and never updated when the input binary file changes

Steps to reproduce.

  1. Create a project
  2. Add espressif__esp_encrypted_img component
  3. Add a call to create_esp_enc_img(${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.bin, ${project_dir}/rsa_key/private.pem, ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.bin.enc app) in a CMakeLists.txt file
  4. Build the project and observe that the encrypted binary is created
  5. Change something in the project and build again
  6. Observe the .bin update while the .bin.enc is untouched

Build or installation Logs.

Clean build log:

[98/99] Generating binary image from built executable
esptool.py v4.7.0
Creating esp32c3 image...
Merged 2 ELF sections
Successfully created esp32c3 image.
Generated /home/bonnee/src/rt/kill-switch/master/build/bootloader/bootloader.bin
[99/99] cd /home/bonnee/src/rt/kill-switch/master/build/bootloader/esp-idf/esptool_py && /home/bonnee/.espressif/python_env/idf5.2_py3.12_env/bin/python /opt/esp-idf/components/partition_table/check_sizes.py --offset 0x9000 bootloader 0x0 /home/bonnee/src/rt/kill-switch/master/build/bootloader/bootloader.bin
Bootloader binary size 0x7120 bytes. 0x1ee0 bytes (21%) free.
[916/918] Generating binary image from built executable
esptool.py v4.7.0
Creating esp32c3 image...
Merged 1 ELF section
Successfully created esp32c3 image.
Generated /home/bonnee/src/rt/kill-switch/master/build/kill-switch.bin
[917/918] cd /home/bonnee/src/rt/kill-switch/master/build/esp-idf/esptool_py...ition-table.bin /home/bonnee/src/rt/kill-switch/master/build/kill-switch.bin
kill-switch.bin binary size 0xf0380 bytes. Smallest app partition is 0x100000 bytes. 0xfc80 bytes (6%) free.
[918/918] Generating pre-encrypted binary
Encrypting image ...
Done

Dirty build log

[10/11] Generating binary image from built executable
esptool.py v4.7.0
Creating esp32c3 image...
Merged 1 ELF section
Successfully created esp32c3 image.
Generated /home/bonnee/src/rt/kill-switch/master/build/kill-switch.bin
[11/11] cd /home/bonnee/src/rt/kill-switch/master/build/esp-idf/esptool_py &...ition-table.bin /home/bonnee/src/rt/kill-switch/master/build/kill-switch.bin
kill-switch.bin binary size 0xf0380 bytes. Smallest app partition is 0x100000 bytes. 0xfc80 bytes (6%) free.

It can be clearly seen that the function is never called in the second log

@bonnee bonnee added the Type: Bug Bugs in components label Jul 3, 2024
@github-actions github-actions bot changed the title create_esp_enc_img does not run when input file is present create_esp_enc_img does not run when input file is present (IDFGH-13194) Jul 3, 2024
@mahavirj mahavirj transferred this issue from espressif/esp-idf Jul 3, 2024
@github-actions github-actions bot changed the title create_esp_enc_img does not run when input file is present (IDFGH-13194) create_esp_enc_img does not run when input file is present (IDFGH-13194) (IEC-133) Jul 3, 2024
mahavirj added a commit that referenced this issue Jul 10, 2024
…ed binary

Also changed the target name to dynamic one - based on output file name

Closes #349
@dizcza
Copy link

dizcza commented Oct 12, 2024

Still have this issue on release/v5.1 branch.

Fixed by updating the dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants