Hi
I'm using the IPC function Stream_write (which itself contains Stream_issue and Stream_reclaim) together with the I2C PSP Driver. I set a timeout value for the Stream_write function in case of wrong addressing in I2C.
When I receive a timeout and try to write again via I2C I receive the assertion "assertion failure: A_pendingReclaims: Packets issued but not reclaimed"
The cdoc documentation as well as the IPC_Users_Guide.pdf tell that one has to use Stream_abort() on a timed out Stream Handle to be able to Stream_reclaim the packet after this call. So I implemented this (the remaining part of the project is left as delivered by the pspdriver package):
size = Stream_write(
i2c_outHandle,
&dataBuffer,
(SizeT)dataBuffer.bufLen,
50,
eb);
if ((TRUE == Error_check(eb)) && (dataBuffer.bufLen != size))
{
Stream_abort(i2c_outHandle, NULL);
Stream_reclaim(i2c_outHandle, (Ptr *)&dataBuffer, BIOS_WAIT_FOREVER, NULL, NULL);
System_printf("I2c Write: Data Write Failed: %d\n",Error_getCode(eb));
}
The packet will not be received even though abort was called. I instead stay in the Stream_reclaim function forever
SizeT Stream_reclaim(Stream_Object *obj, Ptr *bufp, UInt timeout, UArg *arg,
Error_Block *eb)
{
(...)
while (obj->ready == 0) {
if (!Sync_wait(obj->complete, timeout, eb)) { //<- stays here forever
if (timeout != 0) {
Error_raise(eb, Stream_E_timeout, timeout, 0);
}
return (0);
}
};
(...)
Thanks for any help on this
Stefan