Tickless mode for KL25 Kinetis L
Posted: Tue Jan 27, 2015 10:41 pm
I wondered if anyone has given thought to how ChibiOS/RT tickless mode could be implemented on the Kinetis L port.
It seems like the LPTMR peripheral would support a tickless kernel. The benefit of LPTMR is that it operates in all low-power modes.
The LPTMR counter is, however, only 16 bits wide. But if we set the systick frequency to 1000 Hz, for instance, this would still allow sleeping for up to about 60 seconds in a stretch. Perhaps it would be possible to have the ChibiOS systick low level driver accommodate this by sleeping for whatever time is necessary in blocks of 60 seconds (or whatever the limit is based on systick frequency).
There is also an RTC peripheral that would appear at first to be a candidate for the tickless systick driver, but it can only alarm at one-second resolution, so it is not really suitable.
Ideally the MCU could be put into a low-power mode when possible, like VLPS or LLS, and the ChibiOS tickless systick driver would continue to keep time and wake up when required. Of course it is another matter altogether to figure out how to determine when to enter and exit the low power mode and perform it correctly.
It seems like the LPTMR peripheral would support a tickless kernel. The benefit of LPTMR is that it operates in all low-power modes.
The LPTMR counter is, however, only 16 bits wide. But if we set the systick frequency to 1000 Hz, for instance, this would still allow sleeping for up to about 60 seconds in a stretch. Perhaps it would be possible to have the ChibiOS systick low level driver accommodate this by sleeping for whatever time is necessary in blocks of 60 seconds (or whatever the limit is based on systick frequency).
There is also an RTC peripheral that would appear at first to be a candidate for the tickless systick driver, but it can only alarm at one-second resolution, so it is not really suitable.
Ideally the MCU could be put into a low-power mode when possible, like VLPS or LLS, and the ChibiOS tickless systick driver would continue to keep time and wake up when required. Of course it is another matter altogether to figure out how to determine when to enter and exit the low power mode and perform it correctly.