We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
The inside of the osEventFlagsSet
If (xEventGroupSetBitsFromISR (hEventGroup (EventBits_t) flags, & yield) != pdFAIL)
Should be changed to
If (xEventGroupSetBitsFromISR (hEventGroup (EventBits_t) flags, & yield) == pdFAIL)
uint32_t osEventFlagsSet (osEventFlagsId_t ef_id, uint32_t flags) { EventGroupHandle_t hEventGroup = (EventGroupHandle_t)ef_id; uint32_t rflags; BaseType_t yield;
if ((hEventGroup == NULL) || ((flags & EVENT_FLAGS_INVALID_BITS) != 0U)) { rflags = (uint32_t)osErrorParameter; } else if (IS_IRQ()) { yield = pdFALSE;
if (xEventGroupSetBitsFromISR (hEventGroup, (EventBits_t)flags, &yield) != pdFAIL) { rflags = (uint32_t)osErrorResource; } else { rflags = flags; portYIELD_FROM_ISR (yield); } } else { rflags = xEventGroupSetBits (hEventGroup, (EventBits_t)flags); }
return (rflags);}
Thanks for reporting, but a closer investigation requires:
1. A detailed explanation of your suggestion
2. A confirmation of the versions in use of:
- the ARM::CMSIS Pack (https://www.keil.com/pack/doc/CMSIS/RTOS/html/index.html)
- Keil MDK 5 (http://www2.keil.com/mdk5)
3. A Support Ticket created with your Arm-account: https://www2.keil.com/support/silver?P=&V=&S=
4. ...and attached to this ticket a demonstrating code snippet/project
Hello! This looks like FreeRTOS code. So, you should contact the authors of this, if there is a problem with it.
This looks like an old bug from CMSIS-FreeRTOS, which was fixed with the following commit:- osEventFlagsSet in correctly handles status return from xEventGroupSe… · ARM-software/CMSIS-FreeRTOS@7823ec0 (github.com)If possible update to the latest version to avoid hitting old bugs.