Skip to main content
Visitor II
January 6, 2021
Question

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

  • January 6, 2021
  • 3 replies
  • 1420 views

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.

    This topic has been closed for replies.

    3 replies

    Super User
    January 6, 2021

    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.1Author
    Visitor II
    January 7, 2021

    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.1Author
    Visitor II
    January 7, 2021

    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?