Skip to content

Commit

Permalink
enable itcm/dtcm explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
jordens committed Mar 29, 2021
1 parent 14bae09 commit fc73744
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/startup.S
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,22 @@
.thumb_func
.cfi_startproc
__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.
# Initialise .itcm code. `__sitcm`, `__siitcm`, and `__eitcm` come from the
# linker script. Copy from r2 into r0 until r0 reaches r1.
Expand Down

0 comments on commit fc73744

Please sign in to comment.