Skip to content
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

[BUG] stepper.cpp - expression must have a constant value / cannot be used as a constant #27273

Closed
1 task done
classicrocker883 opened this issue Jul 15, 2024 · 3 comments
Closed
1 task done

Comments

@classicrocker883
Copy link
Contributor

classicrocker883 commented Jul 15, 2024

Did you test the latest bugfix-2.1.x code?

Yes, and the problem still exists.

Bug Description

Okay I am not sure if this is a bug with negative implications, or it is just whatever it is.

So everything compiles fine, no errors or warnings to note otherwise.
However, when I go to this file:

Marlin\src\module\stepper.cpp: line ~530

constexpr uint32_t timer_setup_ns = cycles_to_ns(timer_read_add_and_store_cycles);
constexpr hal_timer_t PULSE_HIGH_TICK_COUNT = ns_to_pulse_timer_ticks(_min_pulse_high_ns - _MIN(_min_pulse_high_ns, timer_setup_ns));
constexpr hal_timer_t PULSE_LOW_TICK_COUNT = ns_to_pulse_timer_ticks(_min_pulse_low_ns - _MIN(_min_pulse_low_ns, timer_setup_ns));

I get red squiggles under these 3 constexpr and this error:

expression must have a constant value
stepper.cpp(528, 37): the value of variable "SystemCoreClock" (declared at line 51 of "\.platformio\packages\framework-arduinoststm32\system\Drivers\CMSIS\Device\ST\STM32F1xx\Include\system_stm32f1xx.h") cannot be used as a constant
stepper.cpp(529, 47): expression cannot be interpreted
stepper.cpp(530, 46): expression cannot be interpreted

removing constexpr from each 3 will remove this error and also compile successfully.

Bug Timeline

No response

Expected behavior

Expect no warnings/errors

Actual behavior

Compiles correctly.
Everything else seems to be fine,
except this error appears.

Steps to Reproduce

  1. Load STM32 configs (Ender-3V2)
  2. STM32F103RE_creality in platformio.ini
  3. Build
  4. navigate to Marlin\src\module\stepper.cpp
  5. warnings should popup under "PROBLEMS" tab / red squiggles appear under code in question

Version of Marlin Firmware

bugfix-2.1.x

Printer model

No response

Electronics

No response

LCD/Controller

No response

Other add-ons

No response

Bed Leveling

None

Your Slicer

None

Host Software

None

Don't forget to include

  • A ZIP file containing your Configuration.h and Configuration_adv.h.

Additional information & file uploads

No response

@classicrocker883 classicrocker883 changed the title [BUG] (bug summary) [BUG] stepper.cpp - expression must have a constant value / cannot be used as a constant Jul 15, 2024
@dbuezas
Copy link
Contributor

dbuezas commented Aug 19, 2024

Same here

@thisiskeithb
Copy link
Member

thisiskeithb commented Aug 19, 2024

So everything compiles fine, no errors or warnings to note otherwise.

Closing since there are no compile errors or warnings.

@thisiskeithb
Copy link
Member

@classicrocker883: Please only open bug reports for confirmed bugs.

If you're unsure, please hop on our Discord and ask for help before proceeding.

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

No branches or pull requests

3 participants