- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Problem:
Wiced with freertos working incorectly, because using counting semaphore.
Quick way to resolve in fuction hostinitsemaphore create mutex with xCreateSemaphoreBinary.
And need remove 2 assert in hostsetsemaphore and it must allways return true.
Example problem:
1. Uart init semaphore and enable interupt
2. Interupt occurs - counting semaphore increase self value to 1
3. UartReceive fuction getsemaphore for waiting data - semaphore decrease it value to 0 but not block. Uart receive 0 bytes or not full pscket..
4. Goto 2 point....
After correction:
1. Uart init semaphore and enable interupt
2. Interupt occurs - unlock semaphore
3. UartReceive fuction getsemaphore (lock) for waiting data in block mode.
4. Interupt fullrx occurs setsemaphore (unlock) task in 3 point receive full packet.
Similar scenarious can occurs anywhere.