hi
i'm using s32k312 chips.
i'm trying to send the multi message via CAN port using Queue structure.
(i'm switching the TASK using the binary semaphore.)
i created 3 TASK and try to use Queue Library.(one thing be used to release the semaphore)
TASK1, create the the queue using
static QueueHandle_t QUEUE; // global variable
Queue = xQueueCreate(10, 16);
typedef struct{
uint32_t id;
uint8_t length;
uint8_t data[8];
}CAN_DATA;
CAN_DATA CANTxData;
TASK2, insert item into the Queue using xQueueSendToBack(QUEUE, &CANTxData, 0);
buf = {52, 0, 1, 0, 0, 0, 1, 0}, id = 0x601, length = 8. -> CAN_DATA CAN_1 value
buf1 = {0, 0, 0, 0, 1, 1, 0, 20}, id = 0x600, length = 8. -> CAN_DATA CAN_2 value
xQueueSendToBack(CAN_QUEUE, CAN_1, 0);
xQueueSendToBack(CAN_QUEUE, CAN_2, 0);
vApplicationIdleHook(){
CAN_DATA *CANRxDATA;
BaseType_t status;
status = xQueuePeekFromISR(CAN_QUEUE, &CANRxDATA);
if (status == pdTRUE){
status = xQueueReceiveFromISR(CAN_QUEUE, &CANRxDATA, NULL);
if (status==pdTRUE){
Flexcan_Ip_DataInfoType message_Type =
{
.msg_id_type = FLEXCAN_MSG_ID_STD,
.data_length = CANRxDATA -> length,
.is_polling = FALSE,
.is_remote = FALSE
};
Flexcan_Ip_Send(INST_FLEXCAN_2, CAN2_TXMAILBOX, &message_type, CANRxDATA -> id, (uint8_t *) CANRxDATA -> data);
}
}
}
FlexCAN configuration is
(platform.os.freertos : 1.0.0)
And FreeRTOS peripheral configuration is
in section QUEUE,
queue registry size : 2
(the check box)disable use queue sets.
in this configuration, i release the F/W and return the CAN Value like
0x600, data[8] = 00 00 00 00 01 01 00 14, length : 8.
don't response the CAN_id is 0x601.(the last input item be responsed)
in addition i changed xQueueSendToFront , but result is same.
through debugging, i confirm the ucWatingMessage set 2, and the memory address be changed. (with yellow below)
if i wanna send the CAN Data(2 or more message in time) with Queue, how can i do for it?
let me know the solution about configuration or Code.