Skip to main content
bitlischieber
Associate III
May 27, 2019
Question

OSWrapper für FreeRTOS CMSIS v2

  • May 27, 2019
  • 3 replies
  • 1482 views

Hi

Is there already a OSWrapper_cmsis.cpp for FreeRTOS v2?

Currently I am stuck because the OSWrapper_cmsis.cpp seems to be for v1.

I tried to port my Atollic Project to FreeRTOS CMSIS v2.

However there a now a lot of compiler failures left, which I cannot handle.

It seems like there are some includes missing ("vTaskSetApplicationTaskTag was not declared in this Scope", "TaskHandle_t was not declared in this scope" in FreeRTOS.h).

Br. Raphael

This topic has been closed for replies.

3 replies

bitlischieber
Associate III
May 28, 2019

Ok, I created a new project with CMSIS v2 and it is not compilable out of box.

It seems TouchGFX causes a conflict with CMSIS v2.

If I exclude all TGX folders and references in the code I can get it to compile after fixing this:

const osThreadAttr_t defaultTask_attributes = {
	.name = "defaultTask",
	.stack_size = 4096,
	.priority = (osPriority_t) osPriorityNormal
 };

Triggers a "sorry, unimplemented: non-trivial designated initializers not supported" error.

The code has to be changed to:

 const osThreadAttr_t defaultTask_attributes = {
	.name = "defaultTask",
	.attr_bits = osThreadDetached,
	.cb_mem = NULL,
	.cb_size = 0,
	.stack_mem = NULL,
	.stack_size = 4096,
	.priority = (osPriority_t) osPriorityNormal,
	.tz_module = 0,
	.reserved = 0
 };

However, with TGX included I had no luck until now.

Pavel A.
May 28, 2019

This is probably because TGX causes all source files, even C, to compile as C++.

C++ is not an absolute superset of c99 (or c11) yet.

-- pa

bitlischieber
Associate III
May 29, 2019

I migrated now the OSWrapper_cmsis.cpp file and it compiles now fine.

First I had an error, that the timing was not correct.

Apperently you mustn't inser "NULL" for the "void *msg_ptr

" argument of "osMessageQueueGet(..)".

Now it works with v2!