From aff25d28344ddd6ad36b2fbc5f27a039d40d7009 Mon Sep 17 00:00:00 2001 From: Gabriel Marcano Date: Mon, 20 Jun 2016 23:22:30 -0400 Subject: [PATCH] Fixes issue with uncart freezing when starting up -There seemed to have been a problem with caching and uncart, at least under a9lh and with one system. Explicitly disabling the mpu before setting it up and before calling subroutines related to setting it up appears to have fixed the problem. --- source/start.s | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/start.s b/source/start.s index c143ddf..647aede 100644 --- a/source/start.s +++ b/source/start.s @@ -99,12 +99,16 @@ _setup_heap: ldr r1, =__end__ @ grab the location of the end of the binary add r0, r0, r1 ldr r1, =fake_heap_end @ heap goes from end of program to this variable - str r0, [r1] - mov pc, lr + str r0, [r1] + mov pc, lr _init: push {r0-r12, lr} + mrc p15, 0, r4, c1, c0, 0 + bic r4, r4, #(1<<0) @ mpu disable + mcr p15, 0, r4, c1, c0, 0 + bl _enable_caches bl _fix_sdmc_mount