xQueueReceive not receiving the data

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

xQueueReceive not receiving the data

Jump to solution
1,969 Views
vinothkumars
Senior Contributor IV

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
Reply
1 Solution
1,932 Views
vinothkumars
Senior Contributor IV

Hi @ErichStyger 

 

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
Reply
5 Replies
1,964 Views
ErichStyger
Specialist I

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
Reply
1,958 Views
vinothkumars
Senior Contributor IV

Thank you @ErichStyger 

 

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
Reply
1,953 Views
ErichStyger
Specialist I

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
Reply
1,933 Views
vinothkumars
Senior Contributor IV

Hi @ErichStyger 

 

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

Regards,
Vinothkumar Sekar
0 Kudos
Reply
1,949 Views
vinothkumars
Senior Contributor IV

Thank you @ErichStyger for your reply.

Regards,
Vinothkumar Sekar
0 Kudos
Reply