Question
STM32Cube - bug in cmsisOS api regarding FreeRTOS
Posted on February 02, 2015 at 10:30
STM32Cube 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) { &sharpif INCLUDE_vTaskDelayUntil portTickType ticks = (millisec / portTICK_RATE_MS); portTickType previouswake = (portTickType) PreviousWakeTime; vTaskDelayUntil(&previouswake, ticks ? ticks : 1); return osOK; &sharpelse (void) millisec; (void) PreviousWakeTime; return osErrorResource; &sharpendif } 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. Of course, it is easy to fix by ourself, but the file cmsis_os.c from STM32Cube should be updated. 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, BaDuf #freertos #cubemx #cmsis #os