-
Notifications
You must be signed in to change notification settings - Fork 1.5k
arch: Remove default value for BOARD_LOOPSPERMSEC #17011
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
1c5b113 to
e0242ab
Compare
|
Looks like there are some defconfigs using the default value. Good to catch. |
|
Looks like we need to fix the boards where -1 / default is used, just to pass build here and have correct timings on these boards, then update the res of the boards depending on what we have at hand? :-) On the other hand we may keep this default and put some pressure / attention to the proper timings calibration when using different boards. I am wondering what impacts the value and if the differences are big - is it build specific? For instance when using different compiler, specific optimization level, many irqs, threads, etc :-) I mean this 5000 default was set because any default may be wrong when this value is not calibrated on a final firmware build? People just did not know that? In that case we may leave as-is and just add Pre-Flight-Check-List to the documentation with list of important things to know / check / verify when creating / building NuttX based projects? :-) |
|
@linguini1 instead of suggesting searching for CONFIG_BOARD_LOOPSPERMSEC I suggest search for calib_udelay because there is not a page dedicated to CONFIG_BOARD_LOOPSPERMSEC and when searching for it returns many pages. Searching for calib_udelay returned two pages, but I think we need to move calib_udelay from apps/examples/ to apps/system/ because it is a system tool used to help the system to work correctly. And it also will avoid calib_udelay returning in the apps examples pages. What do you think? |
That's fine, I plan to make one for BOARD_LOOPSPERMSEC but it's better to redirect to calib_udelay for now, I agree.
I don't mind moving it to the system directory but that's outside the scope of this PR. I agree it makes more sense, but I might do it later. Right now I just want to prevent users from making a frustrating mistake. |
e0242ab to
c96fe68
Compare
|
MSVC failure appears unrelated. |
c96fe68 to
20d1c70
Compare
@simbit18 you are the MS guy, any idea? |
1bcfe5b to
e871c4f
Compare
cederom
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @linguini1!! :-)
bef440d to
3fc6ed8
Compare
|
@xiaoxiang781216 please let me know what you think of the current solution! If you think it's alright, I'll run the build checks once our usage has cooled down (as mentioned in #17914) to make sure everything is ready for merge. Thank you for your patch in #17923. In this PR, you'll see I modified it slightly so that |
Removes the default value for CONFIG_BOARD_LOOPSPERMSEC. All boards that forget to configure this value will encounter a build error, enforcing that configurations upstreamed to NuttX have calibrated values for correct delay timings. Boards which implement ALARM_ARCH or TIMER_ARCH do not rely on the busy-loop delay implementation and thus only have a run-time check to ensure proper delay-timings (in the case where delays are used before the alarm/timer driver is registered). Some boards already in the NuttX upstream do not have calibrated values, but there are no users who currently own the board to submit a calibrated value for the configurations to use. In this scenario, the value is temporarily set to 0 and a warning is displayed so that users of these boards are informed of the calibration process. Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
In Kconfig, it is valid for configuration variables to have no value. However, the replace logic in this cmake file will throw an error that at least four arguments are required if 'Value' is empty. This commit avoids performing the replacement logic if 'Value' is empty to prevent an error on valid, empty configuration variables. Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Propagated correct CONFIG_BOARDS_LOOPSPERMSEC value to remaining configurations for this board. Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Use calibrated CONFIG_BOARD_LOOPSPERMSEC value for board configurations. Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Use calibrated CONFIG_BOARD_LOOPSPERMSEC value for board configurations. Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
This board does not have a calibrated LOOPSPERMSEC value despite needing one in order for correct operation. This commits sets the value to 0 so that CI builds may pass, but users who build this board will see a warning indicate the steps for calibrating a new value. Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
This board does not have a calibrated LOOPSPERMSEC value despite needing one in order for correct operation. This commits sets the value to 0 so that CI builds may pass, but users who build this board will see a warning indicate the steps for calibrating a new value. Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
This board does not have a calibrated LOOPSPERMSEC value despite needing one in order for correct operation. This commits sets the value to 0 so that CI builds may pass, but users who build this board will see a warning indicate the steps for calibrating a new value. Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
This board does not have a calibrated LOOPSPERMSEC value despite needing one in order for correct operation. This commits sets the value to 0 so that CI builds may pass, but users who build this board will see a warning indicate the steps for calibrating a new value. Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
This board does not have a calibrated LOOPSPERMSEC value despite needing one in order for correct operation. This commits sets the value to 0 so that CI builds may pass, but users who build this board will see a warning indicate the steps for calibrating a new value. Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
3fc6ed8 to
ad9cab3
Compare
Summary
Removes the default value for CONFIG_BOARD_LOOPSPERMSEC. All boards that forget to configure this value will encounter a build error, enforcing that configurations upstreamed to NuttX have calibrated values for correct delay timings.
Boards which implement ALARM_ARCH or TIMER_ARCH do not rely on the busy-loop delay implementation and thus only have a run-time check to ensure proper delay-timings (in the case where delays are used before the alarm/timer driver is registered).
Some boards already in the NuttX upstream do not have calibrated values, but there are no users who currently own the board to submit a calibrated value for the configurations to use. In this scenario, the value is temporarily set to 0 and a warning is displayed so that users of these boards are informed of the calibration process.
Closes #17004.
Impact
Users will no longer waste time debugging issues that result from having an incorrect value of this configuration option, causing delay/timing issues.
This will affect any user-created defconfig (or NuttX provided defconfig)
without a value set for
CONFIG_BOARD_LOOPSPERMSECby preventing them fromcompiling. It causes files that use
CONFIG_BOARD_LOOPSPERMSECwhile it isundefined to fail compilation.
Testing
On a board where
CONFIG_BOARD_LOOPSPERMSEC=0but the timer/alarm driver is not enabled, delays will not be reliable. This warning message is shown at compile time to tell the user how to calibrate the value:On a board where
ARCH_ALARMis used, no issues occur during compilation:On a board where
CONFIG_BOARD_LOOPSPERMSECis undefined, this is the compilation error: