Adapting the user application AN5056
40/49 AN5056 Rev 8
8 Adapting the user application
8.1 How to make an application SBSFU compatible
First of all, the mapping of the user application must be modified to allow the application to
run in active slot #1. In a multiple image configuration the same applied for active slot #2 or
#3:
• Code section starting by the vector table must be configured to run from active slot #1,
just after the image header:
__ICFEDIT_SLOT_Active_1_start__ + 512
(
SFU_IMG_OFFSET = 512 for the STM32L4 Series)
• Data section must start after the Secure Engine protected area:
(
__ICFEDIT_SE_region_SRAM1_end__ + 1)
Refer to Section 3.2: Memory mapping definition on page 10 for more details on memory
constraints.
Then, during system initialization, VTOR must be set to the new location of the vector table
as shown in
Figure 35.
Figure 35. Vector table position update (NUCLEO-L476RG example)