@@ -9,8 +9,8 @@ Documentation about the MCUboot bootloader design, operation and features can be
99The current port is available for use in the following SoCs within the OSes:
1010
1111| | ESP32 | ESP32-S2 | ESP32-C3 |
12- | ----- | ----- | ----- | ----- |
13- | Zephyr | Supported | WIP | WIP |
12+ | : -----: | : -----: | : -----: | : -----: |
13+ | Zephyr | Supported | Supported | Supported |
1414| NuttX | Supported | Supported | Supported |
1515
1616## [ Installing requirements and dependencies] ( #installing-requirements-and-dependencies )
@@ -70,20 +70,46 @@ esptool.py --chip <TARGET> elf2image --flash_mode dio --flash_freq 40m --flash_s
7070```
7171esptool.py -p <PORT> -b <BAUD> --before default_reset --after hard_reset --chip <TARGET> write_flash --flash_mode dio --flash_size <FLASH_SIZE> --flash_freq 40m <BOOTLOADER_FLASH_OFFSET> build/mcuboot_<TARGET>.bin
7272```
73+ ---
74+ *** Note***
75+ You may adjust the port ` <PORT> ` (like ` /dev/ttyUSB0 ` ) and baud rate ` <BAUD> ` (like ` 2000000 ` ) according to the connection with your board.
76+ You can also skip ` <PORT> ` and ` <BAUD> ` parameters so that esptool tries to automatically detect it.
7377
74- You may adjust the port ` <PORT> ` (like ` /dev/ttyUSB0 ` ) and baud rate ` <BAUD> ` (like ` 2000000 ` ) according to the connection with your board.
78+ * ` <FLASH_SIZE> ` can be found using the command below:*
79+ ```
80+ esptool.py -p <PORT> -b <BAUD> flash_id
81+ ```
82+ The output contains device information and its flash size:
83+ ```
84+ Detected flash size: 4MB
85+ ```
86+
87+
88+ * ` <BOOTLOADER_FLASH_OFFSET> ` value must follow one of the addresses below:*
89+ | ESP32 | ESP32-S2 | ESP32-C3 |
90+ | :-----: | :-----: | :-----: |
91+ | 0x1000 | 0x1000 | 0x0000 |
92+
93+ ---
7594
7695## [ Signing and flashing an application] ( #signing-and-flashing-an-application )
7796
78971 . Images can be regularly signed with the ` scripts/imgtool.py ` script:
7998
8099```
81- imgtool.py sign --align 4 -v 0 -H 32 --pad-header -S 0x00100000 <BIN_IN> <SIGNED_BIN>
100+ imgtool.py sign --align 4 -v 0 -H 32 --pad-header -S <SLOT_SIZE> <BIN_IN> <SIGNED_BIN>
82101```
83102
84- For Zephyr images, ` --pad-header ` is not needed as they already have the padding for MCUboot header.
103+ ---
104+
105+ *** Note***
106+ ` <SLOT_SIZE> ` is the size of the slot to be used.
107+ Default slot0 size is ` 0x100000 ` , but it can change as per application flash partitions.
108+
109+ For Zephyr images, ` --pad-header ` is not needed as it already has the padding for MCUboot header.
85110
86111---
112+
87113:warning : *** ATTENTION***
88114
89115* This is the basic signing needed for adding MCUboot headers and trailers.
@@ -281,6 +307,15 @@ CONFIG_EFUSE_VIRTUAL_KEEP_IN_FLASH=1
281307
282308---
283309
310+ ### [ Signing the image when working with Flash Encryption] ( #signing-the-image-when-working-with-flash-encryption )
311+
312+ When enabling flash encryption, it is required to signed the image using 32-byte alignment: ` --align 32 --max-align 32 ` .
313+
314+ Command example:
315+ ```
316+ imgtool.py sign -k <YOUR_SIGNING_KEY.pem> --pad --pad-sig --align 32 --max-align 32 -v 0 -H 32 --pad-header -S <SLOT_SIZE> <BIN_IN> <BIN_OUT>
317+ ```
318+
284319### [ Device generated key] ( #device-generated-key )
285320
286321First ensure that the application image is able to perform encrypted read and write operations to the SPI Flash.
0 commit comments