MarlinFirmware / MarlinFirmware/Configurations

[BUG] Unable to build Malyan/M200 v1 example configuration according to its README.md

Open
#900 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C
Stars
2.3k
Forks
3.4k
Avg merge
19h 32m
Merged PRs (30d)
1

Description

Bug Description

Exactly following the instructions from the README.md, without any changes to the example configs, I am unable to finish the building process due to the following error:

In file included from C:\Users\User\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/stm32/clock.h:43,
                 from C:\Users\User\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/wiring_time.h:23,
                 from C:\Users\User\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/wiring.h:38,
                 from C:\Users\User\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/Arduino.h:36,
                 from C:\Users\User\Downloads\Marlin-bugfix-2.1.x\Marlin\src\HAL\shared\Marduino.h:36,
                 from C:\Users\User\Downloads\Marlin-bugfix-2.1.x\Marlin\src\HAL\STM32\HAL.h:28,
                 from C:\Users\User\Downloads\Marlin-bugfix-2.1.x\Marlin\src\HAL\HAL.h:30,
                 from C:\Users\User\Downloads\Marlin-bugfix-2.1.x\Marlin\src\inc\MarlinConfig.h:31,
                 from C:\Users\User\Downloads\Marlin-bugfix-2.1.x\Marlin\src\HAL\STM32\HAL.cpp:27:
C:\Users\User\Downloads\Marlin-bugfix-2.1.x\Marlin\src\HAL\STM32\HAL.cpp: In static member function 'static void MarlinHAL::init()':
C:\Users\User\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/stm32/stm32_def.h:58:17: error: the value of 'SystemCoreClock' is not usable in a constant expression
   58 |   #define F_CPU SystemCoreClock
      |                 ^~~~~~~~~~~~~~~
C:\Users\User\Downloads\Marlin-bugfix-2.1.x\Marlin\src\HAL\STM32\HAL.cpp:70:27: note: in expansion of macro 'F_CPU'
   70 |   constexpr int cpuFreq = F_CPU;
      |                           ^~~~~
In file included from C:\Users\User\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\system/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h:133,
                 from C:\Users\User\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\system/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h:131,
                 from C:\Users\User\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/stm32/stm32_def.h:28,
                 from C:\Users\User\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/stm32/clock.h:43,
                 from C:\Users\User\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/wiring_time.h:23,
                 from C:\Users\User\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/wiring.h:38,
                 from C:\Users\User\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino/Arduino.h:36,
                 from C:\Users\User\Downloads\Marlin-bugfix-2.1.x\Marlin\src\HAL\shared\Marduino.h:36,
                 from C:\Users\User\Downloads\Marlin-bugfix-2.1.x\Marlin\src\HAL\STM32\HAL.h:28,
                 from C:\Users\User\Downloads\Marlin-bugfix-2.1.x\Marlin\src\HAL\HAL.h:30,
                 from C:\Users\User\Downloads\Marlin-bugfix-2.1.x\Marlin\src\inc\MarlinConfig.h:31,
                 from C:\Users\User\Downloads\Marlin-bugfix-2.1.x\Marlin\src\HAL\STM32\HAL.cpp:27:
C:\Users\User\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.9.0\system/Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h:51:17: note: 'uint32_t SystemCoreClock' is not const
   51 | extern uint32_t SystemCoreClock;          /*!< System Clock Frequency (Core Clock) */
      |                 ^~~~~~~~~~~~~~~

This error happens on both the suggested (now deprecated) STM32 Cores versions 1.8 and 1.9 (1.7 fails on a different error) and on the latest STM32 2.4.0.

I have tested both the 2.1 stable and 2.1 bugfix/nightly branches/configs.

Configuration Files

Required: Include a ZIP file containing Configuration.h and Configuration_adv.h.
Unmodified configs straight from the repo, repacked into a zip:
Marlin.zip

Steps to Reproduce

Simply follow the installation instructions from the Maylan/M200 v1 README.md.

Expected behavior:
A completed build.

Actual behavior:
No completed build.

Additional Information

Full build log:
marlinfull.log

EDIT: The same issue also happens in 2.0.9.5 it seems.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Malyan/M200 v1 README.md build instructions and the attached Configuration.h and Configuration_adv.h, then inspect the reported failure in Marlin/src/HAL/STM32/HAL.cpp around line 70. Reproduce the build with the listed STM32 core versions and review marlinfull.log. Done means the example configuration builds successfully as documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system, embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.