From 13a24bc0bd3170f7665ea412f18c910cd5abb2a6 Mon Sep 17 00:00:00 2001 From: Kevin Bracey Date: Mon, 10 Dec 2018 16:45:30 +0200 Subject: [PATCH] Test MPU is enabled by init --- TESTS/mbed_hal/mpu/main.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/TESTS/mbed_hal/mpu/main.cpp b/TESTS/mbed_hal/mpu/main.cpp index fa12658d9a..09da639717 100644 --- a/TESTS/mbed_hal/mpu/main.cpp +++ b/TESTS/mbed_hal/mpu/main.cpp @@ -72,11 +72,9 @@ static void hard_fault_handler_test() static void mpu_fault_test(const volatile uint16_t *mem_function) { - mbed_mpu_init(); - - // Verify that the mpu causes faults when executing ram + // Verify that the mpu causes faults when executing ram after init fault_count = 0; - mbed_mpu_enable_ram_xn(true); + mbed_mpu_init(); call_mem(mem_function); TEST_ASSERT_EQUAL(1, fault_count); @@ -86,7 +84,7 @@ static void mpu_fault_test(const volatile uint16_t *mem_function) call_mem(mem_function); TEST_ASSERT_EQUAL(0, fault_count); - // Verify that the mpu causes faults when executing ram + // Verify that the mpu can be turned back on fault_count = 0; mbed_mpu_enable_ram_xn(true); call_mem(mem_function);