Hello
I have already asked similar question in that thread: 
No one have replied me yet, so I decided to re-ask it and explain my problem more clearly, because last time I maybe explained it too hard to understand. I want to remind whats going on. We are using vision sdk on tda3mv to receive and send CAN messages in the task which is running on ipu1.1 core while vision sdk use-cases running on ipu1.0 core.
I reduced my code down to a couple of functions. The CanRx purpose is to receive CAN messages and sendTest purpose is to transmit them back. This functions using a cicle buffer where they put and get CAN messages, and I believe it is pretty safe:
typedef struct UDSmsg_t
{
uint8_t data[8];
uint8_t len;
uint32_t id;
} UDSmsg;
#define MSG_COUNT 200
UDSmsg UdsQueueMsg[MSG_COUNT];
UDSmsg* FirstUdsMsg;
UDSmsg* LastUdsMsg;
void sendTest()
{
Task_sleep(0);
if (LastUdsMsg != FirstUdsMsg)
{
memcpy(&circle_data[0], &FirstUdsMsg->data[0], FirstUdsMsg->len);
circle_len = (uint32_t)FirstUdsMsg->len;
canSend(&circle_data[0], circle_len);
if (FirstUdsMsg + 1 > &UdsQueueMsg[MSG_COUNT]) FirstUdsMsg = &UdsQueueMsg[0];
else FirstUdsMsg++;
}
}
void CanRx(UInt32 id, char* data, int len)
{
if (id == 0x7D4)
{
if ((LastUdsMsg + 1 > &UdsQueueMsg[MSG_COUNT]) && (FirstUdsMsg != &UdsQueueMsg[0]))
{
memcpy(&LastUdsMsg->data[0], data, len);
LastUdsMsg->len = len;
LastUdsMsg->id = id;
LastUdsMsg = &UdsQueueMsg[0];
}
else if (LastUdsMsg + 1 != FirstUdsMsg)
{
memcpy(&LastUdsMsg->data[0], data, len);
LastUdsMsg->len = len;
LastUdsMsg->id = id;
LastUdsMsg++;
}
}
}
void UDS_Task(UArg arg0, UArg arg1)
{
FirstUdsMsg = &UdsQueueMsg[0];
LastUdsMsg = &UdsQueueMsg[0];
System_dcanStart(CanRx);
Task_sleep(100);
while (1)
{
sendTest();
}
}
Task creation happens in the initialization of ipy1.1 core in app_init_ipu1_1.c and that how does it look like:
Task_Handle UDStask; Task_Params UDSparams; Error_Block eb; #pragma DATA_ALIGN(gSwUserBuffer, 32); uint8_t gSwUserBuffer[10 * 1024]; Error_init(&eb); Task_Params_init(&UDSparams); UDSparams.stackSize = 10 * 1024; UDSparams.priority = 4U; UDSparams.affinity = 0x1; UDSparams.stack = &gSwUserBuffer[0]; UDStask = Task_create(UDS_Task, &UDSparams, &eb);
The problem is: when we send messages with only one ID, its OK,regardless how many type of messages we are sending and how hight their rate is, but if we start to send two messages with one ID and one with some other ID, tda stops to respond. I checked it in separate task with Task_state, and it returns UDStask mode is BLOCKED after that happens. I want to understand why does this task set to blocked state and how can I unblock the task if I don't know what is blocking it?
Best regards, D.K. Tovmachenko.

