Hello!
Does the tickless mode still use a periodic timer? At least the STM32F4 implementation looks like it does (it uses TIM2). If so what's the difference between the traditional SysTick approach? Or am I perhaps misinterpreting the code?
Christian
Tickless mode implementation
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Tickless mode implementation
Hi,
The normal mode requires periodic interrupts, the tickless mode requires interrupts at variable intervals, the next interrupt is scheduled when the next virtual timer is going to be triggered. There are no unnecessary interrupts.
No periodic interrupt means that the system time cannot be implemented as a variable incremented by systick, a timer counter is used instead. the timer is required to have an upward counting register and a comparator register, most timers are able to do this, unfortunately the Cortex SysTick timer is not among them.
Giovanni
The normal mode requires periodic interrupts, the tickless mode requires interrupts at variable intervals, the next interrupt is scheduled when the next virtual timer is going to be triggered. There are no unnecessary interrupts.
No periodic interrupt means that the system time cannot be implemented as a variable incremented by systick, a timer counter is used instead. the timer is required to have an upward counting register and a comparator register, most timers are able to do this, unfortunately the Cortex SysTick timer is not among them.
Giovanni
Re: Tickless mode implementation
Hi, Giovanni!
Thanks for the quick response. Now everything makes sense.
Have a nice weekend,
Christian
Thanks for the quick response. Now everything makes sense.
Have a nice weekend,
Christian
Re: Tickless mode implementation
Hi Giovanni,
I am recently have question about TIM vs SysTick but found this topic.
Now your decision to take regular timer instead of systick is clean for me.
I am recently have question about TIM vs SysTick but found this topic.
Now your decision to take regular timer instead of systick is clean for me.
Re: Tickless mode implementation
Long sleeps (more than ~6.5 seconds on default settings) on MCUs with only 16-bit timers does not work correctly. I thinking about some aid from ChibiOS.
For example: create loop from smaller sleeps inside sleep macros.
For example: create loop from smaller sleeps inside sleep macros.
Re: Tickless mode implementation
Hi Giovanni,
Situation:
I want to write hal test for 1-wire driver for STM32F030x8 MCU.
I want to use TIM3 for it, but TIM3 in that MCU is only suitable timer for
systick in tickless mode.
Question:
How to correctly disable tickless mode and use Cortex's internal systick timer?
Looks like setting
is not enough because compile time check fails in st_lld.h.
I think it needs some
strings, but I do not know where to place them.
Situation:
I want to write hal test for 1-wire driver for STM32F030x8 MCU.
I want to use TIM3 for it, but TIM3 in that MCU is only suitable timer for
systick in tickless mode.
Question:
How to correctly disable tickless mode and use Cortex's internal systick timer?
Looks like setting
Code: Select all
#define CH_CFG_ST_TIMEDELTA 0
is not enough because compile time check fails in st_lld.h.
I think it needs some
Code: Select all
#if OSAL_ST_MODE == OSAL_ST_MODE_PERIODIC
strings, but I do not know where to place them.
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Tickless mode implementation
Hi,
Putting CH_CFG_ST_TIMEDELTA to zero should be sufficient, which test is failing?
Giovanni
Putting CH_CFG_ST_TIMEDELTA to zero should be sufficient, which test is failing?
Giovanni
Re: Tickless mode implementation
Code: Select all
Compiling hal.c
In file included from ../../../../../os/hal/include/st.h:50:0,
from ../../../../../os/hal/include/hal.h:73,
from ../../../../../os/hal/src/hal_queues.c:42:
../../../../../os/hal/ports/STM32/LLD/TIMv1/st_lld.h:69:2: error: #error "TIM2 not present"
when I set
Code: Select all
#define STM32_ST_USE_TIMER 2
I know that STM32F030x8 has no TIM2, but that checks should be skipped when I use SysTick timer.
Any way, when I set
Code: Select all
#define STM32_ST_USE_TIMER 3
#define STM32_PWM_USE_TIM3 TRUE
#define CH_CFG_ST_TIMEDELTA 0
my program compiles and works as expected (SysTick timer and PWM generated by TIM3)
Re: Tickless mode implementation
Hi,
In tickless implementation of v3, set of regular timers of 2,3,4,5 is real pain with stm32F030 MCU. Because TIM3 is most useful one, and others are just absent.
How is it possible to use something like TIM14, or even TIM1?
Thank you!
In tickless implementation of v3, set of regular timers of 2,3,4,5 is real pain with stm32F030 MCU. Because TIM3 is most useful one, and others are just absent.
How is it possible to use something like TIM14, or even TIM1?
Thank you!
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Tickless mode implementation
Hi,
Currently it is not possible, st_lld.c would require changes.
Giovanni
Currently it is not possible, st_lld.c would require changes.
Giovanni
Who is online
Users browsing this forum: No registered users and 10 guests