summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 629cb13)
raw | patch | inline | side by side (parent: 629cb13)
author | Frank Livingston <frank-livingston@ti.com> | |
Sat, 4 Nov 2017 01:52:07 +0000 (20:52 -0500) | ||
committer | Frank Livingston <frank-livingston@ti.com> | |
Sat, 4 Nov 2017 01:52:07 +0000 (20:52 -0500) |
GNU GCC compiler adds static 0's to initialize heaps.
This significantly increases the size of the ARM image because of the
large size of the DDR3 & MSMC heaps.
System works intermittently when sections are removed (DSP sometimes
stalls in statusop_init(), GateMP_open()). Need to determine which code
requires initial 0's for heap, but for now added code in ARM main() to
clear DDR3 and MSMC heaps.
This significantly increases the size of the ARM image because of the
large size of the DDR3 & MSMC heaps.
System works intermittently when sections are removed (DSP sometimes
stalls in statusop_init(), GateMP_open()). Need to determine which code
requires initial 0's for heap, but for now added code in ARM main() to
clear DDR3 and MSMC heaps.
diff --git a/pasdk/paf b/pasdk/paf
index 354fcc264e3ad40ca0efe87720468f6b11f68df2..de838c2456e5d4f15d230e45ccf556dcafa3d06f 160000 (submodule)
--- a/pasdk/paf
+++ b/pasdk/paf
-Subproject commit 354fcc264e3ad40ca0efe87720468f6b11f68df2
+Subproject commit de838c2456e5d4f15d230e45ccf556dcafa3d06f
index 18e3294b669ba5b3347e55a701c4f3ee9b70127f..93219dbd45490c86695ab5bb560a561c133505ac 100644 (file)
heapMem1Params.sectionName = ".msmcSramHeap";
Program.global.heapMemMsmcSram = HeapMem.create(heapMem1Params);
Program.sectMap[".msmcSramHeap"] = "HOST_MSMC";
+// Remove section to exclude heapMem2Params.size 0's for heap initialization from ARM image.
+// Must have corresponding NOLOAD specifier for this section in linker command file.
+Program.sectionsExclude = "^\.msmcSramHeap";
/* Add DDR3 heap */ // formerly SDRAM
var heapMem2Params = new HeapMem.Params();
@@ -295,6 +298,9 @@ heapMem2Params.size = 5350528+ (3*1024*1024); // Added 3 MB for DTS decoder;//43
heapMem2Params.sectionName = ".ddr3Heap";
Program.global.heapMemDdr3 = HeapMem.create(heapMem2Params);
Program.sectMap[".ddr3Heap"] = "HOST_DDR3";
+// Remove section to exclude heapMem2Params.size 0's for heap initialization from ARM image.
+// Must have corresponding NOLOAD specifier for this section in linker command file.
+Program.sectionsExclude = "^\.ddr3Heap";
Program.global.heapMemL2Sram = Program.global.heapMemMsmcSram;
index 5d4019835575f32ee33cd33d91d6f10207ab18f7..6a3e080c4fdf6cce854e10bd5da1efd0b68c5e4e 100644 (file)
*(.gCapIbBuf)
*(.gCapAfBuf)
} > DDR3
+
+ /*
+ Remove section to exclude heapMem2Params.size 0's for heap initialization from ARM image.
+ Must have corresponding "Program.sectionsExclude" in SYSBIOS configuration file.
+ */
+ .msmcSramHeap (NOLOAD):
+ {
+ *(.msmcSramHeap)
+ } > HOST_MSMC
+
+ .ddr3Heap (NOLOAD):
+ {
+ *(.ddr3Heap)
+ } > HOST_DDR3
}
index ce9debc0171e23f254d00e9efc44713b5c6da05b..ed6c3b93128cf7843b514e49f7fb59456a479886 100644 (file)
#include "pfp/pfp.h"
#include "pfp_app.h" /* contains all PFP ID's */
+#include <string.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 )
+
extern void BOARD_initPerfCounters();
extern uint32_t readTime32(void);
Int status;
Int k;
//UInt32 tsStart, tsEnd, delta; // debug: check ARM SYS/BIOS timestamp provider
+ HeapMem_ExtendedStats heapmem_stats;
+ Ptr buf;
+ SizeT size;
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.
+ 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);
+ 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);
+
#if 0 // debug: check ARM SYS/BIOS timestamp provider
BOARD_initPerfCounters();
#endif