index 588cfe64e288a4aa61b0b32ccdf9a37acb685fb3..21c9b36059404f898aff0381241a23560c25ce04 100644 (file)
/*
-Copyright (c) 2016, Texas Instruments Incorporated - http://www.ti.com/
+Copyright (c) 2017, Texas Instruments Incorporated - http://www.ti.com/
All rights reserved.
* Redistribution and use in source and binary forms, with or without
#include "pfp/pfp.h"
#include "pfp_app.h" /* contains all PFP ID's */
+#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 )
+
extern void BOARD_initPerfCounters();
extern uint32_t readTime32(void);
{
Int status;
Int k;
- UInt32 tsStart, tsEnd, delta;
+ //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);
+ 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();
#endif
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++)
+ asm(" nop");
+
// Initialize IPC
status = Ipc_start();
if (status < 0)