enable itcm/dtcm explicitly

This commit is contained in:
Robert Jördens 2021-03-29 18:51:50 +02:00
parent 14bae09935
commit fc7374424a
1 changed files with 16 additions and 0 deletions

View File

@ -7,6 +7,22 @@
.thumb_func .thumb_func
.cfi_startproc .cfi_startproc
__pre_init: __pre_init:
# Enable ITCM and DTCM
ldr r0, =1
ldr r1, =0xE000EF90
ldr r2, [r1]
# Set ITCMCR.EN
orr r2, r2, r0
str r2, [r1]
ldr r1, =0xE000EF94
ldr r2, [r1]
# Set DTCMCR.EN
orr r2, r2, r0
str r2, [r1]
dsb
isb
# Analogous to cortex-m-rt Reset code for .data copying. # Analogous to cortex-m-rt Reset code for .data copying.
# Initialise .itcm code. `__sitcm`, `__siitcm`, and `__eitcm` come from the # Initialise .itcm code. `__sitcm`, `__siitcm`, and `__eitcm` come from the
# linker script. Copy from r2 into r0 until r0 reaches r1. # linker script. Copy from r2 into r0 until r0 reaches r1.