Reflashable Secure boot issue

raul.rodriguez
Posts: 2
Joined: Tue Jun 04, 2019 4:52 pm

Reflashable Secure boot issue

Postby raul.rodriguez » Fri Jun 14, 2019 11:35 pm

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 284 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 284 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.

WiFive
Posts: 2468
Joined: Tue Dec 01, 2015 7:35 am

Re: Reflashable Secure boot issue

Postby WiFive » Sat Jun 15, 2019 4:09 pm


ESP_Angus
Posts: 1649
Joined: Sun May 08, 2016 4:11 am

Re: Reflashable Secure boot issue

Postby ESP_Angus » Mon Jun 17, 2019 1:50 am

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.

raul.rodriguez
Posts: 2
Joined: Tue Jun 04, 2019 4:52 pm

Re: Reflashable Secure boot issue

Postby raul.rodriguez » Mon Jun 17, 2019 8:29 pm

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.

ESP_Angus
Posts: 1649
Joined: Sun May 08, 2016 4:11 am

Re: Reflashable Secure boot issue

Postby ESP_Angus » Tue Jun 18, 2019 3:58 am

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.

Who is online

Users browsing this forum: No registered users and 17 guests