This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DSP/BIOS configuration issue on EVMC6748

Hello,

I have a configuration issue with my project. I am using DSP/BIOS 5.41.10.36 on an EVMC6748 board. My real project only hooks on the USB0 interrupt and uses a idle task for processing various data. The problem I have is that the main function is never reached --- it seems BIOS_init does not terminate in this instance. I do not believe this is a programming issue because I have created a dummy project which, together with the TCF configuration file, exhibits the same behaviour. I therefore think it is a problem with the TCF file but I have not been able to find out what it causing the issue.

I have attached a minimal example which, on my computer, never reaches main. If anyone has any suggestions as to how to resolve this issue I would be very grateful. I apologise for the simplicity of the problem; I never had any issues with the project before.

Note that it is my intention to use a heap on the external RAM and to use 128K of the internal RAM as L2 cache.

The C++ code:

#include <iostream>

int main()
{
    std::cout << "Hello WORLD!" << std::endl;   
    return 1;
}

extern "C" void taskIdleFunction()
{
    std::cout << "taskIdleFunction!" << std::endl;
}

extern "C" void serviceUSB0Interrupt()
{
    std::cout << "taskIdleFunction!" << std::endl;
}

The TCF file:

utils.loadPlatform("ti.platforms.evm6748");

/* Enable real-time LOG.  */
bios.enableRealTimeAnalysis(prog);

/* Enable real-time exchange of raw logs with CCS. */
bios.enableRtdx(prog);

// Enable tasks.
bios.enableTskManager(prog);

// Enable heaps.
bios.MEM.NOMEMORYHEAPS = 0;

// Create a heap in external RAM.
bios.MEM.instance("DDR").base = 0xc0000000;
bios.MEM.instance("DDR").len = 0x08000000;
bios.MEM.instance("DDR").createHeap = 1;
bios.MEM.instance("DDR").heapSize = 0x04000000;
bios.MEM.instance("DDR").space = "code/data";

// Use first 128K of SDRAM as "IRAM".
bios.MEM.instance("IRAM").base = 0x11800000;
bios.MEM.instance("IRAM").len = 0x00020000;
bios.MEM.instance("IRAM").createHeap = 0;
bios.MEM.instance("IRAM").space = "code/data";

// Use last 128K of SDRAM for L2-cache.
bios.MEM.instance("CACHE_L2").base = 0x11820000;
bios.MEM.instance("CACHE_L2").len = 0x00020000;

// Use run-time support library with exceptions.
bios.GBL.SPECIFYRTSLIB = 1;
bios.GBL.RTSLIB = "rts6740_eh.lib";

// Disable tracing.
bios.GBL.ENABLEALLTRC = 0;

// Enable L2-cache of size 128K.
bios.GBL.C64PLUSL2CFG = "128k";

// Enable caching of external RAM (0xc0000000 - 0xc8000000)
bios.GBL.C64PLUSMAR192to223 = 0x000000ff;

// Configure kernel thread via IDLE task.
bios.IDL.create("IPT_Firmware");
bios.IDL.instance("IPT_Firmware").order = 1;
bios.IDL.instance("IPT_Firmware").fxn = prog.extern("taskIdleFunction");
bios.IDL.instance("IPT_Firmware").comment = "Runs kernel thread.";

// Give our kernel thread a 1MB stack size in external RAM.
bios.TSK.instance("TSK_idle").stackSize = 10000;
bios.TSK.instance("TSK_idle").stackMemSeg = prog.get("DDR");

// Configure hardware interrupts.
bios.HWI.instance("HWI_INT5").interruptSelectNumber = 19;
bios.HWI.instance("HWI_INT5").fxn = prog.extern("serviceUSB0Interrupt");
bios.HWI.instance("HWI_INT5").useDispatcher = 1;

// Configure logs.
bios.LOG.instance("LOG_system").bufLen = 256;
bios.LOG.instance("LOG_system").bufSeg = prog.get("DDR");

bios.LOG.create("trace");
bios.LOG.instance("trace").bufLen = 256;
bios.LOG.instance("trace").bufSeg = prog.get("DDR");

// Allocate everything in external RAM instead of internal RAM.
bios.MEM.BIOSOBJSEG = prog.get("DDR");
bios.MEM.MALLOCSEG = prog.get("DDR");
bios.MEM.ARGSSEG = prog.get("DDR");
bios.MEM.STACKSEG = prog.get("DDR");
bios.MEM.GBLINITSEG = prog.get("DDR");
bios.MEM.TRCDATASEG = prog.get("DDR");
bios.MEM.SYSDATASEG = prog.get("DDR");
bios.MEM.OBJSEG = prog.get("DDR");
bios.MEM.BIOSSEG = prog.get("DDR");
bios.MEM.SYSINITSEG = prog.get("DDR");
bios.MEM.HWISEG = prog.get("DDR");
bios.MEM.HWIVECSEG = prog.get("DDR");
bios.MEM.RTDXTEXTSEG = prog.get("DDR");
bios.MEM.USERCOMMANDFILE = 0;
bios.MEM.TEXTSEG = prog.get("DDR");
bios.MEM.SWITCHSEG = prog.get("DDR");
bios.MEM.BSSSEG = prog.get("DDR");
bios.MEM.FARSEG = prog.get("DDR");
bios.MEM.CINITSEG = prog.get("DDR");
bios.MEM.PINITSEG = prog.get("DDR");
bios.MEM.CONSTSEG = prog.get("DDR");
bios.MEM.DATASEG = prog.get("DDR");
bios.MEM.CIOSEG = prog.get("DDR");

// Use external RAM instead of internal RAM everywhere.
bios.BUF.OBJMEMSEG = prog.get("DDR");
bios.SYS.TRACESEG = prog.get("DDR");
bios.SEM.OBJMEMSEG = prog.get("DDR");
bios.MBX.OBJMEMSEG = prog.get("DDR");
bios.QUE.OBJMEMSEG = prog.get("DDR");
bios.LCK.OBJMEMSEG = prog.get("DDR");
bios.DIO.OBJMEMSEG = prog.get("DDR");
bios.DHL.OBJMEMSEG = prog.get("DDR");
bios.RTDX.RTDXDATASEG = prog.get("DDR");
bios.HST.OBJMEMSEG = prog.get("DDR");
bios.HST.instance("RTA_fromHost").bufSeg = prog.get("DDR");
bios.HST.instance("RTA_toHost").bufSeg = prog.get("DDR");
bios.PIP.OBJMEMSEG = prog.get("DDR");
bios.SIO.OBJMEMSEG = prog.get("DDR");
bios.TSK.OBJMEMSEG = prog.get("DDR");
bios.PRD.OBJMEMSEG = prog.get("DDR");

// !GRAPHICAL_CONFIG_TOOL_SCRIPT_INSERT_POINT!

prog.gen();

Any help would be much appreciated...

Kind regards, 

Mark

  • Dear Drew,

    Thanks for pointing out the documentation. I also wouldn't expect main to execute until BIOS_init completes; my problem is that main is never executed because the DSP fails to get this far. After some more investigation, it appears that the problem is that the task idle functions are called prior to everything (including global objects) being initialised properly and prior to main being executed in order to assess how many cycles a task idle function takes to complete.

    It is possible to turn this feature off in the DSP/BIOS (it is a property of idle function manager). In my case, using std::cout in the task idle function was at least one of the problems --- i.e. be cautious when adding your own functions in the task idle function manager!

    Kind regards,

    Mark

     

  • You can disable this calibration feature with the following line in your .tcf script:

    bios.IDL.AUTOCALCULATE = 0;

    which you can do from the gconf GUI: