14 Replies Latest reply on Apr 6, 2017 12:03 AM by Vito Marolda

    CMSIS RTOS feature osSignal incorrectly implemented on FreeRTOS

    Oskar Weigl
      Hi,
      I was checking through the implementation of osSignal in the file installed by STM32CubeMX to "Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.c"

       

      The CMSIS RTOS API specifies that the call to osSignalWait will "Suspend the execution of the current running thread until ALL specified signal flags with the parameter signals are set."
      This is exactly the behavior of the FreeRTOS function xEventGroupWaitBits. However, in the osSignal implementation, the FreeRTOS primitive "TaskNotify" is used. As noted on this page, "Unlike when using an event group the receiving task cannot specify that it only wants to leave the Blocked state when a combination of bits are active at the same time. Instead the task is unblocked when any bit becomes active, and must test for bit combinations itself."
      This means that the osSignal functionality does not behave as specified.
      Please let me know if I have misunderstood the situation, or please let me know how this can be fixed?
      Cheers,
      Oskar