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

Release/v3.3: Building Bootloader fails when flash encryption and/or hardware secure boot enabled (IDFGH-3434) #5396

Closed
S3phe opened this issue Jun 4, 2020 · 7 comments

Comments

@S3phe
Copy link

S3phe commented Jun 4, 2020

Environment

  • Development Kit: none

  • Module or chip used: ESP32-WROVER

  • IDF version: v3.3.2-208-gd7e6eecd6

  • Build System: Make

  • Compiler version: xtensa-esp32-elf-gcc (crosstool-NG crosstool-ng-1.22.0-80-g6c4433a) 5.2.0

  • Operating System: macOS

  • Using an IDE?: Yes: VSCODE

  • Power Supply: external 3.3V

Problem Description

In "make menuconfig", the building of the bootloader fails if:

  • Security Options -> "Enable hardware secure boot in bootloader" = ENABLED ("SECURE_BOOT_ENABLED")
  • AND/OR: Security Options -> "Enable flash encryption on boot" = ENABLED ("FLASH_ENCRYPTION_ENABLED")

//Detailed problem description goes here.
The following message appears after building with "make bootloader"

espsecure.py v2.8
secure_boot_signing_key.pem public key extracted to /build/bootloader/bootloader_support/signature_verification_key.bin
EMBED build/bootloader/bootloader_support/signature_verification_key.bin.bin.o
AR build/bootloader/bootloader_support/libbootloader_support.a
LD build/bootloader/bootloader.elf
/build/bootloader/efuse/libefuse.a(esp_efuse_utility.o):(.literal.esp_efuse_utility_burn_efuses+0x18): undefined reference to esp_clk_apb_freq' /build/bootloader/efuse/libefuse.a(esp_efuse_utility.o): In function esp_efuse_utility_burn_efuses':
/esp/esp-idf/components/efuse/src/esp_efuse_utility.c:214: undefined reference to `esp_clk_apb_freq'
collect2: error: ld returned 1 exit status
make[1]: *** [/build/bootloader/bootloader.elf] Error 1
make: *** [/build/bootloader/bootloader.bin] Error 2

Expected Behavior

Building a bootloader with secureboot and/or flash-encryption support

Actual Behavior

Building fails

Steps to reproduce

  1. Get ESP-IDF / Install Toolchain like docs tell you on release/v3.3 page
  2. Create new Hello-World project
  3. make menuconfig -> security options -> Enable Hardware Secure boot and/or flash encryption
  4. Save and Build with "make bootloader"
  5. crash
    sdkconfig.txt
@github-actions github-actions bot changed the title Release/v3.3: Building Bootloader fails when flash encryption and/or hardware secure boot enabled Release/v3.3: Building Bootloader fails when flash encryption and/or hardware secure boot enabled (IDFGH-3434) Jun 4, 2020
@Alvin1Zhang
Copy link
Collaborator

@S3phe Thanks for reporting, we will look into.

@S3phe
Copy link
Author

S3phe commented Jun 8, 2020

@Alvin1Zhang :
Is there something I can do, to help?

In my opinion this problem is important, because Release/v3.3 is a long-term supported release, which is also meant for devices in production.

@KonstantinKondrashov
Copy link
Collaborator

Hi @S3phe! Thanks for the report. It was fixed in 4.0 and was not ported to 3.3. I will do it.

@KonstantinKondrashov
Copy link
Collaborator

I will provide the patch for this here.

@KonstantinKondrashov
Copy link
Collaborator

@S3phe Could you try this patch. 9093.zip
The fix for master was in fb72a6f.

@S3phe
Copy link
Author

S3phe commented Jun 8, 2020

@KonstantinKondrashov :
Thank you very much! Patch is working!

espressif-bot pushed a commit that referenced this issue Jun 15, 2020
Commit 8cd04c8 has added a dependency of efuse component on
esp_clk_apb_freq, however there was no definition of this function in
the bootloader context.

Reported at https://esp32.com/viewtopic.php?f=13&t=12035

Closes: #5396
@Alvin1Zhang
Copy link
Collaborator

@S3phe Thanks for reporting and sorry for slow turnaround, the fix is now available at 5e84ee1, feel free to reopen if the issue still happens. Thanks.

mahavirj pushed a commit to espressif/esp-afr-sdk that referenced this issue Dec 17, 2020
Commit 8cd04c8 has added a dependency of efuse component on
esp_clk_apb_freq, however there was no definition of this function in
the bootloader context.

Reported at https://esp32.com/viewtopic.php?f=13&t=12035

Closes: espressif/esp-idf#5396
fjuliofontes added a commit to Metyis-Porto/esp-afr-sdk that referenced this issue Oct 3, 2023
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

3 participants