Issue in PACKED image if code execute in ITCM but load in FLASH .
I complie STM32F769I-Discovery 2_Images demo (SBSFU\Projects\STM32F769I-Discovery\Applications\2_Images\2_Images_UserApp\MDK-ARM) with MDK KEIL 3.37.
If I link project using default UserApp.sct, the packed image is right, and output.txt show below:
block size =16
Magic: b'SFU1'!!
Magic: b'SFU1'!!
number of segment :2
0x8084cb8
number of segment :3
0x80001f8
0x80062e0
Merging
SBSFU Base = 0x8000000
Writing header = 0x8080000
APPLI Base = 0x8080400
Writing to .\\..\\Binary\\\\SBSFU_UserApp.bin 543952But if I modify UserApp.sct to let fw_update_app execute in ITCM
#! 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)
}
;ITCM 16k
ITCMRAM_region 0x00000200 0x00004000
{
fw_update_app.o (+RO-CODE)
}
SB_RAM_region (SE_REGION_RAM_END + 1) {
.ANY (STACK)
.ANY (HEAP)
.ANY (+RW +ZI)
}
}
; 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_stm32f769xx.o (ALIGNTOAESBLOCK,+Last)
}
}the packed image is wrong, the output.txt below show that both Writing header and APPLI Base is wrong address.
block size =16
Magic: b'SFU1'!!
Magic: b'SFU1'!!
number of segment :2
0x4b60
number of segment :3
0x80001f8
0x80062e0
Merging
SBSFU Base = 0x8000000
Writing header = -0x200
APPLI Base = 0x200
Writing to .\\..\\Binary\\\\SBSFU_UserApp.bin 134828304