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

RTX and tsk_lock()

one simple question
when i disable the scheduler with tsk_lock() just before the systick IRQ will be executed will this IRQ lost ?
for example, every 1ms the scheduler will be called then at time 3.9ms i disable the scheduler, run the code and at time 4.1ms i enable the scheduler again with tsk_unlock().
when will the scheduler called again ?
immediatly after enable the scheduler (4.1ms) or at time 5ms ?
Thanks,
mario

  • In RTX for CM the scheduler will execute again at time 5 ms.

    I tell that because I looked at the code which locks and unlocks the OS.

    RTX locks by writing 0x0005 in the SYSTICK Control and Status Register, and unlocks by writing 0x0007.

    Now bits 0, 1, and 2 are (from [1]):
    0 ENABLE: SYSTICK Timer Enable.
    1 TICKINT: 1 = Enable SYSTICK interrupts genration when SYSTICK Timer reaches 0.
    2 CLKSOURCE: 0 = ..., 1 = Use processor free running clock

    I assume that the SYSTICK still runs even if TICKINT is zero and it just does not generate teh interrutpt.

    For ARM, I dont know, but teh code of OS_LOCK() is inside RTX_Config.c

    Regards, Marco.

    [1] The definitive guide to the ARM CORTEX-M3, Joseph Yiu

  • Hi Marco,
    thank you for your response, now all is clear

    rgds,
    mario