Skip to content

Commit 6fc2ad5

Browse files
mattia-moffadanielinux
authored andcommitted
Document IMAGE_HEADER_SIZE changes
1 parent 13d697f commit 6fc2ad5

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

docs/STM32-TZ.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,27 @@ non-secure domain can access wolfCrypt through a standard PKCS11 interface and
2727
use the crypto library with pre-provisioned keys that are never exposed to the
2828
non-secure domain.
2929

30+
### Image header size
31+
32+
The `IMAGE_HEADER_SIZE` option has to be carefully tuned to accommodate for the
33+
interrupt vector table alignment requirements. According to the [ARM Cortex-M33
34+
documentation](https://developer.arm.com/documentation/100235/0004/the-cortex-m33-processor/exception-model/vector-table):
35+
36+
> The silicon vendor must configure the required alignment of the vector
37+
> tables, which depends on the number of interrupts implemented. The minimum
38+
> alignment is 32 words, enough for up to 16 interrupts. For more interrupts,
39+
> adjust the alignment by rounding up to the next power of two. For example, if
40+
> you require 21 interrupts, the alignment must be on a 64-word boundary
41+
> because the required table size is 37 words, and the next power of two is 64.
42+
43+
For example, all the STM32H5 series boards have at least 146 interrupt
44+
channels; since the next power of two is 256, they require an alignment of 1024
45+
bytes (256×4). As a result, in this case `IMAGE_HEADER_SIZE` must be set to
46+
`1024` or a multiple of it.
47+
48+
This detail is already taken care of in the configuration files provided in
49+
`config/examples`.
50+
3051
### Example using STM32L552
3152

3253
- Copy the example configuration for STM32-L5 with support for wolfCrypt in

0 commit comments

Comments
 (0)