Other Parts Discussed in Thread: SYSBIOS
Hi
I have a question regarding Legacy support for MEM_Stat, MBX_create and TSK_create after migrating from DSPBIOS5 to SYSBIOS 6_33_06_50
In my source I used to have the following references to memory segments
extern uint32 SDRAM;
extern uint32 IRAM;
That are used in the source code in the following way:
OS_HMbx OS_MbxCreate(int iMsgSize, int iBufferLength)
{
MBX_Attrs attrs;
attrs.segid = SDRAM;
return (OS_HMbx)MBX_create(iMsgSize, iBufferLength, &attrs);
}
OS_HTask OS_TaskCreate(const char* szTaskName, OS_ETaskPriority eTaskPrio, OS_ETaskStackSize eStackSize, OS_TaskEntryPointType pfnEntryPoint, void *pvArgument)
{
STask* pstTask = (STask*) malloc(sizeof(STask));
pstTask->pfnEntryPoint = pfnEntryPoint;
pstTask->pvArgument = pvArgument;
pstTask->hExitSignal = OS_SemCreate(0);
if (pstTask->hExitSignal != NULL)
{
// configure the stTskAttrs struct
pstTask->stTskAttrs.priority = iTaskPrio[eTaskPrio];
pstTask->stTskAttrs.stack = NULL;
pstTask->stTskAttrs.stacksize = iStackSize[eStackSize];
pstTask->stTskAttrs.stackseg = SDRAM; pstTask->stTskAttrs.environ = NULL;
pstTask->stTskAttrs.exitflag = TRUE;
pstTask->stTskAttrs.name = (String) malloc(strlen(szTaskName) + 1);
if (pstTask->stTskAttrs.name != NULL)
{
// copy task name
strcpy(pstTask->stTskAttrs.name, szTaskName);
// create the task
pstTask->hTask = TSK_create((Fxn)TaskEntryWrapper, &pstTask->stTskAttrs, pstTask);
if (pstTask->hTask != NULL)
{
TaskList_Insert(pstTask->hTask, eTaskPrio, eStackSize);
return pstTask;
}
}
}
return NULL;
}
void OnFdspMemShow(uint32 uiSender)
{
MEM_Stat stat;
MEM_stat(IRAM, &stat); DEBUG("IRAM\n");
DEBUG("Size : %d\n", stat.size);
DEBUG("Used : %d\n", stat.used);
DEBUG("Free : %d\n", stat.size-stat.used);
DEBUG("Length : %d\n", stat.length);
MEM_stat(SDRAM, &stat); DEBUG("SDRAM\n");
DEBUG("Size : %d\n", stat.size);
DEBUG("Used : %d\n", stat.used);
DEBUG("Free : %d\n", stat.size-stat.used);
DEBUG("Length : %d\n", stat.length);
}
After I have migrated to SYSBIOS the linker fails because the two memory segments IRAM and SDRAM are unresolved.
So the questions that I have are
- How do I set the segid to SDRAM when I dynamically create a Mailbox using the legacy API MBX_create in a SYSBIOS application?
- How do I set the stackseg to SDRAM when I dynamically create a Task using the legacy API TSK_create in a SYSBIOS application?
- How do I use the legacy API MEM_stat in a SYSBIOS application
In addition to the switch from DSPBIOS to SYSBIOS I have also changed DSP from C6713 to C6657 so obviously the SDRAM memory segment needs to be renamed to DDR3 and IRAM shall be renamed to L2SRAM.
I have attached my sysbios configuration file .CFG and the old dspbios configurations file .TCF
Jens