SBSFU - Start in different flash memory sector
Hi,
I'm using a STM32F722RE and in my current application, I used sector 2 and 3 of the flash as a virtual EEPROM. The memory of the controller looks like this:
So sector 4 should be enough for the SBSFU and I would like to set my application to sector 5 and the download area to sector 6. Now, when I change everything in the linkerscript, the controller goes somewhere unexpected and I lose the debug connection,
What I have done:
The linkerscript of the SECoreBin is unchanged.
The linkerscripts of the SBSFU are changed as follow:
STM32F722REx_FLASH.ld:
/* Entry Point */
ENTRY(Reset_Handler)
/* Highest address of the user mode stack */
_estack = 0x2003C000; /* end of RAM */
/* Generate a link error if heap and stack don't fit into RAM */
_Min_Heap_Size = 0; /* required amount of heap */
_Min_Stack_Size = 0x2000; /* required amount of stack */
INCLUDE mapping_fwimg.ld
INCLUDE mapping_sbsfu.ld
/* Specific SBSFU definition */
__ICFEDIT_intvec_start__ = 0x08010000;
SE_Binary_region_ROM_Length = __ICFEDIT_SE_Code_region_ROM_end__ - __ICFEDIT_SE_CallGate_region_ROM_start__ + 1;
/* Specify the memory areas */
MEMORY
{
ISR_VECTOR (rx) : ORIGIN = __ICFEDIT_intvec_start__, LENGTH = VECTOR_SIZE
SE_Binary_region_ROM (rx) : ORIGIN = __ICFEDIT_SE_CallGate_region_ROM_start__, LENGTH = SE_Binary_region_ROM_Length
}mapping_fwimg:
/* Slots must be aligned on sector size */
/* Active slot #1 : 1984 kbytes */
__ICFEDIT_SLOT_Active_1_start__ = 0x08020000;
__ICFEDIT_SLOT_Active_1_end__ = 0x0803FFFF;
__ICFEDIT_SLOT_Active_1_header__ = __ICFEDIT_SLOT_Active_1_start__;
/* Slots not configured */
__ICFEDIT_SLOT_Active_2_header__ = 0x00000000;
__ICFEDIT_SLOT_Active_2_start__ = 0x00000000;
__ICFEDIT_SLOT_Active_2_end__ = 0x00000000;
__ICFEDIT_SLOT_Active_3_header__ = 0x00000000;
__ICFEDIT_SLOT_Active_3_start__ = 0x00000000;
__ICFEDIT_SLOT_Active_3_end__ = 0x00000000;mapping_sbsfu:
/* SE Code region protected by protected area */
VECTOR_SIZE = 0x400;
__ICFEDIT_SE_Code_region_ROM_start__ = 0x08010000 + VECTOR_SIZE;
__ICFEDIT_SE_CallGate_region_ROM_start__ = __ICFEDIT_SE_Code_region_ROM_start__; /* No need to do +4 as we have dummy bytes in SE_CoreBin .ld file */
__ICFEDIT_SE_CallGate_region_ROM_end__ = __ICFEDIT_SE_Code_region_ROM_start__ + 0x1FF;
/* SE key region protected by protected area */
__ICFEDIT_SE_Key_region_ROM_start__ = __ICFEDIT_SE_CallGate_region_ROM_end__ + 0x1;
__ICFEDIT_SE_Key_region_ROM_end__ = __ICFEDIT_SE_Key_region_ROM_start__ + 0xFF;
/* SE Startup: call before enabling protected area*/
__ICFEDIT_SE_Startup_region_ROM_start__ = __ICFEDIT_SE_Key_region_ROM_end__ + 0x1;
__ICFEDIT_SE_Code_nokey_region_ROM_start__ = __ICFEDIT_SE_Startup_region_ROM_start__ + 0x100;
/* Aligned SE End at the end of the 1st 32Kbytes of flash, MPU protection isolation constraints */
__ICFEDIT_SE_Code_region_ROM_end__ = 0x08017FFF;
/* SE IF ROM: used to locate Secure Engine interface code out of protected area */
__ICFEDIT_SE_IF_region_ROM_start__ = __ICFEDIT_SE_Code_region_ROM_end__ + 1;
__ICFEDIT_SE_IF_region_ROM_end__ = __ICFEDIT_SE_IF_region_ROM_start__ + 0x8FF;
/* SBSFU Code region */
__ICFEDIT_SB_region_ROM_start__ = __ICFEDIT_SE_IF_region_ROM_end__ + 0x1;
/* Aligned SE End at the end of the 1st 64Kbytes of flash, MPU protection isolation constraints */
__ICFEDIT_SB_region_ROM_end__ = 0x0801FFFF;So I don't see what is wrong here? Do I need to change something else?
