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 <gus@projectgus.com>
Reviewed-on: http://openocd.zylin.com/2202
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
# 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 }