cancel
Showing results for 
Search instead for 
Did you mean: 

How to use [osKernel Suspend] in CMSIS ver 2.0 FreeRTOS

Htera.1
Associate II

When using CMSIS ver2, I enter ASSERT and the task stops working.

If you check vTaskDelay () in task.c, it seems that configASSERT (uxSchedulerSuspended == 0); is responding to ASSERT.

First, will uxSchedulerSuspended not enter ASSERT by setting it to something other than 0?

Second, it seems to use osKernel Suspend to make uxSchedulerSuspended non-zero, but it's not implemented.

Is there a function that can be used as an alternative?

Lastly, I am sorry for the poor English because it is English using translation software.

If you like, please answer.

3 REPLIES 3
Pavel A.
Evangelist III

Probably you call vTaskDelay in a critical section. If so , don't do this.

> will uxSchedulerSuspended not enter ASSERT by setting it to something other than 0?

Heaven forbid you from tampering with internal kernel data.

-- pa

Htera.1
Associate II

Thank you for answer.

>> will uxSchedulerSuspended not enter ASSERT by setting it to something other than 0?

>Heaven forbid you from tampering with internal kernel data.

It means this problem's cause is vTaskDelay is called in a critical section.

So I should change that vTaskDelay isn't called In a critival section.​

Thank you

I will check it.

Htera.1
Associate II

I'm sorry in quick succession.

I checked, but I didn't call vTaskDelay.

I never call vTaskDelay in a critical section.

Is there something something other possible?

In addition, I'm creating a system to launch a task using the event flag.

I will not be able to start the task in the event flag during operation.

What possibilities do you think?