I try to update a ScreenView from TouchGFX.
There is incoming data from RX and passed to ScreenView with RTOS binary semaphore checking for “message-ready-flag”.
Thats the error:
error: invalid conversion from ‘osSemaphoreId_t’ {aka ‘void*’} to ‘QueueHandle_t’ {aka ‘QueueDefinition*’} [-fpermissive]
I get this error in the line where if( xSemaphoreTake( binarySemUartMsgHandle, ( TickType_t ) 10 ) == pdTRUE ), is called.
You should either stick to the CMSIS wrapper API or use native FreeRTOS API.
So either find the CMSIS function to handle (binary) semaphores or use FeeRTOS SemaphoreHandle_t xSemaphoreCreateBinary( void );
I will try to understand your answer, you mean i should use either the custom CMSIS warpper or i should use the raw FreeRTOS wrappers not both mixed?
(I should probably prefer the CMSIS one?)
The key point is that if you want the generality of the wrapper, you shouldn’t assume that the wrapper handle and the FreeRTOS primitive handle are actually the same thing. Some wrappers may actually create a new object that the handle points to that contains the FreeRTOS handle in it.
A Second point is that the “purpose” of using something like the CMSIS wrappers is to allow the easy chaining of what RTOS you are going to use. This means you code shouldn’t directly call ANY FreeRTOS functions, or you have just negated that advantage.
I find it rarely makes sense to change the OS for an application, so I find little use for something like CMSIS
The one exception to this would be for writing ‘library’ code. It might make sense when writing a general purpose library to want it to be usable for multiple RTOSes, and so the library might use CMSIS or some other wrapper. Such a Library would use CMSIS, and thus application parts that need to share with that library would end up needing to use the CMSIS api.
The one limitation I will add about CMSIS, is it basically locks you into the ‘ARM’ ecosystem, as it is an ARM based wrapper. I program based on directly using FreeRTOS is portable to other processor families.