MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.28k stars 19.24k forks source link

[BUG] STM32F103RET6_creality fails to compile with Ender-3 V2 default config #22160

Closed rfinnie closed 3 years ago

rfinnie commented 3 years ago

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

Yes, and the problem still exists.

Bug Description

STM32F103RET6_creality fails to compile with with Ender-3 V2 default config. STM32F103RET6_creality_maple compiles successfully, however.

ryan@linda:~/git/Marlin{bugfix-2.0.x}$ git reset --hard
HEAD is now at d0df8bc3cb 💡 Add G28 L description (#22144)
ryan@linda:~/git/Marlin{bugfix-2.0.x}$ git -C ~/git/Marlin-Configurations show | head
commit 415943fa3f11384b0b1366dab71129898cf15a1f
Author: Scott Lahteine <github@thinkyhead.com>
Date:   Mon Jun 14 17:39:29 2021 -0500

    ✨ REDUNDANT_PART_COOLING_FAN

    MarlinFirmware/Marlin#21888

diff --git a/config/default/Configuration_adv.h b/config/default/Configuration_adv.h
index 49a0b7b13..ed2ccfdc7 100644
ryan@linda:~/git/Marlin{bugfix-2.0.x}$ cp ~/git/Marlin-Configurations/config/examples/Creality/Ender-3\ V2/Configuration* Marlin/
ryan@linda:~/git/Marlin{bugfix-2.0.x}$ platformio run --environment STM32F103RET6_creality --target clean
Processing STM32F103RET6_creality (platform: ststm32@~12.1; board: genericSTM32F103RE; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Build environment is clean
================================================================================ [SUCCESS] Took 0.21 seconds ================================================================================

Environment             Status    Duration
----------------------  --------  ------------
STM32F103RET6_creality  SUCCESS   00:00:00.207
================================================================================ 1 succeeded in 00:00:00.207 ================================================================================
ryan@linda:~/git/Marlin{bugfix-2.0.x}$ platformio run --environment STM32F103RET6_creality
Processing STM32F103RET6_creality (platform: ststm32@~12.1; board: genericSTM32F103RE; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/genericSTM32F103RE.html
PLATFORM: ST STM32 (12.1.1) > STM32F103RE (64k RAM. 512k Flash)
HARDWARE: STM32F103RET6 72MHz, 64KB RAM, 512KB Flash
DEBUG: Current (jlink) External (blackmagic, cmsis-dap, jlink, stlink)
PACKAGES: 
 - framework-arduinoststm32 4.10900.200819 (1.9.0) 
 - framework-cmsis 2.50501.200527 (5.5.1) 
 - toolchain-gccarmnoneeabi 1.90201.191206 (9.2.1)
Converting Marlin.ino
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 11 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <SPI> 1.0
|-- <Servo> 1.1.2
|-- <EEPROM> 2.0.1
|-- <SoftwareSerialM> 1.0.0
|-- <IWatchdog> 1.0.0
|-- <Wire> 1.0
Building in release mode
Compiling .pio/build/STM32F103RET6_creality/FrameworkArduinoVariant/PeripheralPins.c.o
[snip]
Compiling .pio/build/STM32F103RET6_creality/src/src/libs/buzzer.cpp.o
Marlin/src/lcd/dwin/e3v2/dwin.cpp:497:71: warning: use of 'auto' in parameter declaration only available with '-fconcepts'
  497 | inline bool Apply_Encoder(const ENCODER_DiffState &encoder_diffState, auto &valref) {
      |                                                                       ^~~~
Compiling .pio/build/STM32F103RET6_creality/src/src/libs/crc16.cpp.o
Compiling .pio/build/STM32F103RET6_creality/src/src/libs/numtostr.cpp.o
Compiling .pio/build/STM32F103RET6_creality/src/src/libs/stopwatch.cpp.o
Compiling .pio/build/STM32F103RET6_creality/src/src/libs/vector_3.cpp.o
Compiling .pio/build/STM32F103RET6_creality/src/src/module/endstops.cpp.o
Compiling .pio/build/STM32F103RET6_creality/src/src/module/motion.cpp.o
Compiling .pio/build/STM32F103RET6_creality/src/src/module/planner.cpp.o
Compiling .pio/build/STM32F103RET6_creality/src/src/module/settings.cpp.o
Compiling .pio/build/STM32F103RET6_creality/src/src/module/stepper.cpp.o
Compiling .pio/build/STM32F103RET6_creality/src/src/module/stepper/indirection.cpp.o
Compiling .pio/build/STM32F103RET6_creality/src/src/module/temperature.cpp.o
Compiling .pio/build/STM32F103RET6_creality/src/src/module/tool_change.cpp.o
Compiling .pio/build/STM32F103RET6_creality/src/src/sd/Sd2Card.cpp.o
Compiling .pio/build/STM32F103RET6_creality/src/src/sd/SdBaseFile.cpp.o
Compiling .pio/build/STM32F103RET6_creality/src/src/sd/SdFatUtil.cpp.o
Compiling .pio/build/STM32F103RET6_creality/src/src/sd/SdFile.cpp.o
Compiling .pio/build/STM32F103RET6_creality/src/src/sd/SdVolume.cpp.o
Compiling .pio/build/STM32F103RET6_creality/src/src/sd/cardreader.cpp.o
Compiling .pio/build/STM32F103RET6_creality/libd36/SPI/SPI.cpp.o
Compiling .pio/build/STM32F103RET6_creality/libd36/SPI/utility/spi_com.c.o
Compiling .pio/build/STM32F103RET6_creality/libe7d/Servo/stm32/Servo.cpp.o
Archiving .pio/build/STM32F103RET6_creality/libaab/libEEPROM.a
Indexing .pio/build/STM32F103RET6_creality/libaab/libEEPROM.a
Compiling .pio/build/STM32F103RET6_creality/liba2a/SoftwareSerialM/HAL_softserial_LPC1768.cpp.o
Compiling .pio/build/STM32F103RET6_creality/liba2a/SoftwareSerialM/HAL_softserial_SAMD51.cpp.o
Archiving .pio/build/STM32F103RET6_creality/libd36/libSPI.a
Compiling .pio/build/STM32F103RET6_creality/liba2a/SoftwareSerialM/HAL_softserial_STM32.cpp.o
Indexing .pio/build/STM32F103RET6_creality/libd36/libSPI.a
Compiling .pio/build/STM32F103RET6_creality/liba2a/SoftwareSerialM/HAL_softserial_STM32F1.cpp.o
Compiling .pio/build/STM32F103RET6_creality/liba2a/SoftwareSerialM/SoftwareSerial.cpp.o
Compiling .pio/build/STM32F103RET6_creality/libcf9/IWatchdog/IWatchdog.cpp.o
Compiling .pio/build/STM32F103RET6_creality/libb12/Wire/Wire.cpp.o
Compiling .pio/build/STM32F103RET6_creality/libb12/Wire/utility/twi.c.o
In file included from .pio/libdeps/STM32F103RET6_creality/SoftwareSerialM/HAL_softserial_STM32.cpp:27:
.pio/libdeps/STM32F103RET6_creality/SoftwareSerialM/HAL_softserial_STM32.h:37:36: error: variable or field 'SoftSerial_Handler' declared void
   37 | extern "C" void SoftSerial_Handler(stimer_t *htim);
      |                                    ^~~~~~~~
.pio/libdeps/STM32F103RET6_creality/SoftwareSerialM/HAL_softserial_STM32.h:37:36: error: 'stimer_t' was not declared in this scope; did you mean 'timer_t'?
   37 | extern "C" void SoftSerial_Handler(stimer_t *htim);
      |                                    ^~~~~~~~
      |                                    timer_t
.pio/libdeps/STM32F103RET6_creality/SoftwareSerialM/HAL_softserial_STM32.h:37:46: error: 'htim' was not declared in this scope; did you mean 'tm'?
   37 | extern "C" void SoftSerial_Handler(stimer_t *htim);
      |                                              ^~~~
      |                                              tm
.pio/libdeps/STM32F103RET6_creality/SoftwareSerialM/HAL_softserial_STM32.cpp:69:1: error: 'stimer_t' does not name a type; did you mean 'timer_t'?
   69 | stimer_t SSTimerHandle;
      | ^~~~~~~~
      | timer_t
In file included from .pio/libdeps/STM32F103RET6_creality/SoftwareSerialM/HAL_softserial.h:28,
                 from .pio/libdeps/STM32F103RET6_creality/SoftwareSerialM/SoftwareSerial.cpp:40:
.pio/libdeps/STM32F103RET6_creality/SoftwareSerialM/HAL_softserial_STM32.h:37:36: error: variable or field 'SoftSerial_Handler' declared void
   37 | extern "C" void SoftSerial_Handler(stimer_t *htim);
      |                                    ^~~~~~~~
.pio/libdeps/STM32F103RET6_creality/SoftwareSerialM/HAL_softserial_STM32.h:37:36: error: 'stimer_t' was not declared in this scope; did you mean 'timer_t'?
   37 | extern "C" void SoftSerial_Handler(stimer_t *htim);
      |                                    ^~~~~~~~
      |                                    timer_t
.pio/libdeps/STM32F103RET6_creality/SoftwareSerialM/HAL_softserial_STM32.h:37:46: error: 'htim' was not declared in this scope; did you mean 'tm'?
   37 | extern "C" void SoftSerial_Handler(stimer_t *htim);
      |                                              ^~~~
      |                                              tm
.pio/libdeps/STM32F103RET6_creality/SoftwareSerialM/HAL_softserial_STM32.h:35:71: error: variable or field 'SoftSerial_Handler' declared void
   35 | #define HAL_SOFTSERIAL_TIMER_ISR() extern "C" void SoftSerial_Handler(stimer_t *htim)
      |                                                                       ^~~~~~~~
.pio/libdeps/STM32F103RET6_creality/SoftwareSerialM/SoftwareSerial.cpp:218:1: note: in expansion of macro 'HAL_SOFTSERIAL_TIMER_ISR'
  218 | HAL_SOFTSERIAL_TIMER_ISR() {
      | ^~~~~~~~~~~~~~~~~~~~~~~~
.pio/libdeps/STM32F103RET6_creality/SoftwareSerialM/HAL_softserial_STM32.h:35:71: error: 'stimer_t' was not declared in this scope; did you mean 'timer_t'?
   35 | #define HAL_SOFTSERIAL_TIMER_ISR() extern "C" void SoftSerial_Handler(stimer_t *htim)
      |                                                                       ^~~~~~~~
.pio/libdeps/STM32F103RET6_creality/SoftwareSerialM/SoftwareSerial.cpp:218:1: note: in expansion of macro 'HAL_SOFTSERIAL_TIMER_ISR'
  218 | HAL_SOFTSERIAL_TIMER_ISR() {
      | ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated due to -fmax-errors=5.
.pio/libdeps/STM32F103RET6_creality/SoftwareSerialM/HAL_softserial_STM32.cpp: In function 'void HAL_softSerial_init()':
.pio/libdeps/STM32F103RET6_creality/SoftwareSerialM/HAL_softserial_STM32.cpp:74:3: error: 'SSTimerHandle' was not declared in this scope
   74 |   SSTimerHandle.timer = SS_TIMER_DEV;
      |   ^~~~~~~~~~~~~
*** [.pio/build/STM32F103RET6_creality/liba2a/SoftwareSerialM/SoftwareSerial.cpp.o] Error 1
Archiving .pio/build/STM32F103RET6_creality/libe7d/libServo.a
Indexing .pio/build/STM32F103RET6_creality/libe7d/libServo.a
compilation terminated due to -fmax-errors=5.
*** [.pio/build/STM32F103RET6_creality/liba2a/SoftwareSerialM/HAL_softserial_STM32.cpp.o] Error 1
================================================================================ [FAILED] Took 39.74 seconds ================================================================================

Environment             Status    Duration
----------------------  --------  ------------
STM32F103RET6_creality  FAILED    00:00:39.738
=========================================================================== 1 failed, 0 succeeded in 00:00:39.738 ===========================================================================
1 ryan@linda:~/git/Marlin{bugfix-2.0.x}$ 

Bug Timeline

As of 2.0.9, presumably before, during _maple split

Expected behavior

Successful compilation :)

Actual behavior

*** [.pio/build/STM32F103RET6_creality/liba2a/SoftwareSerialM/HAL_softserial_STM32.cpp.o] Error 1

Steps to Reproduce

No response

Version of Marlin Firmware

bugfix-2.0.x HEAD d0df8bc3cb

Printer model

Ender 3 V2

Electronics

No response

Add-ons

No response

Your Slicer

No response

Host Software

No response

Additional information & file uploads

No response

The-EG commented 3 years ago

Delete your entire .pio directory in your Marlin source directory and try building again.

rfinnie commented 3 years ago

... huh, that worked, despite not even having a STM32F103RET6_creality build directory, so I can't see why there was a problem before. I'll close, but I'm confused. Thanks!

The-EG commented 3 years ago

Many build environments, including this one, were changed from maple -> stm32 without being renamed (the 'old' environment is now *_maple). Even if you 'build clean', the dependencies for the 'old' environment were cached and since the 'new' environment had the same name, it was trying to build them.

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.