Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 60598d087 -> 7102b024e


Adding coredump support for red bear nano 1


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/7102b024
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/7102b024
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/7102b024

Branch: refs/heads/develop
Commit: 7102b024e673433b486f7825684e283ee9aa799a
Parents: e2b6001
Author: Vipul Rahane <[email protected]>
Authored: Wed Nov 9 18:11:08 2016 -0800
Committer: Vipul Rahane <[email protected]>
Committed: Wed Nov 9 18:12:14 2016 -0800

----------------------------------------------------------------------
 hw/bsp/nrf51-blenano/include/bsp/bsp.h |  4 ++++
 hw/bsp/nrf51-blenano/src/hal_bsp.c     | 18 ++++++++++++++++++
 2 files changed, 22 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/7102b024/hw/bsp/nrf51-blenano/include/bsp/bsp.h
----------------------------------------------------------------------
diff --git a/hw/bsp/nrf51-blenano/include/bsp/bsp.h 
b/hw/bsp/nrf51-blenano/include/bsp/bsp.h
index e46ec90..9a381ac 100644
--- a/hw/bsp/nrf51-blenano/include/bsp/bsp.h
+++ b/hw/bsp/nrf51-blenano/include/bsp/bsp.h
@@ -24,6 +24,7 @@
 extern "C" {
 #endif
 
+#include "inttypes.h"
 /* Define special stackos sections */
 #define sec_data_core   __attribute__((section(".data.core")))
 #define sec_bss_core    __attribute__((section(".bss.core")))
@@ -31,6 +32,9 @@ extern "C" {
 /* More convenient section placement macros. */
 #define bssnz_t
 
+extern uint8_t _ram_start;
+#define RAM_SIZE        0x8000
+
 /* LED pins */
 #define LED_BLINK_PIN   (19)
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/7102b024/hw/bsp/nrf51-blenano/src/hal_bsp.c
----------------------------------------------------------------------
diff --git a/hw/bsp/nrf51-blenano/src/hal_bsp.c 
b/hw/bsp/nrf51-blenano/src/hal_bsp.c
index 8bc8f22..1b6ef42 100644
--- a/hw/bsp/nrf51-blenano/src/hal_bsp.c
+++ b/hw/bsp/nrf51-blenano/src/hal_bsp.c
@@ -20,6 +20,7 @@
 #include <stdint.h>
 #include <stddef.h>
 #include <assert.h>
+#include "bsp/bsp.h"
 #include <nrf51.h>
 #include "mcu/nrf51_hal.h"
 #include "hal/hal_bsp.h"
@@ -86,6 +87,16 @@ static const nrf_drv_spis_config_t os_bsp_spi1s_cfg = {
 };
 #endif
 
+/*
+ * What memory to include in coredump.
+ */
+static const struct hal_bsp_mem_dump dump_cfg[] = {
+    [0] = {
+        .hbmd_start = &_ram_start,
+        .hbmd_size = RAM_SIZE
+    }
+};
+
 const struct hal_flash *
 hal_bsp_flash_dev(uint8_t id)
 {
@@ -98,6 +109,13 @@ hal_bsp_flash_dev(uint8_t id)
     return &nrf51_flash_dev;
 }
 
+const struct hal_bsp_mem_dump *
+hal_bsp_core_dump(int *area_cnt)
+{
+    *area_cnt = sizeof(dump_cfg) / sizeof(dump_cfg[0]);
+    return dump_cfg;
+}
+
 int
 hal_bsp_power_state(int state)
 {

Reply via email to