diff --git a/lib/cmsis/src/st/startup_stm32n657xx.s b/lib/cmsis/src/st/startup_stm32n657xx.s index ee7ef3901..1d5de6d0a 100644 --- a/lib/cmsis/src/st/startup_stm32n657xx.s +++ b/lib/cmsis/src/st/startup_stm32n657xx.s @@ -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