Hi @davidtosenovjan Startup_cm7.s has following asm code file is attached for your reference. where its taking care of __INT_SRAM_START,__INT_SRAM_END,__INT_DTCM_END,__INT_DTCM_START which are available in linker file.
RamInit:
/* check and init SRAM ECC after power-up and selftest */
ldr r1,=0x4028C000 /* MC_RGM.DES==1 */
ldr r0,[r1]
mov r1,#0x1
and r0, r0, r1
cmp r0,r1
beq RamInit_01
ldr r1,=0x4028C008 /* MC_RGM.FES==0x10 (selftest done) */
ldr r0,[r1]
mov r1,#0x10
and r0, r0, r1
cmp r0,r1
bne SRAM_LOOP_END
RamInit_01:
/* Initialize SRAM ECC */
ldr r0, =__RAM_INIT
cmp r0, 0
/* Skip if __SRAM_INIT is not set */
beq SRAM_LOOP_END
ldr r1, =__INT_SRAM_START
ldr r2, =__INT_SRAM_END
subs r2, r1
subs r2, #1
ble SRAM_LOOP_END
movs r0, 0
movs r3, 0
SRAM_LOOP:
stm r1!, {r0,r3}
subs r2, 8
bge SRAM_LOOP
SRAM_LOOP_END:
DTCM_Init:
/* Initialize DTCM ECC */
ldr r0, =__DTCM_INIT
cmp r0, 0
/* Skip if __DTCM_INIT is not set */
beq DTCM_LOOP_END
/* Enable TCM */
LDR r1, =CM7_DTCMCR
LDR r0, [r1]
LDR r2, =0x1
ORR r0, r2
STR r0, [r1]
ldr r1, =__INT_DTCM_START
ldr r2, =__INT_DTCM_END
subs r2, r1
subs r2, #1
ble DTCM_LOOP_END
movs r0, 0
movs r3, 0
DTCM_LOOP:
stm r1!, {r0,r3}
subs r2, #8
bge DTCM_LOOP
DTCM_LOOP_END: