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.

Ipc_E_FAIL, Generic Failure

Other Parts Discussed in Thread: SYSBIOS

Hi,

I received the error as stated in the title when my board starts up. I am writing a simple piece of code on an EVM6678L. As it's a generic error, i'm not sure how to solve this. Below are my code and configuration, hopefully someone is able to spot any mistakes i made which may cause this error to arise.

CCS v5.5
IPC 1.24.3.32
MCSDK 2.1.2.6
PDK 2.22.2.16
SYS/BIOS 6.35.4.50

Code:

#define IPCGR_REG
#define REBOOT_BASE 0x1087FFFF
#define REBOOT_GAP 0x01000000

void mainTask()
{
  //some blinking of LED codes here for each core
}

void main()
{
  platform_info pform_info;
  uint32_t coreNum, core;
  int status;

  coreNum = platform_get_coreid();
  if(coreNum == 0)
  {
    platform_get_info(&pform_info);
    for(core=1;core<8;core++)
    {
      unsigned int magic = REBOOT_BASE + (REBOOT_GAP * core);
      memcpy((void*)(0x10800000+0x01000000*core)), (void*)0x00800000, (512*1024)-0xD23F;
      *((volatile unsigned int*)magic)=(unsigned int)_c_int00;
      platform_delay(1);
    }
    for(core=1;core<8;core++)
    {
      IPCGR_REG[core] = 1;
      platform_delay(100000);
    }
  }
  status = IPC_start();
  platform_write("Status: %i\n", status);
  if (status < 0) {
    System_abort("IPC start failed\n");
  }

  BIOS_start();
}

 

.cfg

var Memory = ........
var Log = ........
var Errors = ........
var Diags = ........
var Timestamp = ........
var Startup = ........
var System = ........
var SysStd = ........
System.SupportProxy = SysStd;

var BIOS = ........
var Task = ........
var Clock = ........
var Sem = ........
var Hwi = ........
var Ecm = ........
var BiosCache = ........
var HeapBuf = ........
var HeapMem = ........
var Exc = ........
var Cache = ........

BIOS.TaskEnabled = true;
Task.common$.namedInstance = true;
var heapMemParams = new HeapMem.Params();
heapMemParams.size = 0x8000000;
heapMemparams.sectionName = "systemHeapMaster";
Program.global.heap0 = HeapMem.create(heapMemParams);
Memory.defaultHeapInstance = Program.global.heap0;

var Global = ........
Global.enableCodeGeneration = false;

var MessageQ = ........
var IPC = ........
var HeapBufMP = ........
var SharedRegion = ........
var MultiProc = ........
MultiProc.setConfig(null, ["CORE1","CORE2","CORE3","CORE4","CORE5","CORE6","CORE7"]);
Ipc.procSync = Ipc.ProcSync_ALL;

var SHAREDMEM = 0x0c000000;
var SHAREDMEMSIZE = 0x00200000;

SharedRegion.setEntryMeta(0
  { base: SHAREDMEM;
    len: SHAREDMEMSIZE;
    ownerProcId:0,
    isValid:true,
    name:"MSMCSRAM",
  });

var Memory = ........
Memory.defaultHeapSize = 0x10000;
Program.heap = 0x10000;

Program.sectMap[".vec"] = {loadSegment:"MSMCSRAM", loadAlign:1024};
Program.sectMap[".switch"] = {loadSegment:"MSMCSRAM", loadAlign:8};
Program.sectMap[".cio"] = {loadSegment:"L2SRAM", loadAlign:8};
Program.sectMap[".args"] = {loadSegment:"L2SRAM", loadAlign:8};
Program.sectMap[".cppi"] = {loadSegment:"L2SRAM", loadAlign:16};
Program.sectMap[".qmss"] = {loadSegment:"L2SRAM", loadAlign:16};
Program.sectMap[".nimu_eth_112"] = {loadSegment:"L2SRAM", loadAlign:16};
Program.sectMap[".far:NDK_PACKETMEM"] = {loadSegment:"MSMCSRAM", loadAlign:128};
Program.sectMap[".far:NDK_OBJMEM"] = {loadSegment:"MSMCSRAM", loadAlign:16};
Program.sectMap[".far:WEBDATA"] = {loadSegment:"DDR3", loadAlign:8};
Program.sectMap[".resmgr_memregion"] = {loadSegment:"L2SRAM", loadAlign:128};
Program.sectMap[".resmgr_handles"] = {loadSegment:"L2SRAM", loadAlign:16};
Program.sectMap[".resmgr_pa"] = {loadSegment:"L2SRAM", loadAlign:8};

Program.sectMap["systemHeapMaster"] = "DDR3";
Program.sectMap[".cinit"] = "MSMCSRAM";
Program.sectMap[".const"] = "MSMCSRAM";
Program.sectMap[".text"] = "MSMCSRAM";
Program.sectMap[".far"] = "L2SRAM";
Program.sectMap[".ss"] = "L2SRAM";
Program.sectMap[".rodata"] = "L2SRAM";
Program.sectMap[".neardata"] = "L2SRAM";
Program.sectMap[".code"] = "L2SRAM";
Program.sectMap[".data"] = "L2SRAM";
Program.sectMap[".sysmem"] = "L2SRAM";
Program.sectMap[".defaultStackSection"] = "L2SRAM";
Program.sectMap[".stack"] = "L2SRAM";
Program.sectMap[".plt"] = "L2SRAM";
Program.sectMap["platform_lib"] = "L2SRAM";

Startup.firstFxns.$add('&EVM_init');

var myThread = TASK.create("&mainTask");
myThread.stackSize = 0x2000;
myThread.priority = 0x5;
myThread.instance.name = "mainTask";

 

Thanks.

  • Hi,

    Please check the return vaule from Ipc_start to find the issue.
    You use this piece of code only in your main.c file.


    Int status;

    /*Ipc_start() calls Ipc_attach() to synchronize all remote processors  because 'Ipc.procSync' is set to Ipc.ProcSync_ALL' in *.cfg */
    status = Ipc_start();
    if (status < 0) {
    System_abort("Ipc_start failed\n");
    }

    BIOS_start();


    Refer the wiki and E2E post, this will be helpful.
    http://processors.wiki.ti.com/index.php/Codec_Engine_Server_Integrator_User%27s_Guide#Editing_main.c
    http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/p/127096/456946.aspx#456946

  • Hi pubesh,

    I don't quite understand what you meant. As stated in my title I received the error IPC_E_FAIL, which is a return code '-1'. I checked the description of the code and it says generic failure. And the code you shared is also shown in the code I posted.

    As for the link u shared, I've seen them and I've tried placing the IPC start at the start of my task, but I received the same result of -1 from my IPC start. Which is why I'm puzzled why isn't my code working, and typed out my whole code in the hope that its something I did wrong or missed out.

  • Some additional info on the problem I'm facing.

    Even when in debug mode, IPC_start isn't working, but after commenting out the section in main where the setting of core entry addresses etc are, IPC_start works fine. But when I flash it to the board it isn't working.(obviously, since the magic address and interrupts are commented out)

    All 8 cores have to run IPC_start for it to work right?

    [Edit]

    I did a platform write to display the core id before ipcstart, apparently core 0 ran IPC start and returned -1, core 1-7 either did not enter IPC start or entered but did not exit from it, as I have a platform write statement after IPC_start as well.

  • Jonathan,
    Yes, I have understand the IPC start error. I asked you do to simple routine in the main call. So that we can double check is it issue related with IPC or some other issue.
    From your statement, I came to know that, IPC start is working in the debug mode like connected the target using emulator.
    And also you are facing issue while boot this application from flash. Is it correct my understanding?

    Jonathan: said:
    All 8 cores have to run IPC_start for it to work right?


    Yes, it is correct. you can double check with IPC based demo is inside the mcsdk package.
    C:\ti\mcsdk_2_01_02_06\demos\image_processing\ipc\master\src\mcip_master_main.c
    C:\ti\mcsdk_2_01_02_06\demos\image_processing\ipc\slave\src\mcip_slave_main.c

    As per your earlier E2E post, it says without IPC start, boot the application from flash successfully.
    http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/p/380221/1342867.aspx#1342867
    You can continue on this thread,if this issue only boot from flash. So that the boot expert can help you.

  • Jonathan,

    In addition that, You can take as the reference the Image Processing application for flash and boot. This demo having IPC routine, so that you make sure where is the exact issue.

  • Hi Pubesh,

    Hmm.. I will try to look at it again. I have been through it a few times but as the image processing example is alot more complicated with alot more additional stuff.

    Also, the image processing demo is using a custom platform, and i have even posted in the forum before that i couldn't find the platform(link below). As stated in my last reply on the post, i have entered the address as provided under "edit/view rtsc platform". "mcsdk_2_01_02_06\demos\image_processing\ipc\evmc6678l\platform", yet i was unable to find anything. The drop down list was supposed to show me the platforms available in the directory so i could view/edit them but it was empty.

    http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/p/377653/1337810.aspx#1337810

  • An additional info is that while in debug mode, I also received the following message on my console.

    ti.sysbios.heaps.HeapMem: line 307: out of memory: handle=0x8097e8, size=56

    Status: -1

    IPC_start failed

    I've increased the heapMemParams.size significantly to 0x10000000 but its the same.

    Ive looked at heapmem in ROV, initially the free space available for when my heapmem at size 0x08000000 and 0x10000000 are 0x07fffd10 and 0x0ffffd10 respectively, but once I resume core0 the heap men left suddenly dropped to 0x0, with the same error message.

    In ROV->HeapMem->FreeList, before and aftee I run the program, I see the following:

    Before,

    Address: 0x80000000, size: 0x2f0, next: 0x800002f0, status: in use

    Address: 0x800002f0, size: 0x7fffd10, next: 0x0, status: Free

    After,

    Address: 0x80000000, size: 0x400, next: 0x80000400, status: in use

    Address: 0x80000400, size: 0x0, next: 0x0, status: Free

    Address: 0x80000400, size: 0x7fffc00, next: 0x88000000, status: in use

  • Jonathan,

    The memory for SharedRegion zero must be valid before Ipc_start() can be called. IPC_start failed indicates that either the SharedRegion zero is not valid or has not been setup yet so Ipc_start may be called again.

    I have checked your .cfg also, seems there is no issue. Is it possible share your project to investigate and provide the technical solution.

  • Hi,

    I'm working in an offline environment, I'll see if I can get it online.

    In the mean while I'd like to clarify some stuff.

    1. I'm receiving the error on the heapmem out of memory, why is it linked to shared region? My heapmem is in DDR3 while shared region is in MSMCSRAM.

    2. In my error, it shows handle=0x8097e8. I read from another post, someone mentioned that the handle points to the address where out of memory occurs? But my heapmem is in ddr3 which is address 0x8000000 onwards. Or sld I just ignore the handle as it giving me rubbish address due to the out of memory error?

    3. What is the heap created by heapmem used for? What actually uses that heap? Since IPC uses shared region. Because in ROV, it shows that heapmem was suddenly filled with no free space left after I run my program, and I've allocated a really large size for heap.

    Thanks for your patience.

  • Hi,

    I've solved the issue with some help from a colleague, but i'm still having some doubts and questions in mind.

    Firstly, how i solve the issue:

    I commented away the following code(in blue), and changed the Program.heap size(in red), and it worked just fine.

    //var heapMemParams = new HeapMem.Params();
    //heapMemParams.size = 0x8000000;
    //heapMemparams.sectionName = "systemHeapMaster";
    //Program.global.heap0 = HeapMem.create(heapMemParams);
    //Memory.defaultHeapInstance = Program.global.heap0;

    //var Memory = ........
    //Memory.defaultHeapSize = 0x10000;
    Program.heap = 0x16384;

    So my question is this:
    Why and what is the heapMemParams heap used for? It creates a heap in the DDR3 with quite a huge heap size. But what exactly are the uses of this heap? Because this code appears quite frequently in the examples such as the MessageQ demo, i need to know if removing this section in my cfg file will cause issues in the future.

    Thanks.