From d95b09804c9ef9fa96618a78a10e818faf82d327 Mon Sep 17 00:00:00 2001 From: Stephane D'Alu Date: Tue, 16 Feb 2016 18:33:49 +0100 Subject: Ensure ram is on --- os/hal/boards/NRF51-DK/board.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'os/hal/boards') diff --git a/os/hal/boards/NRF51-DK/board.c b/os/hal/boards/NRF51-DK/board.c index e976e56..c5237d7 100644 --- a/os/hal/boards/NRF51-DK/board.c +++ b/os/hal/boards/NRF51-DK/board.c @@ -1,5 +1,6 @@ /* Copyright (C) 2015 Fabio Utzig + 2016 Stéphane D'Alu / Bruno Remond Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -17,6 +18,14 @@ #include "hal.h" #if HAL_USE_PAL || defined(__DOXYGEN__) + +/* RAM Banks + * (Values are defined in Nordic gcc_startup_nrf51.s) + */ +#define NRF_POWER_RAMON_ADDRESS 0x40000524 +#define NRF_POWER_RAMONB_ADDRESS 0x40000554 +#define NRF_POWER_RAMONx_RAMxON_ONMODE_Msk 0x3 + /** * @brief PAL setup. * @details Digital I/O ports static configuration as defined in @p board.h. @@ -68,6 +77,9 @@ const PALConfig pal_default_config = */ void __early_init(void) { + /* Make sure ALL RAM banks are powered on */ + *(uint32_t *)NRF_POWER_RAMON_ADDRESS |= NRF_POWER_RAMONx_RAMxON_ONMODE_Msk; + *(uint32_t *)NRF_POWER_RAMONB_ADDRESS |= NRF_POWER_RAMONx_RAMxON_ONMODE_Msk; } /** -- cgit v1.2.3