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

How to suspend the CMSIS RTOS (not RTX)

I am using the CMSIS RTOS (not RTX) and this RTOS seems to be interfering with a time critical process I have for programming a FPGA so I need to suspend this RTOs until I am finished doing that.

In RTX I could call os_suspend. I have implemented this same call with CMSIS RTOS and it does not seem to do anything. Threads are still functioning as well as mailboxes timers etc.

How can I suspend the CMSIS RTOS?

There is no documenation anywhere about this

Parents
  • And here is a 3 method that does a more sophisticated way of handling nested critical sections (which I do not have).

    static inline uint32_t sl_hw_lock(void) __attribute__((always_inline, unused));
    static inline void sl_hw_unlock(uint32_t primask) __attribute__((always_inline, unused));

    /** * Lock interrupts to start a critical section. * * When used with sl_hw_unlock() this function starts a critical section that * works properly even if nested in another critical section because it reads * the PRIMASK value so it can be restored. * * @return the priority mask (PRIMASK) register value upon entry */
    static inline uint32_t
    sl_hw_lock(void)
    { uint32_t primask;

    asm volatile("mrs %0, primask\n" : "=r" (primask)::); __disable_irq(); return primask;
    }

    /** * Unlock interrupts to end a critical section. * * When used with sl_hw_lock() this function ends a critical section that works * properly even if nested in another critical section because it uses the * previous interrupt locking state (defined by PRIMASK) to selectively unlock * interrupts. * * @param primask The previous priority mask (PRIMASK) register value as * returned by sl_hw_lock(). */
    static inline void
    sl_hw_unlock(uint32_t primask)
    { if (primask == 0) { __enable_irq(); }
    }

Reply
  • And here is a 3 method that does a more sophisticated way of handling nested critical sections (which I do not have).

    static inline uint32_t sl_hw_lock(void) __attribute__((always_inline, unused));
    static inline void sl_hw_unlock(uint32_t primask) __attribute__((always_inline, unused));

    /** * Lock interrupts to start a critical section. * * When used with sl_hw_unlock() this function starts a critical section that * works properly even if nested in another critical section because it reads * the PRIMASK value so it can be restored. * * @return the priority mask (PRIMASK) register value upon entry */
    static inline uint32_t
    sl_hw_lock(void)
    { uint32_t primask;

    asm volatile("mrs %0, primask\n" : "=r" (primask)::); __disable_irq(); return primask;
    }

    /** * Unlock interrupts to end a critical section. * * When used with sl_hw_lock() this function ends a critical section that works * properly even if nested in another critical section because it uses the * previous interrupt locking state (defined by PRIMASK) to selectively unlock * interrupts. * * @param primask The previous priority mask (PRIMASK) register value as * returned by sl_hw_lock(). */
    static inline void
    sl_hw_unlock(uint32_t primask)
    { if (primask == 0) { __enable_irq(); }
    }

Children
No data