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

Pre-encrypted firmware do not work on QEMU (QEMU-159) #82

Open
artua opened this issue Jul 24, 2023 · 1 comment
Open

Pre-encrypted firmware do not work on QEMU (QEMU-159) #82

artua opened this issue Jul 24, 2023 · 1 comment

Comments

@artua
Copy link

artua commented Jul 24, 2023

Hello,

I tried to burn eFuses and firmware on both QEMU and physical chip (ESP ECO V3).
Encrypted flash + Secure Boot v2

It is working ok on physical chip but not working on QEMU.

Generating eFuse bin with MAC and version bits set:
gen_efuse.py qemu_efuse-mac.bin

Running QEMU in strapped mode:

    -machine esp32 \
    -drive file=qemu_flash_image.bin,if=mtd,format=raw \        
    -global driver=esp32.gpio,property=strap_mode,value=0x0f \
    -drive file=qemu_efuse-mac.bin,if=none,format=raw,id=efuse \
    -serial tcp::5555,server,nowait

Programming eFuses by the same script I use to program physical device, the only port changes.
...
(Everything goes smooth, eFuse settings checked after burning)

Running QEMU in app mode:

build/qemu-system-xtensa -nographic \
    -machine esp32 \
   -drive file=qemu_flash_image.bin,if=mtd,format=raw \
   -drive file=qemu_efuse-mac.bin,if=none,format=raw,id=refuse

This gives me an error:

Adding SPI flash device
ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT)
invalid header: 0xb4296d8b
invalid header: 0xb4296d8b
invalid header: 0xb4296d8b
invalid header: 0xb4296d8b
invalid header: 0xb4296d8b
invalid header: 0xb4296d8b

The message repeats once per 4 seconds. CPU load is 100%.
Host System: MacBook M2 (Apple silicon)

Any ideas?

@github-actions github-actions bot changed the title Pre-encrypted firmware do not work on QEMU Pre-encrypted firmware do not work on QEMU (QEMU-159) Jul 24, 2023
@mahavirj
Copy link
Member

@artua

Sorry for delayed reply. Can you please confirm if you had set the chip revision field in the efuse for ECO3, please see here https://github.com/espressif/esp-toolchain-docs/tree/main/qemu/esp32#emulating-esp32-eco3?

Also please share your efuse summary generated for the qemu.

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

No branches or pull requests

3 participants