From: Angus Gratton Date: Tue, 1 Jul 2014 00:23:25 +0000 (+1000) Subject: nRF51822: Add workaround for PAN-16 where not all RAM blocks reliably enabled on... X-Git-Tag: v0.9.0-rc1~316 X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=commitdiff_plain;h=6d26e3e768e3be66eb7edd43d52a039a601e03cd nRF51822: Add workaround for PAN-16 where not all RAM blocks reliably enabled on reset According to Nordic Semiconductor Product Anomaly Notice (document NRF51822-PAN), item 16, some revisions of nRF51822 sometimes reset without all RAM blocks enabled. This was noted on NRF51822-QFAA rev CA/C0, only 8KiB of memory was accessible. This patch turns on all RAM following a debugger induced reset (matches specified behaviour.) Change-Id: I4f8be4ec3d1271da7fe5bc9a084fdcb2968535bb Signed-off-by: Angus Gratton Reviewed-on: http://openocd.zylin.com/2202 Tested-by: jenkins Reviewed-by: Andreas Fritiofson --- diff --git a/tcl/target/nrf51.cfg b/tcl/target/nrf51.cfg index abb46fddaf..129060d356 100644 --- a/tcl/target/nrf51.cfg +++ b/tcl/target/nrf51.cfg @@ -50,3 +50,11 @@ flash bank $_CHIPNAME.uicr nrf51 0x10001000 0 1 1 $_TARGETNAME # clock to 1Mhz should be OK # adapter_khz 1000 + +proc enable_all_ram {} { + # nRF51822 Product Anomaly Notice (PAN) #16 explains that not all RAM banks + # are reliably enabled after reset on some revisions (contrary to spec.) So after + # resetting we enable all banks via the RAMON register + mww 0x40000524 0xF +} +$_TARGETNAME configure -event reset-end { enable_all_ram }