cancel
Showing results for 
Search instead for 
Did you mean: 

CMSIS RTOS optional

_EFrie
Associate III

Why in particular has the CMSIS freertos wrapper been chosen as the only option for the cubeMX ecosystem? Has there been any consideration to add a raw FreeRTOS API option to cubeMX?

For an example of what seems iffy, see osThreadNew in cmsis_os2.c where it tries to standardize the stack size. While this may seem ideal, it really is a cause for confusion. Also, being forced to use 56 levels of priority for the complete FreeRTOS project seems questionable.

About its use the the USB stack, its mixed use from ISR non ISR seems a bit sketchy maybe? Shouldn't this be better defined?

For the USB stack, I wish it was something like

#if (USBH_USE_OS == 1U)
      phost->os_msg = (uint32_t)USBH_PORT_EVENT;
#if (USBH_FREERTOS_API)
      xQueueSendToBack (phost->os_event, phost->os_msg, 0U)
#elif (osCMSIS < 0x20000U)
      (void)osMessagePut(phost->os_event, phost->os_msg, 0U);
#else
      (void)osMessageQueuePut(phost->os_event, &phost->os_msg, 0U, NULL);
#endif

0 REPLIES 0