Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • F firmware
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 74
    • Issues 74
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 29
    • Merge requests 29
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • External wiki
    • External wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • card10
  • firmware
  • Merge requests
  • !481

Dynamically scale system clock based on load

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged schneider requested to merge schneider/dynamic-clock-scaling into master Aug 15, 2021
  • Overview 2
  • Commits 1
  • Pipelines 8
  • Changes 3

Requires at least !478 (merged) to be merged first.

This dynamically adapts the system clock speed based on the following parameters:

  • Is the second core currently waiting for epicardium to finish an API call?
  • Is USB connected?
  • Do we have enough time to reasonably go to sleep?

It tries to keep time on epicardium roughly in line with the wall clock. Slight drift is expected though.

@rahix I'm wondering if I should add a call to the epicardium API which explicitly turns on this behaviour. The current downside is that l0dables will experience a significant drift in their systick time.

Together with the other changes we achieve the following consumption (BLE off):

  • Simple time.sleep(1) loop with display off: 2.29 mA (before: 6.13 mA)
  • G-Watch: 3.99 mA (before 7.7 mA)

This equates to 90% - 160% longer battery life.

With BLE active, the consumption increases by 0.92 mA (no connection) / 1.43 mA (active connection). In this case we are looking at 68% to 100% longer battery life (assuming that the extra BLE consumption is the same in current master).

Edited Aug 15, 2021 by schneider
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: schneider/dynamic-clock-scaling