bug in cmsisOS api wrapper for FreeRTOS

baduf wrote on Wednesday, February 11, 2015:

STM32Cube from ST micro provides project code generation for FreeRTOS along with a wrapper dedicated to use of the CMSIS-OS API.
Nevertheless, it seems that this wrapper is brocken regarding the FreeRTOS API function “vTaskDelayUntil()” wich is wrapped to “osDelayUntil()” according to the following code from cmsis_os.c:

* @brief  Delay a task until a specified time
* @param   PreviousWakeTime   Pointer to a variable that holds the time at which the
*          task was last unblocked.
* @param   millisec    time delay value
* @retval  status code that indicates the execution status of the function.
osStatus osDelayUntil (uint32_t PreviousWakeTime, uint32_t millisec)
#if INCLUDE_vTaskDelayUntil
  portTickType ticks = (millisec / portTICK_RATE_MS);
  portTickType previouswake = (portTickType) PreviousWakeTime;
  vTaskDelayUntil(&previouswake, ticks ? ticks : 1);
  return osOK;
  (void) millisec;
  (void) PreviousWakeTime;
  return osErrorResource;

In the freeRTOS API, the first argument of this function is a pointer to a variable that holds the time at which the task was last unblocked and this variable is automatically updated within vTaskDelayUntil(). Nevertheless, as you can note, the wrapper don’t use a pointer anymore. That is, the local variable couldn’t be updated anymore and the function is unusable.

I’m not sure that it is the right place for reporting it, but I don’t know where to do so…

Many thanks in advance for your help.

Best regards,


rtel wrote on Wednesday, February 11, 2015:

Thanks for reporting this - we have not been involved in creating the wrapper but I will bring it to ST’s attention for you.