Shop OBEX P1 Docs P2 Docs Learn Events
Using cogstart from an XMMC mem model program — Parallax Forums

Using cogstart from an XMMC mem model program

sssidneysssidney Posts: 64
edited 2012-08-24 11:09 in Propeller 1
hi,

Is it possible to successfully call cogstart from a XMMC program?

In case it is OK - here's my test code:
#include <stdio.h>
#include <propeller.h>

extern _Driver _SimpleSerialDriver;

_Driver *_driverlist[] = {
  &_SimpleSerialDriver,
  NULL
};


long dummyCogStack[128];

void dummy1(void *dum1)
{
  while(1);
}

int dummyArg = 123;

int main(void)
{
    int dummyCogId;
  
   waitcnt(CLKFREQ+CNT); // pause for terminal to open

   printf("starting in cog %d\n", cogid());
   
    dummyCogId = cogstart(&dummy1, &dummyArg, dummyCogStack,  sizeof(dummyCogStack));
    printf("cogstart %d\n", dummyCogId);
    while(1);
    return 0;
}


I get the following output when using XMMC mem model:
starting in cog 3cogstart -1

All is OK when using LMM:
starting in cog 0cogstart 1

I am using a C3 board.

Comments

  • ersmithersmith Posts: 6,096
    edited 2012-08-24 11:09
    sssidney wrote: »
    hi,

    Is it possible to successfully call cogstart from a XMMC program?

    No. Unfortunately, the current XMM kernel and cache mechanism does not allow multiple COGs to run XMM C code at the same time. We're looking into improving this.

    You can run COG C code on the other cogs in XMM mode.
Sign In or Register to comment.