lib/cmsis/stm32: Load ram function section.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
This commit is contained in:
iabdalkader 2025-06-07 16:33:05 +02:00
parent 6ac86edc64
commit 89f8bf5366

View File

@ -70,6 +70,23 @@ Reset_Handler:
/* Call the clock system initialization function.*/
bl SystemInit
/* Copy RAM functions from flash to ITCM */
ldr r0, =_ram_function_start // Destination start (RAM)
ldr r1, =_ram_function_end // Destination end (RAM)
ldr r2, =_ram_function_flash // Source start (Flash)
movs r3, #0
b LoopCopyRamFunc
CopyRamFunc:
ldr r4, [r2, r3]
str r4, [r0, r3]
adds r3, r3, #4
LoopCopyRamFunc:
adds r4, r0, r3
cmp r4, r1
bcc CopyRamFunc
/* Copy the data segment initializers from flash to SRAM */
ldr r0, =_sdata
ldr r1, =_edata