Hi,
I use SYS BIOS 6.32.5.54, MCSDK PDK 1.0.0.17 for multicore. CG Tools 7.3.1, XDC Tools 3.22.4.46.
I have some initialization code that needs to runs before main(). I used the xdc.runtime.Startup module for SYS BIOS to hook it up as described in
http://e2e.ti.com/support/embedded/bios/f/355/p/159937/581117.aspx#581117
ie. my CFG file contain :
var Startup = xdc.useModule('xdc.runtime.Startup');
Startup.firstFxns.$add('&myStartupFxn');
I need this function to run before main, because it initializes DDR memory, and the system heap is mapped to DDR3 in the CFG file.
/* Create a default system heap using ti.bios.HeapMem. */
var heapMemParams1 = new HeapMem.Params;
heapMemParams1.size = 0x10000000;
heapMemParams1.sectionName ="systemHeap";
Program.global.heap0 = HeapMem.create(heapMemParams1);
/* This is the default memory heap. */
Memory.defaultHeapInstance = Program.global.heap0;
Program.sectMap["systemHeap"] = "DDR3";
The generated .out fine work fine, when loaded through the emulator.
Next, when I convert the out file to .bin hex format using hex6x, and load it from the host processor to the DSP, the code is stuck at some instruction for ever. The command used for conversion is:
hex6x ./TestProject.out -o .testProject.bin -memwidth 8 -m -order L
If I avoid placing the heap in DDR, and place a smaller sized heap in L2 SRAM, the .bin generated with hex6x and loaded from the host processor, works fine.
Not sure if it has something do with COFF vs ELF. Or relocatable code. I tried both linker options one after the other - absolute_exe (-a), and relocatable (-r), and neither one solved the problem.
I have a similar setup for CCS 3.3, COFF binary format) and DSP BIOS worked well. ie. using hex6x to get .bin from .out of an application which has DSP Bios hookups for DDR initiliation which are called before main so that heap can be in DDR, worked. TCF had
bios.GBL.CALLUSERINITFXN = 1;
bios.GBL.USERINITFXN = prog.extern("InitDdr2");
bios.MEM.create("DDR2");
bios.MEM.instance("DDR2").comment = "DDR2";
bios.MEM.instance("DDR2").base = 0xe0000000;
bios.MEM.instance("DDR2").len = 0x10000000;
bios.MEM.instance("DDR2").heapSize = 0x10000000;
Appreciate any pointers.
Thanks!
Shivang