mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 21:11:57 -04:00
Work around SysTick bug for QEMU ARMv8-M (#724)
* Set SysTick CLKSOURCE bit before enabling SysTick * Use portNVIC_SYSTICK_CLK_BIT_CONFIG The workaround now uses portNVIC_SYSTICK_CLK_BIT_CONFIG instead of portNVIC_SYSTICK_CLK_BIT, which saves us from having to explain in the comments why it's OK to temporarily set the CLKSOURCE bit even if the user's FreeRTOS configuration clears the CLKSOURCE bit. Using portNVIC_SYSTICK_CLK_BIT_CONFIG here still correctly prevents the firmware from triggering the QEMU bug.
This commit is contained in:
parent
d02ab775f3
commit
b13e2698bb
|
@ -754,8 +754,15 @@ __attribute__( ( weak ) ) void vPortSetupTimerInterrupt( void ) /* PRIVILEGED_FU
|
||||||
}
|
}
|
||||||
#endif /* configUSE_TICKLESS_IDLE */
|
#endif /* configUSE_TICKLESS_IDLE */
|
||||||
|
|
||||||
/* Stop and reset the SysTick. */
|
/* Stop and reset SysTick.
|
||||||
portNVIC_SYSTICK_CTRL_REG = 0UL;
|
*
|
||||||
|
* QEMU versions older than 7.0.0 contain a bug which causes an error if we
|
||||||
|
* enable SysTick without first selecting a valid clock source. We trigger
|
||||||
|
* the bug if we change clock sources from a clock with a zero clock period
|
||||||
|
* to one with a nonzero clock period and enable Systick at the same time.
|
||||||
|
* So we configure the CLKSOURCE bit here, prior to setting the ENABLE bit.
|
||||||
|
* This workaround avoids the bug in QEMU versions older than 7.0.0. */
|
||||||
|
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT_CONFIG;
|
||||||
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
||||||
|
|
||||||
/* Configure SysTick to interrupt at the requested rate. */
|
/* Configure SysTick to interrupt at the requested rate. */
|
||||||
|
|
|
@ -754,8 +754,15 @@ __attribute__( ( weak ) ) void vPortSetupTimerInterrupt( void ) /* PRIVILEGED_FU
|
||||||
}
|
}
|
||||||
#endif /* configUSE_TICKLESS_IDLE */
|
#endif /* configUSE_TICKLESS_IDLE */
|
||||||
|
|
||||||
/* Stop and reset the SysTick. */
|
/* Stop and reset SysTick.
|
||||||
portNVIC_SYSTICK_CTRL_REG = 0UL;
|
*
|
||||||
|
* QEMU versions older than 7.0.0 contain a bug which causes an error if we
|
||||||
|
* enable SysTick without first selecting a valid clock source. We trigger
|
||||||
|
* the bug if we change clock sources from a clock with a zero clock period
|
||||||
|
* to one with a nonzero clock period and enable Systick at the same time.
|
||||||
|
* So we configure the CLKSOURCE bit here, prior to setting the ENABLE bit.
|
||||||
|
* This workaround avoids the bug in QEMU versions older than 7.0.0. */
|
||||||
|
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT_CONFIG;
|
||||||
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
||||||
|
|
||||||
/* Configure SysTick to interrupt at the requested rate. */
|
/* Configure SysTick to interrupt at the requested rate. */
|
||||||
|
|
|
@ -754,8 +754,15 @@ __attribute__( ( weak ) ) void vPortSetupTimerInterrupt( void ) /* PRIVILEGED_FU
|
||||||
}
|
}
|
||||||
#endif /* configUSE_TICKLESS_IDLE */
|
#endif /* configUSE_TICKLESS_IDLE */
|
||||||
|
|
||||||
/* Stop and reset the SysTick. */
|
/* Stop and reset SysTick.
|
||||||
portNVIC_SYSTICK_CTRL_REG = 0UL;
|
*
|
||||||
|
* QEMU versions older than 7.0.0 contain a bug which causes an error if we
|
||||||
|
* enable SysTick without first selecting a valid clock source. We trigger
|
||||||
|
* the bug if we change clock sources from a clock with a zero clock period
|
||||||
|
* to one with a nonzero clock period and enable Systick at the same time.
|
||||||
|
* So we configure the CLKSOURCE bit here, prior to setting the ENABLE bit.
|
||||||
|
* This workaround avoids the bug in QEMU versions older than 7.0.0. */
|
||||||
|
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT_CONFIG;
|
||||||
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
||||||
|
|
||||||
/* Configure SysTick to interrupt at the requested rate. */
|
/* Configure SysTick to interrupt at the requested rate. */
|
||||||
|
|
|
@ -754,8 +754,15 @@ __attribute__( ( weak ) ) void vPortSetupTimerInterrupt( void ) /* PRIVILEGED_FU
|
||||||
}
|
}
|
||||||
#endif /* configUSE_TICKLESS_IDLE */
|
#endif /* configUSE_TICKLESS_IDLE */
|
||||||
|
|
||||||
/* Stop and reset the SysTick. */
|
/* Stop and reset SysTick.
|
||||||
portNVIC_SYSTICK_CTRL_REG = 0UL;
|
*
|
||||||
|
* QEMU versions older than 7.0.0 contain a bug which causes an error if we
|
||||||
|
* enable SysTick without first selecting a valid clock source. We trigger
|
||||||
|
* the bug if we change clock sources from a clock with a zero clock period
|
||||||
|
* to one with a nonzero clock period and enable Systick at the same time.
|
||||||
|
* So we configure the CLKSOURCE bit here, prior to setting the ENABLE bit.
|
||||||
|
* This workaround avoids the bug in QEMU versions older than 7.0.0. */
|
||||||
|
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT_CONFIG;
|
||||||
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
||||||
|
|
||||||
/* Configure SysTick to interrupt at the requested rate. */
|
/* Configure SysTick to interrupt at the requested rate. */
|
||||||
|
|
|
@ -754,8 +754,15 @@ __attribute__( ( weak ) ) void vPortSetupTimerInterrupt( void ) /* PRIVILEGED_FU
|
||||||
}
|
}
|
||||||
#endif /* configUSE_TICKLESS_IDLE */
|
#endif /* configUSE_TICKLESS_IDLE */
|
||||||
|
|
||||||
/* Stop and reset the SysTick. */
|
/* Stop and reset SysTick.
|
||||||
portNVIC_SYSTICK_CTRL_REG = 0UL;
|
*
|
||||||
|
* QEMU versions older than 7.0.0 contain a bug which causes an error if we
|
||||||
|
* enable SysTick without first selecting a valid clock source. We trigger
|
||||||
|
* the bug if we change clock sources from a clock with a zero clock period
|
||||||
|
* to one with a nonzero clock period and enable Systick at the same time.
|
||||||
|
* So we configure the CLKSOURCE bit here, prior to setting the ENABLE bit.
|
||||||
|
* This workaround avoids the bug in QEMU versions older than 7.0.0. */
|
||||||
|
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT_CONFIG;
|
||||||
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
||||||
|
|
||||||
/* Configure SysTick to interrupt at the requested rate. */
|
/* Configure SysTick to interrupt at the requested rate. */
|
||||||
|
|
|
@ -754,8 +754,15 @@ __attribute__( ( weak ) ) void vPortSetupTimerInterrupt( void ) /* PRIVILEGED_FU
|
||||||
}
|
}
|
||||||
#endif /* configUSE_TICKLESS_IDLE */
|
#endif /* configUSE_TICKLESS_IDLE */
|
||||||
|
|
||||||
/* Stop and reset the SysTick. */
|
/* Stop and reset SysTick.
|
||||||
portNVIC_SYSTICK_CTRL_REG = 0UL;
|
*
|
||||||
|
* QEMU versions older than 7.0.0 contain a bug which causes an error if we
|
||||||
|
* enable SysTick without first selecting a valid clock source. We trigger
|
||||||
|
* the bug if we change clock sources from a clock with a zero clock period
|
||||||
|
* to one with a nonzero clock period and enable Systick at the same time.
|
||||||
|
* So we configure the CLKSOURCE bit here, prior to setting the ENABLE bit.
|
||||||
|
* This workaround avoids the bug in QEMU versions older than 7.0.0. */
|
||||||
|
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT_CONFIG;
|
||||||
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
||||||
|
|
||||||
/* Configure SysTick to interrupt at the requested rate. */
|
/* Configure SysTick to interrupt at the requested rate. */
|
||||||
|
|
|
@ -754,8 +754,15 @@ __attribute__( ( weak ) ) void vPortSetupTimerInterrupt( void ) /* PRIVILEGED_FU
|
||||||
}
|
}
|
||||||
#endif /* configUSE_TICKLESS_IDLE */
|
#endif /* configUSE_TICKLESS_IDLE */
|
||||||
|
|
||||||
/* Stop and reset the SysTick. */
|
/* Stop and reset SysTick.
|
||||||
portNVIC_SYSTICK_CTRL_REG = 0UL;
|
*
|
||||||
|
* QEMU versions older than 7.0.0 contain a bug which causes an error if we
|
||||||
|
* enable SysTick without first selecting a valid clock source. We trigger
|
||||||
|
* the bug if we change clock sources from a clock with a zero clock period
|
||||||
|
* to one with a nonzero clock period and enable Systick at the same time.
|
||||||
|
* So we configure the CLKSOURCE bit here, prior to setting the ENABLE bit.
|
||||||
|
* This workaround avoids the bug in QEMU versions older than 7.0.0. */
|
||||||
|
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT_CONFIG;
|
||||||
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
||||||
|
|
||||||
/* Configure SysTick to interrupt at the requested rate. */
|
/* Configure SysTick to interrupt at the requested rate. */
|
||||||
|
|
|
@ -754,8 +754,15 @@ __attribute__( ( weak ) ) void vPortSetupTimerInterrupt( void ) /* PRIVILEGED_FU
|
||||||
}
|
}
|
||||||
#endif /* configUSE_TICKLESS_IDLE */
|
#endif /* configUSE_TICKLESS_IDLE */
|
||||||
|
|
||||||
/* Stop and reset the SysTick. */
|
/* Stop and reset SysTick.
|
||||||
portNVIC_SYSTICK_CTRL_REG = 0UL;
|
*
|
||||||
|
* QEMU versions older than 7.0.0 contain a bug which causes an error if we
|
||||||
|
* enable SysTick without first selecting a valid clock source. We trigger
|
||||||
|
* the bug if we change clock sources from a clock with a zero clock period
|
||||||
|
* to one with a nonzero clock period and enable Systick at the same time.
|
||||||
|
* So we configure the CLKSOURCE bit here, prior to setting the ENABLE bit.
|
||||||
|
* This workaround avoids the bug in QEMU versions older than 7.0.0. */
|
||||||
|
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT_CONFIG;
|
||||||
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
||||||
|
|
||||||
/* Configure SysTick to interrupt at the requested rate. */
|
/* Configure SysTick to interrupt at the requested rate. */
|
||||||
|
|
|
@ -754,8 +754,15 @@ __attribute__( ( weak ) ) void vPortSetupTimerInterrupt( void ) /* PRIVILEGED_FU
|
||||||
}
|
}
|
||||||
#endif /* configUSE_TICKLESS_IDLE */
|
#endif /* configUSE_TICKLESS_IDLE */
|
||||||
|
|
||||||
/* Stop and reset the SysTick. */
|
/* Stop and reset SysTick.
|
||||||
portNVIC_SYSTICK_CTRL_REG = 0UL;
|
*
|
||||||
|
* QEMU versions older than 7.0.0 contain a bug which causes an error if we
|
||||||
|
* enable SysTick without first selecting a valid clock source. We trigger
|
||||||
|
* the bug if we change clock sources from a clock with a zero clock period
|
||||||
|
* to one with a nonzero clock period and enable Systick at the same time.
|
||||||
|
* So we configure the CLKSOURCE bit here, prior to setting the ENABLE bit.
|
||||||
|
* This workaround avoids the bug in QEMU versions older than 7.0.0. */
|
||||||
|
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT_CONFIG;
|
||||||
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
||||||
|
|
||||||
/* Configure SysTick to interrupt at the requested rate. */
|
/* Configure SysTick to interrupt at the requested rate. */
|
||||||
|
|
|
@ -754,8 +754,15 @@ __attribute__( ( weak ) ) void vPortSetupTimerInterrupt( void ) /* PRIVILEGED_FU
|
||||||
}
|
}
|
||||||
#endif /* configUSE_TICKLESS_IDLE */
|
#endif /* configUSE_TICKLESS_IDLE */
|
||||||
|
|
||||||
/* Stop and reset the SysTick. */
|
/* Stop and reset SysTick.
|
||||||
portNVIC_SYSTICK_CTRL_REG = 0UL;
|
*
|
||||||
|
* QEMU versions older than 7.0.0 contain a bug which causes an error if we
|
||||||
|
* enable SysTick without first selecting a valid clock source. We trigger
|
||||||
|
* the bug if we change clock sources from a clock with a zero clock period
|
||||||
|
* to one with a nonzero clock period and enable Systick at the same time.
|
||||||
|
* So we configure the CLKSOURCE bit here, prior to setting the ENABLE bit.
|
||||||
|
* This workaround avoids the bug in QEMU versions older than 7.0.0. */
|
||||||
|
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT_CONFIG;
|
||||||
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
||||||
|
|
||||||
/* Configure SysTick to interrupt at the requested rate. */
|
/* Configure SysTick to interrupt at the requested rate. */
|
||||||
|
|
|
@ -754,8 +754,15 @@ __attribute__( ( weak ) ) void vPortSetupTimerInterrupt( void ) /* PRIVILEGED_FU
|
||||||
}
|
}
|
||||||
#endif /* configUSE_TICKLESS_IDLE */
|
#endif /* configUSE_TICKLESS_IDLE */
|
||||||
|
|
||||||
/* Stop and reset the SysTick. */
|
/* Stop and reset SysTick.
|
||||||
portNVIC_SYSTICK_CTRL_REG = 0UL;
|
*
|
||||||
|
* QEMU versions older than 7.0.0 contain a bug which causes an error if we
|
||||||
|
* enable SysTick without first selecting a valid clock source. We trigger
|
||||||
|
* the bug if we change clock sources from a clock with a zero clock period
|
||||||
|
* to one with a nonzero clock period and enable Systick at the same time.
|
||||||
|
* So we configure the CLKSOURCE bit here, prior to setting the ENABLE bit.
|
||||||
|
* This workaround avoids the bug in QEMU versions older than 7.0.0. */
|
||||||
|
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT_CONFIG;
|
||||||
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
||||||
|
|
||||||
/* Configure SysTick to interrupt at the requested rate. */
|
/* Configure SysTick to interrupt at the requested rate. */
|
||||||
|
|
|
@ -754,8 +754,15 @@ __attribute__( ( weak ) ) void vPortSetupTimerInterrupt( void ) /* PRIVILEGED_FU
|
||||||
}
|
}
|
||||||
#endif /* configUSE_TICKLESS_IDLE */
|
#endif /* configUSE_TICKLESS_IDLE */
|
||||||
|
|
||||||
/* Stop and reset the SysTick. */
|
/* Stop and reset SysTick.
|
||||||
portNVIC_SYSTICK_CTRL_REG = 0UL;
|
*
|
||||||
|
* QEMU versions older than 7.0.0 contain a bug which causes an error if we
|
||||||
|
* enable SysTick without first selecting a valid clock source. We trigger
|
||||||
|
* the bug if we change clock sources from a clock with a zero clock period
|
||||||
|
* to one with a nonzero clock period and enable Systick at the same time.
|
||||||
|
* So we configure the CLKSOURCE bit here, prior to setting the ENABLE bit.
|
||||||
|
* This workaround avoids the bug in QEMU versions older than 7.0.0. */
|
||||||
|
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT_CONFIG;
|
||||||
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
||||||
|
|
||||||
/* Configure SysTick to interrupt at the requested rate. */
|
/* Configure SysTick to interrupt at the requested rate. */
|
||||||
|
|
|
@ -754,8 +754,15 @@ __attribute__( ( weak ) ) void vPortSetupTimerInterrupt( void ) /* PRIVILEGED_FU
|
||||||
}
|
}
|
||||||
#endif /* configUSE_TICKLESS_IDLE */
|
#endif /* configUSE_TICKLESS_IDLE */
|
||||||
|
|
||||||
/* Stop and reset the SysTick. */
|
/* Stop and reset SysTick.
|
||||||
portNVIC_SYSTICK_CTRL_REG = 0UL;
|
*
|
||||||
|
* QEMU versions older than 7.0.0 contain a bug which causes an error if we
|
||||||
|
* enable SysTick without first selecting a valid clock source. We trigger
|
||||||
|
* the bug if we change clock sources from a clock with a zero clock period
|
||||||
|
* to one with a nonzero clock period and enable Systick at the same time.
|
||||||
|
* So we configure the CLKSOURCE bit here, prior to setting the ENABLE bit.
|
||||||
|
* This workaround avoids the bug in QEMU versions older than 7.0.0. */
|
||||||
|
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT_CONFIG;
|
||||||
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
||||||
|
|
||||||
/* Configure SysTick to interrupt at the requested rate. */
|
/* Configure SysTick to interrupt at the requested rate. */
|
||||||
|
|
|
@ -754,8 +754,15 @@ __attribute__( ( weak ) ) void vPortSetupTimerInterrupt( void ) /* PRIVILEGED_FU
|
||||||
}
|
}
|
||||||
#endif /* configUSE_TICKLESS_IDLE */
|
#endif /* configUSE_TICKLESS_IDLE */
|
||||||
|
|
||||||
/* Stop and reset the SysTick. */
|
/* Stop and reset SysTick.
|
||||||
portNVIC_SYSTICK_CTRL_REG = 0UL;
|
*
|
||||||
|
* QEMU versions older than 7.0.0 contain a bug which causes an error if we
|
||||||
|
* enable SysTick without first selecting a valid clock source. We trigger
|
||||||
|
* the bug if we change clock sources from a clock with a zero clock period
|
||||||
|
* to one with a nonzero clock period and enable Systick at the same time.
|
||||||
|
* So we configure the CLKSOURCE bit here, prior to setting the ENABLE bit.
|
||||||
|
* This workaround avoids the bug in QEMU versions older than 7.0.0. */
|
||||||
|
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT_CONFIG;
|
||||||
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
||||||
|
|
||||||
/* Configure SysTick to interrupt at the requested rate. */
|
/* Configure SysTick to interrupt at the requested rate. */
|
||||||
|
|
|
@ -754,8 +754,15 @@ __attribute__( ( weak ) ) void vPortSetupTimerInterrupt( void ) /* PRIVILEGED_FU
|
||||||
}
|
}
|
||||||
#endif /* configUSE_TICKLESS_IDLE */
|
#endif /* configUSE_TICKLESS_IDLE */
|
||||||
|
|
||||||
/* Stop and reset the SysTick. */
|
/* Stop and reset SysTick.
|
||||||
portNVIC_SYSTICK_CTRL_REG = 0UL;
|
*
|
||||||
|
* QEMU versions older than 7.0.0 contain a bug which causes an error if we
|
||||||
|
* enable SysTick without first selecting a valid clock source. We trigger
|
||||||
|
* the bug if we change clock sources from a clock with a zero clock period
|
||||||
|
* to one with a nonzero clock period and enable Systick at the same time.
|
||||||
|
* So we configure the CLKSOURCE bit here, prior to setting the ENABLE bit.
|
||||||
|
* This workaround avoids the bug in QEMU versions older than 7.0.0. */
|
||||||
|
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT_CONFIG;
|
||||||
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
||||||
|
|
||||||
/* Configure SysTick to interrupt at the requested rate. */
|
/* Configure SysTick to interrupt at the requested rate. */
|
||||||
|
|
|
@ -754,8 +754,15 @@ __attribute__( ( weak ) ) void vPortSetupTimerInterrupt( void ) /* PRIVILEGED_FU
|
||||||
}
|
}
|
||||||
#endif /* configUSE_TICKLESS_IDLE */
|
#endif /* configUSE_TICKLESS_IDLE */
|
||||||
|
|
||||||
/* Stop and reset the SysTick. */
|
/* Stop and reset SysTick.
|
||||||
portNVIC_SYSTICK_CTRL_REG = 0UL;
|
*
|
||||||
|
* QEMU versions older than 7.0.0 contain a bug which causes an error if we
|
||||||
|
* enable SysTick without first selecting a valid clock source. We trigger
|
||||||
|
* the bug if we change clock sources from a clock with a zero clock period
|
||||||
|
* to one with a nonzero clock period and enable Systick at the same time.
|
||||||
|
* So we configure the CLKSOURCE bit here, prior to setting the ENABLE bit.
|
||||||
|
* This workaround avoids the bug in QEMU versions older than 7.0.0. */
|
||||||
|
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT_CONFIG;
|
||||||
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
||||||
|
|
||||||
/* Configure SysTick to interrupt at the requested rate. */
|
/* Configure SysTick to interrupt at the requested rate. */
|
||||||
|
|
|
@ -754,8 +754,15 @@ __attribute__( ( weak ) ) void vPortSetupTimerInterrupt( void ) /* PRIVILEGED_FU
|
||||||
}
|
}
|
||||||
#endif /* configUSE_TICKLESS_IDLE */
|
#endif /* configUSE_TICKLESS_IDLE */
|
||||||
|
|
||||||
/* Stop and reset the SysTick. */
|
/* Stop and reset SysTick.
|
||||||
portNVIC_SYSTICK_CTRL_REG = 0UL;
|
*
|
||||||
|
* QEMU versions older than 7.0.0 contain a bug which causes an error if we
|
||||||
|
* enable SysTick without first selecting a valid clock source. We trigger
|
||||||
|
* the bug if we change clock sources from a clock with a zero clock period
|
||||||
|
* to one with a nonzero clock period and enable Systick at the same time.
|
||||||
|
* So we configure the CLKSOURCE bit here, prior to setting the ENABLE bit.
|
||||||
|
* This workaround avoids the bug in QEMU versions older than 7.0.0. */
|
||||||
|
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT_CONFIG;
|
||||||
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
||||||
|
|
||||||
/* Configure SysTick to interrupt at the requested rate. */
|
/* Configure SysTick to interrupt at the requested rate. */
|
||||||
|
|
|
@ -754,8 +754,15 @@ __attribute__( ( weak ) ) void vPortSetupTimerInterrupt( void ) /* PRIVILEGED_FU
|
||||||
}
|
}
|
||||||
#endif /* configUSE_TICKLESS_IDLE */
|
#endif /* configUSE_TICKLESS_IDLE */
|
||||||
|
|
||||||
/* Stop and reset the SysTick. */
|
/* Stop and reset SysTick.
|
||||||
portNVIC_SYSTICK_CTRL_REG = 0UL;
|
*
|
||||||
|
* QEMU versions older than 7.0.0 contain a bug which causes an error if we
|
||||||
|
* enable SysTick without first selecting a valid clock source. We trigger
|
||||||
|
* the bug if we change clock sources from a clock with a zero clock period
|
||||||
|
* to one with a nonzero clock period and enable Systick at the same time.
|
||||||
|
* So we configure the CLKSOURCE bit here, prior to setting the ENABLE bit.
|
||||||
|
* This workaround avoids the bug in QEMU versions older than 7.0.0. */
|
||||||
|
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT_CONFIG;
|
||||||
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
||||||
|
|
||||||
/* Configure SysTick to interrupt at the requested rate. */
|
/* Configure SysTick to interrupt at the requested rate. */
|
||||||
|
|
|
@ -754,8 +754,15 @@ __attribute__( ( weak ) ) void vPortSetupTimerInterrupt( void ) /* PRIVILEGED_FU
|
||||||
}
|
}
|
||||||
#endif /* configUSE_TICKLESS_IDLE */
|
#endif /* configUSE_TICKLESS_IDLE */
|
||||||
|
|
||||||
/* Stop and reset the SysTick. */
|
/* Stop and reset SysTick.
|
||||||
portNVIC_SYSTICK_CTRL_REG = 0UL;
|
*
|
||||||
|
* QEMU versions older than 7.0.0 contain a bug which causes an error if we
|
||||||
|
* enable SysTick without first selecting a valid clock source. We trigger
|
||||||
|
* the bug if we change clock sources from a clock with a zero clock period
|
||||||
|
* to one with a nonzero clock period and enable Systick at the same time.
|
||||||
|
* So we configure the CLKSOURCE bit here, prior to setting the ENABLE bit.
|
||||||
|
* This workaround avoids the bug in QEMU versions older than 7.0.0. */
|
||||||
|
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT_CONFIG;
|
||||||
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
||||||
|
|
||||||
/* Configure SysTick to interrupt at the requested rate. */
|
/* Configure SysTick to interrupt at the requested rate. */
|
||||||
|
|
|
@ -754,8 +754,15 @@ __attribute__( ( weak ) ) void vPortSetupTimerInterrupt( void ) /* PRIVILEGED_FU
|
||||||
}
|
}
|
||||||
#endif /* configUSE_TICKLESS_IDLE */
|
#endif /* configUSE_TICKLESS_IDLE */
|
||||||
|
|
||||||
/* Stop and reset the SysTick. */
|
/* Stop and reset SysTick.
|
||||||
portNVIC_SYSTICK_CTRL_REG = 0UL;
|
*
|
||||||
|
* QEMU versions older than 7.0.0 contain a bug which causes an error if we
|
||||||
|
* enable SysTick without first selecting a valid clock source. We trigger
|
||||||
|
* the bug if we change clock sources from a clock with a zero clock period
|
||||||
|
* to one with a nonzero clock period and enable Systick at the same time.
|
||||||
|
* So we configure the CLKSOURCE bit here, prior to setting the ENABLE bit.
|
||||||
|
* This workaround avoids the bug in QEMU versions older than 7.0.0. */
|
||||||
|
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT_CONFIG;
|
||||||
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
||||||
|
|
||||||
/* Configure SysTick to interrupt at the requested rate. */
|
/* Configure SysTick to interrupt at the requested rate. */
|
||||||
|
|
|
@ -754,8 +754,15 @@ __attribute__( ( weak ) ) void vPortSetupTimerInterrupt( void ) /* PRIVILEGED_FU
|
||||||
}
|
}
|
||||||
#endif /* configUSE_TICKLESS_IDLE */
|
#endif /* configUSE_TICKLESS_IDLE */
|
||||||
|
|
||||||
/* Stop and reset the SysTick. */
|
/* Stop and reset SysTick.
|
||||||
portNVIC_SYSTICK_CTRL_REG = 0UL;
|
*
|
||||||
|
* QEMU versions older than 7.0.0 contain a bug which causes an error if we
|
||||||
|
* enable SysTick without first selecting a valid clock source. We trigger
|
||||||
|
* the bug if we change clock sources from a clock with a zero clock period
|
||||||
|
* to one with a nonzero clock period and enable Systick at the same time.
|
||||||
|
* So we configure the CLKSOURCE bit here, prior to setting the ENABLE bit.
|
||||||
|
* This workaround avoids the bug in QEMU versions older than 7.0.0. */
|
||||||
|
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT_CONFIG;
|
||||||
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
||||||
|
|
||||||
/* Configure SysTick to interrupt at the requested rate. */
|
/* Configure SysTick to interrupt at the requested rate. */
|
||||||
|
|
Loading…
Reference in a new issue