Working with the OMAP L138 eXperimenter board, building on Linux but using CCS v3.3 for debugging, BIOS PSP version 01.30.01 (part of the "ti-dvsdk_omapl138-evm_4_02_00_06" package).
I am trying to add an SPI device to my project, based on the examples provided with the BIOS PSP. The SPI example compiles and seems to work correctly.
I added the following configuration text to the project .tcf file:
bios.UDEV.create("Spi0");
bios.UDEV.instance("Spi0").fxnTableType = "IOM_Fxns";
bios.UDEV.instance("Spi0").initFxn = prog.extern("spi_userInit");
bios.UDEV.instance("Spi0").params = prog.extern("spiParams");
bios.UDEV.instance("Spi0").fxnTable = prog.extern("Spi_IOMFXNS");
bios.UDEV.instance("Spi0").deviceId = 1;
Where:
Spi_Params spiParams;
void spi_initParams(void)
{
/* exactly the same parameter definition as the SPI example */
}
void spi_userInit()
{
volatile Int i=1;
LOG_printf(&trace, "entering spi_userInit()\n");
while (i); //provides a CCS breakpoint, for debugging purposes
spi_initParams();
Spi_init();
LOG_printf(&trace, "exiting spi_userInit()\n");
} //spi_userInit()
On loading the .out binary into the DSP, I can Step through the spi_userInit() function, it prints out the "entering"/"exiting" text on the Trace display. Upon returning, it goes back to DEV_init(), which calls uppMdBindDev(), where I cannot keep Stepping through (PC points to the start of the function and won't move when pressing F10/F11). But if I press F5 (Run), the program goes on to hang. When I Halt the processor, the Call Stack shows UTL_halt() and the Execution Graph Details shows: "0 SYS abort called with message 'ERROR - Device %s Config Failed' ".
I've also tried creating a different type of device (UPP), with the same results.
How can I get a clue as to what is causing this?
Below is the complete .tcf file for the project:
utils.importFile("dsplink-omapl138gem-base.tci");
bios.ECM.ENABLE = 1;
bios.PWRM.ENABLE = 1;
prog.module("MEM").ARGSSIZE = 50 ;
bios.UDEV.create("Spi0");
bios.UDEV.instance("Spi0").fxnTableType = "IOM_Fxns";
bios.UDEV.instance("Spi0").initFxn = prog.extern("spi_userInit");
bios.UDEV.instance("Spi0").params = prog.extern("spiParams");
bios.UDEV.instance("Spi0").fxnTable = prog.extern("Spi_IOMFXNS"); //provided by the driver
bios.UDEV.instance("Spi0").deviceId = 1;
var IRAM = prog.module("MEM").instance("IRAM");
var L1DSRAM = prog.module("MEM").instance("L1DSRAM");
bios.setMemCodeSections (prog, prog.get("DDR")) ;
bios.setMemDataNoHeapSections (prog, prog.get("DDR")) ;
bios.setMemDataHeapSections (prog, prog.get("DDR")) ;
bios.MEM.instance("DDR").createHeap = 1;
bios.MEM.instance("DDR").heapSize = 0x300000;
bios.MEM.BIOSOBJSEG = prog.get("DDR");
bios.MEM.MALLOCSEG = prog.get("DDR");
bios.MEM.BIOSSEG = prog.get("IRAM");
bios.MEM.SYSINITSEG = prog.get("IRAM");
bios.MEM.TEXTSEG = prog.get("DDR");
bios.MEM.HWISEG = prog.get("DDR");
bios.MEM.HWIVECSEG = prog.get("DDR");
bios.TSK.ENABLETSK = true;
bios.TSK.OBJMEMSEG = prog.get("DDR");
bios.TSK.STACKSIZE = 1024;
bios.TSK.STACKSEG = prog.get("DDR");
bios.HWI.instance("HWI_INT7").interruptSelectNumber = 0;
bios.HWI.instance("HWI_INT8").interruptSelectNumber = 1; //includes spi INT
bios.HWI.instance("HWI_INT9").interruptSelectNumber = 2; //includes upp INT
bios.HWI.instance("HWI_INT10").interruptSelectNumber = 3;
bios.IDL.OBJMEMSEG = prog.get("DDR");
bios.LOG_system.bufSeg = prog.get("IRAM");
bios.LOG_system.bufLen = 4096;
bios.LOG_system.logType = "circular";
bios.LOG.create("trace");
bios.LOG.instance("trace").bufLen = 4096;
bios.LOG.instance("trace").bufSeg = prog.get("IRAM");
bios.LOG.create("DVTEvent_Log");
bios.LOG.instance("DVTEvent_Log").bufSeg = prog.get("IRAM");
bios.LOG.instance("DVTEvent_Log").bufLen = 128;
bios.LOG.instance("DVTEvent_Log").comment = "DVT";
bios.CLK.RESETTIMER = 1;
bios.GBL.ENABLEINST = 1;
if (config.hasReportedError == false) {
prog.gen();
}