The final generated binary file -bigbinary- does not include the main application part.
I tried to make my project SBSFU compatible, by using 'STM32F769I_Discovery_2_Images_UserApp' example.
It is based on the STM32F756VGT6 microcontroller and I defined the load region on ITCM interface address range -0x200000 to 0x2FFFFF- instead of AXIM interface -0x8000000 to 0x80FFFFF-.
I did what is said in an5056 section 8.1 but unfortunately was not successful.
The compilation is O.K and when I look at the generated Hex files of SBSFU and the main project with ST-LINK UTILITY, the ranges are O.K and are as the ranges of the linker file.
But it seems when the postbuild wants to create the final binary file it misses the main project section and the SLOT_ACTIVE_1 is almost filled by 0xFF.
Here is my project's linker, mapping_fwimg.h, and mapping_sbsfu.h
#! armclang --target=arm-arm-none-eabi -mcpu=cortex-m7 -E -xc
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************
#include "..\..\..\Linker_Common\MDK-ARM\mapping_sbsfu.h"
#include "..\..\..\Linker_Common\MDK-ARM\mapping_fwimg.h"
LR_ROM (SLOT_ACTIVE_1_START + 0x400) { ; Cortex-M7: align the init vectors on 0x400
vector_start (SLOT_ACTIVE_1_START + 0x400) FIXED VECTOR_SIZE {
*.o (RESET, +First)
}
ROM_region +0 {
*(InRoot$$Sections)
.ANY (+RO)
}
; Heap starts at 1MB and grows upwards
ARM_LIB_HEAP 0x20000900 EMPTY 0x400 {
}
; Stack space starts at the end of the 2MB of RAM
; and grows downwards for 1KB (indicated by the negative length)
ARM_LIB_STACK 0x20000800 EMPTY -0x800 {
}
DTCMRAM_REGION 0x20000D00 0xCA0 {
.ANY (DTCMRAM)
}
RW_IRAM1 0x200019A0 0x0000E660 { ; RW data
.ANY (+RW +ZI)
}
SB_RAM_region (SE_REGION_RAM_END + 1) 0x0003D000 { ; RW data
.ANY (+RW +ZI)
}
ITCMRAM_REGION 0x00000000 0X3FFF {
.ANY (ITCMRAM)
}
}
; extra ROM region to make sure the binary size is a multiple of the AES block size (16 bytes) and F7 flash writing unit (4 bytes)
LR_ROM1(+0) ALIGN(16) {
ForAlignment +0 {
startup_stm32f756xx.o (ALIGNTOAESBLOCK,+Last)
}
}/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef MAPPING_FWIMG_H
#define MAPPING_FWIMG_H
/* Slots must be aligned on sector size */
/* swap Sector 5 : 256 kbytes */
#define SWAP_START 0x00240000
#define SWAP_END 0x0027FFFF
/* Active slot #1 : 1 sectors of 256 kbytes */
#define SLOT_ACTIVE_1_START 0x00280000
#define SLOT_ACTIVE_1_END 0x002BFFFF
#define SLOT_ACTIVE_1_HEADER SLOT_ACTIVE_1_START
/* Dwl slot #1 : 1 sectors of 256 kbytes */
#define SLOT_DWL_1_START 0x002C0000
#define SLOT_DWL_1_END 0x002FFFFF
/* Slots not configured */
#define SLOT_ACTIVE_2_HEADER 0x00000000
#define SLOT_ACTIVE_2_START 0x00000000
#define SLOT_ACTIVE_2_END 0x00000000
#define SLOT_ACTIVE_3_HEADER 0x00000000
#define SLOT_ACTIVE_3_START 0x00000000
#define SLOT_ACTIVE_3_END 0x00000000
#define SLOT_DWL_2_START 0x00000000
#define SLOT_DWL_2_END 0x00000000
#define SLOT_DWL_3_START 0x00000000
#define SLOT_DWL_3_END 0x00000000
#endif/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef MAPPING_SBSFU_H
#define MAPPING_SBSFU_H
/* SE Code region protected by protected area */
#define VECTOR_SIZE 0x400
#define ROM_START 0x0200000
#define SE_CODE_REGION_ROM_START (ROM_START + VECTOR_SIZE)
#define SE_CALLGATE_REGION_ROM_START (SE_CODE_REGION_ROM_START + 0x8)
#define SE_CALLGATE_REGION_ROM_END (SE_CODE_REGION_ROM_START + 0x1FF)
/* SE key region protected by protected area */
#define SE_KEY_REGION_ROM_START (SE_CALLGATE_REGION_ROM_END + 0x1)
#define SE_KEY_REGION_ROM_END (SE_KEY_REGION_ROM_START + 0xFF)
/* SE Startup: call before enabling protected area */
#define SE_STARTUP_REGION_ROM_START (SE_KEY_REGION_ROM_END + 0x1)
#define SE_CODE_NOKEY_REGION_ROM_START (SE_STARTUP_REGION_ROM_START + 0x100)
/* Aligned SE End at the end of the 1st 64Kbytes of flash, MPU protection isolation constraints */
#define SE_CODE_REGION_ROM_END 0x0020FFFF
/* SE IF ROM: used to locate Secure Engine interface code out of protected area */
#define SE_IF_REGION_ROM_START (SE_CODE_REGION_ROM_END + 0x1)
#define SE_IF_REGION_ROM_END (SE_IF_REGION_ROM_START + 0x8FF)
/* SBSFU Code region */
#define SB_REGION_ROM_START (SE_IF_REGION_ROM_END + 0x1)
/* Aligned SBSFU end at the end of the 1st 128Kbytes of FLASH, MPU protection isolation constraints */
#define SB_REGION_ROM_END 0x0021FFFF
/* ROM regions size definition */
#define SE_CALLGATE_REGION_ROM_SIZE (SE_CALLGATE_REGION_ROM_END - SE_CODE_REGION_ROM_START + 0x1)
#define SE_KEY_REGION_ROM_SIZE (SE_KEY_REGION_ROM_END - SE_KEY_REGION_ROM_START + 0x1)
#define SE_ROM_REGION_SIZE (SE_CODE_REGION_ROM_END - SE_CODE_NOKEY_REGION_ROM_START + 0x1)
#define SE_IF_ROM_REGION_SIZE (SE_IF_REGION_ROM_END - SE_IF_REGION_ROM_START + 0x1)
#define SB_ROM_REGION_SIZE (SB_REGION_ROM_END - SB_REGION_ROM_START + 0x1)
/* RAM section */
/* SE RAM1 region protected by protected area */
/* SE stack is placed 1st in RAM, stack overflow does not write on other RAM area */
#define SE_REGION_RAM_START 0x20010000
#define SE_REGION_RAM_STACK_TOP 0x20011000
#define SE_REGION_RAM_END 0x20012FFF
/* SBSFU RAM1 region */
#define SB_REGION_RAM_START (SE_REGION_RAM_END + 0x1)
#define SB_REGION_RAM_END 0x2004FFFF
#define SE_RAM_REGION_START (SE_REGION_RAM_STACK_TOP)
#define SE_RAM_REGION_SIZE (SE_REGION_RAM_END - SE_REGION_RAM_STACK_TOP + 0x1)
#define SB_RAM_REGION_SIZE (SB_REGION_RAM_END - SB_REGION_RAM_START + 0x1)
#endif
Is there anything that I'm doing wrong?
