aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/boards
diff options
context:
space:
mode:
authorStephane D'Alu <sdalu@sdalu.com>2016-02-16 18:33:49 +0100
committerStephane D'Alu <sdalu@sdalu.com>2016-02-16 18:33:49 +0100
commitd95b09804c9ef9fa96618a78a10e818faf82d327 (patch)
tree315eb360e8dc23320fd200887a8d8cf6cfabca36 /os/hal/boards
parent1548bca80f5af0fe3f79331ae5a3d51b18f1c077 (diff)
downloadChibiOS-Contrib-d95b09804c9ef9fa96618a78a10e818faf82d327.tar.gz
ChibiOS-Contrib-d95b09804c9ef9fa96618a78a10e818faf82d327.tar.bz2
ChibiOS-Contrib-d95b09804c9ef9fa96618a78a10e818faf82d327.zip
Ensure ram is on
Diffstat (limited to 'os/hal/boards')
-rw-r--r--os/hal/boards/NRF51-DK/board.c12
1 files changed, 12 insertions, 0 deletions
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;
}
/**