I am using K22, 1M flash microcontroller
I am getting a strange error.
I am sending data on SPI bus. I need to send it 84 packets (2 byte each), one after another, without delay.
Everytime after 10-100 loops, my task is getting hanged. After debugging MQX tad, it says LWSEM_BLOCKED.
If I give 5 ms delay in between SPI calls then it is working good.
My task is MQX_TIME_SLICE_TASK.
I am using SPI0 port. no other task is using SPI0.
1 other task is using SPI 1. I tried blocking that task but no impact.
each of the 84 time, I send use instruction
numberOfBytesSent_pwm = fwrite (Data_toSend_PWM, 1, 2, SPI0_FD);
my finding was i was exceeding allocated time for this task. if i give delay after every SPI command, i am good.
what is good way yo increase allocated time to task, do we have any example.
i have read from Forum, they are saying to change this number. i did but not able to increase task allocated time.
1) i want to set 100ms time to this task. there are so many things in this task. what is the way
2) if we give time_delay in 1 task my task is switching to other task. is there is way that we give delay and task do not switch to other task. this i am asking in general as i am working ion MQX