Skip to content

examples/calib_udelay: Allow the number of delay loop iterations to be specified by kconfig.#2152

Merged
xiaoxiang781216 merged 1 commit intoapache:masterfrom
motec-research:calib-udelay
Oct 24, 2023
Merged

examples/calib_udelay: Allow the number of delay loop iterations to be specified by kconfig.#2152
xiaoxiang781216 merged 1 commit intoapache:masterfrom
motec-research:calib-udelay

Conversation

@g2gps
Copy link
Copy Markdown
Contributor

@g2gps g2gps commented Oct 24, 2023

Summary

The calibration test can take a long time on platforms with less processing power. Allow the default value to be changed with kconfig.

Impact

The calibration test completes in a more reasonable time.

Testing

Before this change, with the default 100000 iterations:

nsh> calib_udelay

Calibrating timer for main calibration...
Performing main calibration for udelay. This will take approx. 220.677 seconds.

With this change, and CONFIG_EXAMPLES_CALIB_UDELAY_DELAY_TEST_ITERATIONS=5000

nsh> calib_udelay

Calibrating timer for main calibration...
Performing main calibration for udelay.This will take approx. 12.739 seconds.
Calibration slope for udelay:
  Y = m*X + b, where
    X is loop iterations,
    Y is time in nanoseconds,
    b is base overhead,
    m is nanoseconds per loop iteration.

  m = 127.01355925 nsec/iter
  b = 103458.24360897 nsec

  Correlation coefficient, R² = 1.0000

Without overhead, 0.00787317 iterations per nanosecond and 7873.18 iterations per millisecond.

Recommended setting for CONFIG_BOARD_LOOPSPERMSEC:
   CONFIG_BOARD_LOOPSPERMSEC=7874

…e specified by kconfig.

The calibration test can take a long time on platforms with less
processing power. Allow the default value to be changed with kconfig.
@xiaoxiang781216 xiaoxiang781216 merged commit e55f285 into apache:master Oct 24, 2023
@g2gps g2gps deleted the calib-udelay branch October 26, 2023 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants