Hello again,
I am using XDC v3.23.2.47 with SYS/BIOS 6.33.5.46. IPC is version 1.24.3.32 and I also have PSP 3.0.1.00. All using CCSv5.1.
I am trying to get the IPC IOMAdapter with streams to work with an old iom driver written for DSP/BIOS 5. I am currently having 2 problems.
First, I notice when my program comes out of c_int00() that SYS/BIOS is calling my IOM Adapter create() function before bind(). This is a problem because bind is suppose to setup my device (*devp) with the parameter devParams which is later used in create(). Is this intended behavior, or am I doing something wrong? I am currently able to work around this by finding out where my devParams are in memory and changing the *devp when create() is called. Here is the driver and streams setup:
var IomParams = new IomAdapter.Params();
IomParams.instance.name = "myIOM";
IomParams.iomFxns = "&IomFunctions";
IomParams.initFxn = "&IomInit";
IomParams.deviceId = 0;
IomParams.deviceParams = null;
Program.global.myIOM = IomAdapter.create(IomParams);
DriverTable.addMeta("/myIOM", Program.global.myIOM);
var stream0Params = new Stream.Params();
stream0Params.instance.name = "stream0";
Program.global.stream0 = Stream.create("/myIOM", Stream.OUTPUT, stream0Params);
var stream1Params = new Stream.Params();
stream1Params.instance.name = "stream1";
Program.global.stream1 = Stream.create("/myIOM", Stream.INPUT, stream1Params);
Simple producer/consumer tasks using the two streams as inputs:
var task0Params = new Task.Params();
task0Params.instance.name = "task0";
task0Params.arg0 = Program.global.stream1;
task0Params.priority = 2;
Program.global.task0 = Task.create("&task0Fxn", task0Params);
var task1Params = new Task.Params();
task1Params.instance.name = "task1";
task1Params.arg0 = Program.global.stream0;
task1Params.priority = 3;
Program.global.task1 = Task.create("&task1Fxn", task1Params);
The second issue I am seeing is that both my streams (one input and one output) are giving IOM_READ commands in their IOM_Packet. When I do a Stream_issue() on both streams I go to my IOM_Submit() function. One of the parameters is a pointer to IOM_Packet. I believe my OUTPUT stream is suppose to give a IOM_WRITE command instead of an IOM_READ command (this is how the driver was written for DSP/BIOS 5). If I manually change this value during debug to IOM_WRITE my program works as I expect. What am I doing wrong to have both streams appear as reading?
Here's my tasks:
Void task0Fxn (Stream_Handle inStream)
{
unsigned char bufferIN[1];
xdc_Ptr myBuf1;
unsigned char i;
unsigned long counter=0;
while(1)
{
for (i = 0; i < 1; i++)
{
bufferIN[i] = counter++;
}
Stream_issue(inStream, bufferIN, sizeof(bufferIN), NULL, NULL); /* IOM_READ */
Stream_reclaim(inStream, &myBuf1, BIOS_WAIT_FOREVER, NULL, NULL);
}
}
Void task1Fxn (Stream_Handle outStream)
{
unsigned char bufferOUT[1];
xdc_Ptr myBuf2;
while(1)
{
Stream_issue(outStream, bufferOUT, sizeof(bufferOUT), NULL, NULL); /* IOM_READ */
Stream_reclaim(outStream, &myBuf2, BIOS_WAIT_FOREVER, NULL, NULL);
}
}
Thanks for any help!

