AnsweredAssumed Answered

wrong return value for osSignalWait ?

Question asked by katzenberger.michael on Oct 17, 2016
Latest reply on Jan 10, 2017 by Jeanne Joly

Hi !

I'm using freeRTOS with STM32CubeMX.
While playing with signals for inter-thread communication I came across the different return value of function osSignalSet()

The CMSIS standard states:

int32_t osSignalSet(osThreadId thread_id, int32_t signals)
 
Parameters
    [in]    thread_id    thread ID obtained by osThreadCreate or osThreadGetId.
    [in]    signals    specifies the signal flags of the thread that should be set.
 
Returns
    previous signal flags of the specified thread or 0x80000000 in case of incorrect parameters.


    
But STM32CubeMX creates:

/**
* @brief  Set the specified Signal Flags of an active thread.
* @param  thread_id     thread ID obtained by \ref osThreadCreate or \ref osThreadGetId.
* @param  signals       specifies the signal flags of the thread that should be set.
* @retval  osOK if successful, osErrorOS if failed .
* @note   MUST REMAIN UNCHANGED: \b osSignalSet shall be consistent in every CMSIS-RTOS.
*/
int32_t osSignalSet (osThreadId thread_id, int32_t signal)

And indeed the only return values are osErrorOS (=255) or osOK (=0) !

Same applies to function osSignalClear()

Bug or feature ??? ;-)

Best regards,
Michael.

Outcomes