memory map adjust SBSFU on a STM32G474
Hi
I'm using the dual image function on a 512kB STM32G474. I like to adjust the bootloader size to 32kb because my user App is too big.
In the AN5056 there is a note how to adjust it, but I'm not sure if this lines in the file low_level_security.h are correct? Can anybody help me please?
#define SFU_PROTECT_MPU_EXEC_SE_RGNV MPU_REGION_NUMBER7
#define SFU_PROTECT_MPU_EXEC_SE_START FLASH_BASE /*!< Flash memory area */
#define SFU_PROTECT_MPU_EXEC_SE_SIZE MPU_REGION_SIZE_16KB //eud MPU_REGION_SIZE_32KB
#if defined (__GNUC__)
#define SFU_PROTECT_MPU_EXEC_SE_SREG 0xE0U /*!< 32 Kbytes / 8 * 5 ==> 20 Kbytes */
#elif defined(__CC_ARM)
#define SFU_PROTECT_MPU_EXEC_SE_SREG 0x80U /*!< 32 Kbytes / 8 * 7 ==> 28 Kbytes */
#else
#define SFU_PROTECT_MPU_EXEC_SE_SREG 0xC0U /*!< 32 Kbytes / 8 * 6 ==> 24 Kbytes */
#endif /* (__GNUC__) */
#define SFU_PROTECT_MPU_EXEC_SE_PERM MPU_REGION_PRIV_RO
#define SFU_PROTECT_MPU_EXEC_SE_EXECV MPU_INSTRUCTION_ACCESS_ENABLE
#define SFU_PROTECT_MPU_EXEC_SE_TEXV MPU_TEX_LEVEL0
#define SFU_PROTECT_MPU_EXEC_SE_B MPU_ACCESS_NOT_BUFFERABLE
#define SFU_PROTECT_MPU_EXEC_SE_C MPU_ACCESS_CACHEABLEIs the setting for SFU_PROTECT_MPU_EXEC_SE_SREG the same like before?
thanks
/*###ICF### Set of symbols used in SE and SB_SFU projects ****/
/* Slots Regions must be aligned on 4096 bytes (0x1000) */
/* swap region (8 Kbytes) */
define exported symbol __ICFEDIT_region_SWAP_start__ = 0x08042000;
define exported symbol __ICFEDIT_region_SWAP_end__ = 0x08043FFF;
/* slot 0 region (232 Kbytes) */
define exported symbol __ICFEDIT_region_SLOT_0_start__= 0x08008000;
define exported symbol __ICFEDIT_region_SLOT_0_end__ = 0x08041FFF;
/* slot 1 region (232 KBytes) */
define exported symbol __ICFEDIT_region_SLOT_1_start__= 0x08044000;
define exported symbol __ICFEDIT_region_SLOT_1_end__ = 0x0807DFFF;
/* firmware images regions definition */
define region SWAP_region = mem:[from __ICFEDIT_region_SWAP_start__ to __ICFEDIT_region_SWAP_end__];
define region SLOT_0_region = mem:[from __ICFEDIT_region_SLOT_0_start__ to __ICFEDIT_region_SLOT_0_end__];
define region SLOT_1_region = mem:[from __ICFEDIT_region_SLOT_1_start__ to __ICFEDIT_region_SLOT_1_end__];/* SE Startup: call before enabling protected area */
define exported symbol __ICFEDIT_SE_Startup_region_ROM_start__ = __ICFEDIT_SE_Key_region_ROM_end__ + 1;
define exported symbol __ICFEDIT_SE_Code_nokey_region_ROM_start__ = __ICFEDIT_SE_Startup_region_ROM_start__ + 0x100;
/* Aligned SE End at the end of the 1st 12Kbytes of flash, MPU protection isolation constraints */
define exported symbol __ICFEDIT_SE_Code_region_ROM_end__ = 0x08002FFF;
/* SE IF ROM: used to locate Secure Engine interface code out of protected area */
define exported symbol __ICFEDIT_SE_IF_region_ROM_start__ = __ICFEDIT_SE_Code_region_ROM_end__ + 1;
define exported symbol __ICFEDIT_SE_IF_region_ROM_end__ = __ICFEDIT_SE_IF_region_ROM_start__ + 0x5FF;
/* SBSFU Code region */
define exported symbol __ICFEDIT_SB_region_ROM_start__ = __ICFEDIT_SE_IF_region_ROM_end__ + 1;
/* Aligned SBSFU end at the end of the 1st 32Kbytes of FLASH, MPU protection isolation constraints */
define exported symbol __ICFEDIT_SB_region_ROM_end__ = 0x08007FFF;