diff options
author | Stephane D'Alu <sdalu@sdalu.com> | 2016-02-21 17:03:19 +0100 |
---|---|---|
committer | Stephane D'Alu <sdalu@sdalu.com> | 2016-02-21 17:03:19 +0100 |
commit | e9a1a01f90ab2dae92def1547c81ae778d690cdb (patch) | |
tree | b588b1a09357599530841bedac2823486b8f12c9 /os/hal/boards/NRF51-DK | |
parent | 709c28c9299e4464a0654443f87ce0180403fef8 (diff) | |
parent | b634bd9beef41b5b141b994efa4ac3d55505d0c4 (diff) | |
download | ChibiOS-Contrib-e9a1a01f90ab2dae92def1547c81ae778d690cdb.tar.gz ChibiOS-Contrib-e9a1a01f90ab2dae92def1547c81ae778d690cdb.tar.bz2 ChibiOS-Contrib-e9a1a01f90ab2dae92def1547c81ae778d690cdb.zip |
Merge branch 'master' into rng
Added haltest
Conflicts:
os/hal/hal.mk
os/hal/include/hal_community.h
os/hal/src/hal_community.c
Diffstat (limited to 'os/hal/boards/NRF51-DK')
-rw-r--r-- | os/hal/boards/NRF51-DK/board.c | 12 | ||||
-rw-r--r-- | os/hal/boards/NRF51-DK/board.h | 3 | ||||
-rw-r--r-- | os/hal/boards/NRF51-DK/board.mk | 6 |
3 files changed, 20 insertions, 1 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; } /** diff --git a/os/hal/boards/NRF51-DK/board.h b/os/hal/boards/NRF51-DK/board.h index 5e0c738..04c8daf 100644 --- a/os/hal/boards/NRF51-DK/board.h +++ b/os/hal/boards/NRF51-DK/board.h @@ -22,7 +22,8 @@ #define BOARD_NAME "nRF51 DK" /* Board oscillators-related settings. */ -#define XTAL_VALUE 16000000 +#define NRF51_XTAL_VALUE 16000000 +#define NRF51_LFCLK_SOURCE 1 /* GPIO pins. */ #define BTN1 17 diff --git a/os/hal/boards/NRF51-DK/board.mk b/os/hal/boards/NRF51-DK/board.mk index 4d20da3..9619bd4 100644 --- a/os/hal/boards/NRF51-DK/board.mk +++ b/os/hal/boards/NRF51-DK/board.mk @@ -3,3 +3,9 @@ BOARDSRC = ${CHIBIOS_CONTRIB}/os/hal/boards/NRF51-DK/board.c # Required include directories BOARDINC = ${CHIBIOS_CONTRIB}/os/hal/boards/NRF51-DK + +# Flash +JLINK_DEVICE = nrf51422 +JLINK_PRE_FLASH = w4 4001e504 1 +JLINK_ERASE_ALL = w4 4001e504 2\nw4 4001e50c 1\nsleep 100 + |