diff --git a/config/examples/imx-rt1060.config b/config/examples/imx-rt1060.config index ff0540dd..f50986e7 100644 --- a/config/examples/imx-rt1060.config +++ b/config/examples/imx-rt1060.config @@ -27,3 +27,4 @@ WOLFBOOT_SECTOR_SIZE?=0x1000 WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x60010000 WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x60030000 WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x60050000 +WOLFBOOT_SMALL_STACK?=1 diff --git a/docs/compile.md b/docs/compile.md index ee43eed4..8fce984b 100644 --- a/docs/compile.md +++ b/docs/compile.md @@ -137,6 +137,20 @@ stage, or on these platform that do not support interrupt vector relocation. To disable interrupt vector table relocation, compile with `VTOR=0`. By default, wolfBoot will relocate the interrupt vector by setting the offset in the vector relocation offset register (VTOR). +### Limit stack usage + +By default, wolfBoot does not require any memory allocation. It does this by performing all the operations +using the stack. Although the stack space used by the algorithms can be predicted at compile time, the amount +of stack space be relatively big, depending on the algorithm selected. + +Some targets offer limited amount of RAM to use as stack space, either in general, or in a configuration +dedicated for the bootloader stage. + +In these cases, it might be useful to activate `WOLFBOOT_SMALL_STACK=1`. With this option, a fixed-size pool +is created at compile time to assist the allocation of the object needed by the cryptography implementation. +When compiled with `WOLFBOOT_SMALL_STACK=1`, wolfBoot reduces the stack usage considerably, and simulates dynamic +memory allocations by assigning dedicated, statically allocated, pre-sized memory areas. + ### Disable Backup of current running firmware Optionally, it is possible to disable the backup copy of the current running firmware upon the installation of the