summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: baea21d)
raw | patch | inline | side by side (parent: baea21d)
author | Frank Livingston <frank-livingston@ti.com> | |
Fri, 24 Nov 2017 16:58:12 +0000 (10:58 -0600) | ||
committer | Frank Livingston <frank-livingston@ti.com> | |
Fri, 24 Nov 2017 16:58:12 +0000 (10:58 -0600) |
Temporary workaround to ARM exit in IPC_attach().
pasdk/test_arm/application/main.c | patch | blob | history |
index 21c9b36059404f898aff0381241a23560c25ce04..40b06ce0d09451faa6dfd92accec6116cd0673d2 100644 (file)
#include "pfp/pfp.h"
#include "pfp_app.h" /* contains all PFP ID's */
+//
+// FL: Temporary code for ARM image size reduction
+//
#include <string.h>
#include <ti/sysbios/hal/Cache.h>
#include <ti/sysbios/heaps/HeapMem.h>
// Number of control bytes used in heap buffer after heap initialized by SYSBIOS before main()
#define HEAP_CONTROL_SZ ( 8 )
+// ARM open loop delay count
+#define OPEN_LOOP_DELAY_CNT ( 10000000 )
extern void BOARD_initPerfCounters();
extern uint32_t readTime32(void);
Log_info0("Enter main()");
- // FL: hack to clear heap buffers
- // Temporary workaround used to avoid including 0's in ARM image to clear heap at startup.
+ // (***) FL: clear ARM dedicated heap buffers
+ // Temporary workaround to avoid including 0's in ARM image.
+ // If heaps aren't cleared:
+ // 1) DSP:ASIT: IPC state is corrupted because of incorrect memory segments for PCM2, DDP2 & THD2 beta table entries.
+ // 2) DSP:ASIT: DSP hangs in GateMP_open() inside first call to statusOp_Init().
HeapMem_getExtendedStats(heapMemMsmcSram, &heapmem_stats);
buf = (Ptr)heapmem_stats.buf+HEAP_CONTROL_SZ;
size = (SizeT)heapmem_stats.size-HEAP_CONTROL_SZ;
memset(buf, 0, size);
Cache_wb(buf, size, Cache_Type_ALLD, 0);
Cache_wait();
-
HeapMem_getExtendedStats(heapMemDdr3, &heapmem_stats);
buf = (Ptr)heapmem_stats.buf+HEAP_CONTROL_SZ;
size = (SizeT)heapmem_stats.size-HEAP_CONTROL_SZ;
memset(buf, 0, size);
Cache_wb(buf, size, Cache_Type_ALLD, 0);
Cache_wait();
-
-
#if 0 // debug: check ARM SYS/BIOS timestamp provider
BOARD_initPerfCounters();
delta = tsEnd-tsStart;
#endif
- // (***) FL: hack to insert "open-loop" delay before start of ARM application.
- // When bootloading from MMC/SD, ARM exits in system init unless delay is added.
- // Haven't yet determined where ARM exits.
- for (k=0; k<100000; k++)
+ // (***) FL: insert "open-loop" delay before start of ARM application.
+ // Temporary workaround to avoid exit in IPC_attach().
+ // ARM exits in taskSysInitFxn:IPC_attach() when bootloading from MMC/SD unless delay is added.
+ for (k = 0; k < OPEN_LOOP_DELAY_CNT; k++)
asm(" nop");
// Initialize IPC