MQX 4.0 lwevent problem

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

MQX 4.0 lwevent problem

754 Views
sebastianzubiau
Contributor I

Hello I am using MQX 4.0 with KSDK 1.2.


Basically I have a task that is performing "_lwevent_wait_for(&evento_entrada, 0x1, TRUE, NULL);"

The event is created by the same task with "_lwevent_create(&evento_entrada,LWEVENT_AUTO_CLEAR);"

The event is being set by a GPIO in an interrupt with "_lwevent_set(&evento_entrada, 0x01);"

The problem is that at beginning the code works correctly, but later with a random number of interrupts by the GPIO, it start an infinite loop where the task is not being blocked when actually the event is not set.

Here I attach a screenshot where you can see the problem.

Thanks in advance,

Sebastian.

error lwevent.png

Tags (2)
0 Kudos
Reply
2 Replies

501 Views
DavidS
NXP Employee
NXP Employee

Hi Sebastian,

Two things come to mind.

1) make sure your task priorities are 8 and higher.  Lower priority numbers are reserved for the RTOS and I have seen where a user task at wrong priority can make the lwevent have issues.

2) Upgrade....KSDK_1.3 (http://www.freescale.com/ksdk) and see if this fixes issue.

Regards,

David 

0 Kudos
Reply

501 Views
sebastianzubiau
Contributor I

Thanks David. I checked the task priorities and all was fine.

I discovered that the problem happen when I use the function "UART_DRV_SendDataBlocking(uint32_t instance, const uint8_t * txBuff, uint32_t txSize, uint32_t timeout)"

So I changed it with the non-blocking one.

Now I need to receive from UART in a blocking way and it seems to work corecctly but in a certain moment the task is being blocked waiting for the semaphore and the timeout don't unblock it.

I use "UART_DRV_ReceiveDataBlocking(uint32_t instance, uint8_t * rxBuff, uint32_t rxSize, uint32_t timeout)"

Did you ever hear of that?

Thanks!!

0 Kudos
Reply