Page 1 of 1

Reflashable Secure boot issue

Posted: Fri Jun 14, 2019 11:35 pm
by raul.rodriguez
I'm trying to enable reflashable secure boot for some development devices. Using esp-idf and esp32 arduino as component.
Steps I have taken following the secure boot documentation.

1. In menuconfig: Enable hardware secure boot in bootloader - reflashable - sign binaries during build
2.

Code: Select all

espsecure.py generate_signing_key secure_boot_signing_key.pem
3. make bootloader - follow instruction to flash the bootloader key - then flash the bootloader - check espefuse.py summary (key has been burned)
4. make flash
5. open up a serial monitor using putty. It shows a bunch of weird characters. hello world isn't running. Even after restart.
characters.PNG
characters.PNG (7.58 KiB) Viewed 4559 times
6. check espefuse.py summary again ABS_DONE_0 has NOT been burned by bootloader

Before I run make flash this is what I get on the serial output.
beforeflash.PNG
beforeflash.PNG (32.42 KiB) Viewed 4559 times
I don't know what I missed. I can deselect secure boot in the menuconfig and reflash everything on the same board after a make and my code runs fine but without secure boot.

Re: Reflashable Secure boot issue

Posted: Sat Jun 15, 2019 4:09 pm
by WiFive

Re: Reflashable Secure boot issue

Posted: Mon Jun 17, 2019 1:50 am
by ESP_Angus
Hi raul,

As WiFive suggests, probably the bootloader has gotten bigger and either the partition table needs to be moved to a higher offset, the or bootloader logging verbosity reduced to shrink the binary.

Regarding the putty error, possibly the baud rate is wrong (should 115200bps). The second screenshot shows serial log output (captured via "monitor" target), so something is working correctly over serial.

Re: Reflashable Secure boot issue

Posted: Mon Jun 17, 2019 8:29 pm
by raul.rodriguez
Thank you guys for your responses. I ended up remembering the bootloader size issue after I posted this and fixed the issue.

Both captures are using putty. The corrupted looking output was after I flashed the partition table. Which ended up partially writing over the bootloader so that might have been where that issue came from.

Re: Reflashable Secure boot issue

Posted: Tue Jun 18, 2019 3:58 am
by ESP_Angus
raul.rodriguez wrote:
Mon Jun 17, 2019 8:29 pm
The corrupted looking output was after I flashed the partition table. Which ended up partially writing over the bootloader so that might have been where that issue came from.
Of course, that makes sense. Glad you got everything working.