This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Between osKernelInitialize() and osKernelStart()

Hi.

Is it possible to use osDelay() between osKernelInitialize() and osKernelStart()?

I ran osMutexCreate () after osKernelInitialize (). Is it possible to use osMutexWait() before osKernelStart() next?

#I live in Japan so my English is not good.

zunda

Parents

  • The RTOS automatically switches when an event happens. An event could be a message, a timeout, etc. This is by design.
    This switching is not good if your code is initializing peripherals, or creating new threads. You need everything created and initialized first, so things will work properly when an event comes in.

    It is oversimplified, but calling osKernelInitialize() pauses the RTOS ticks, and these ticks control timeouts, countdowns, timers for the RTOS. With the ticks paused, you can initialize things without interruption. When you are done initializing, start the RTOS running again by calling osKernelStart().

    Calling osdelay() after osKernelInitialize() won't work, because (oversimplified) The RTOS Kernel paused sending out ticks. There are no incoming ticks for the osdelay() to countdown with.

Reply

  • The RTOS automatically switches when an event happens. An event could be a message, a timeout, etc. This is by design.
    This switching is not good if your code is initializing peripherals, or creating new threads. You need everything created and initialized first, so things will work properly when an event comes in.

    It is oversimplified, but calling osKernelInitialize() pauses the RTOS ticks, and these ticks control timeouts, countdowns, timers for the RTOS. With the ticks paused, you can initialize things without interruption. When you are done initializing, start the RTOS running again by calling osKernelStart().

    Calling osdelay() after osKernelInitialize() won't work, because (oversimplified) The RTOS Kernel paused sending out ticks. There are no incoming ticks for the osdelay() to countdown with.

Children