]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/pdk.git/commitdiff
PDK-7536: ipc_examples: Flush the Linux trace buffer upon Exception
authorAngela Stegmaier <angelabaker@ti.com>
Sun, 9 Aug 2020 04:27:36 +0000 (09:57 +0530)
committerSivaraj R <sivaraj@ti.com>
Fri, 14 Aug 2020 03:34:22 +0000 (22:34 -0500)
The c6x trace buffer in the ipc examples is in cached memory. Since it
is in cached memory, in order to see the contents of the SysBIOS exception
traces post-crash, the trace buffer needs to be written back to DDR so
that it can be visible from Linux running on A72. Being able to view
the exception traces from Linux command-line is desirable as access to
CCS to view the trace buffer is not always available.

This patch plugs an Exception hook that flushes the contents of the trace
buffer when an exception occurs.
Currently there isn't an IPC example that simulates a crash on C6x, but
adding this gives an example of how to do this when developing applications
with IPC that communicate with Linux on A72.

Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
packages/ti/drv/ipc/examples/common/j721e/ipc_override.cfg
packages/ti/drv/ipc/examples/common/src/ipc_utils.c
packages/ti/drv/ipc/examples/common/src/ipc_utils.h

index 60b7e173dee033949857bf3ae1c14b99079eddc3..0974da043c0876733a7e94046c641dd840c88ef5 100644 (file)
@@ -68,6 +68,9 @@ if(coreId=="c66xdsp_1" || coreId=="c66xdsp_2")
 {
     /* TraceBuf Idle Function */
     Idle.addFunc('&traceBuf_cacheWb');
+
+    var Exception = xdc.useModule('ti.sysbios.family.c64p.Exception');
+    Exception.exceptionHook = '&traceBuf_cacheWb_Exception';
 }
 
 /* Set ipc/VRing buffer as uncached */
index 03d189ad6c977ad613e7ab07e5771f7086a6bff1..be4fc2c5720a7e2b5acc3538380c052fbe80ce18 100644 (file)
@@ -114,3 +114,11 @@ Void traceBuf_cacheWb()
         }
     }
 }
+
+Void traceBuf_cacheWb_Exception()
+{
+    uint8_t *traceBufAddr = 0;
+
+    traceBufAddr = Ipc_getResourceTraceBufPtr();
+    CacheP_wb((const void *)traceBufAddr, 0x80000);
+}
index 0d96062f58f64d6702f017494a23976ee0d26b48..27d94f713380e004b369d42e702e57cb973a17f2 100644 (file)
@@ -47,6 +47,7 @@ extern "C" {
 void SetManualBreak();
 void sysIdleLoop(void);
 void traceBuf_cacheWb(void);
+Void traceBuf_cacheWb_Exception();
 
 #ifdef __cplusplus
 }