xQueueReceive not receiving the data

cancel
Showing results for 
Search instead for 
Did you mean: 

xQueueReceive not receiving the data

Jump to solution
133 Views
vinothkumars
Senior Contributor III

Hi All,

 

I am working IMX8QM-MEK with SDK (2.5.1).

xQueueSend is able to send the data and return TRUE. But, xQueueReceive not able receive the data. 

 

 

Regards,
Vinothkumar Sekar
0 Kudos
1 Solution
96 Views
vinothkumars
Senior Contributor III

Hi @ErichS 

 

It is problem with Camera and display resource. I commented those resource uses and it's working

Regards,
Vinothkumar Sekar

View solution in original post

0 Kudos
5 Replies
128 Views
ErichS
Senior Contributor III

Hi @vinothkumars ,

it would be really good if you could share a bit more of the details, as there might be many causes for this, including some other task already consuming the data.

Or at least provide an reduced example to look at.

Erich

0 Kudos
122 Views
vinothkumars
Senior Contributor III

Thank you @ErichS 

 

for the quick reply. Please find the example code here,

 

vendor/nxp/mcu-sdk-auto/SDK_MEK-MIMX8QM/boards/mekmimx8qm/demo_apps/rear_view_camera/cm4_core1/automotive.c

 

int do_gear_state(struct cmd_tbl_s *cmd_tbl, int argc, char * const argv[])
{
vehicle_state_t vstate;
uint32_t gear_idx;
char *endptr;
if (argc != 2)
return CMD_RET_USAGE;

gear_idx = strtol(argv[1], &endptr, 0);

vstate.type = STATE_TYPE_GEAR;
vstate.value = gear_idx;

if(xQueueSend(xVStateQueue, (void *)&vstate, (TickType_t)0))
{
PRINTF("Sending gear ++++++++++++++++++ \r\n");
}else{
PRINTF("not able to Send gear ++++++++++++++++++ \r\n");
}

return 0;

}




static void vehicle_state_monitor_task(void *pvParameters)
{
EventBits_t resBits;
vehicle_state_t stateMsg;
uint8_t reqData[SRTM_USER_DATA_LENGTH];
static uint32_t pre_gear_state = AUTO_GEAR_NONE;
TaskHandle_t regHandle;

android_registered_flag = 0;
while (true)
{
PRINTF("+++++++++++++++++ %s ++++++++++++++++++ \r\n", __func__);
if (xQueueReceive(xVStateQueue, &stateMsg, portMAX_DELAY))
{

PRINTF("+++++++++++++++++ %s ++++++++++++++++++ 1\r\n", __func__);

}

}
Regards,
Vinothkumar Sekar
0 Kudos
117 Views
ErichS
Senior Contributor III

Hi @vinothkumars ,

that code looks good in general, so I don't see an obvious problem.

What I would suggest:

- check your task stack sizes, if there is enough stack space available. You have

SRTM_USER_DATA_LENGTH

which potentially could be very large

- You need to check you code with the debugger: inspect the queue with the FreeRTOS views (see https://mcuoneclipse.com/2017/03/18/better-freertos-debugging-in-eclipse/)

 

I hope this helps,

Erich

0 Kudos
97 Views
vinothkumars
Senior Contributor III

Hi @ErichS 

 

It is problem with Camera and display resource. I commented those resource uses and it's working

Regards,
Vinothkumar Sekar

View solution in original post

0 Kudos
113 Views
vinothkumars
Senior Contributor III

Thank you @ErichS for your reply.

Regards,
Vinothkumar Sekar
0 Kudos