MarlinFirmware / Configurations

Configurations for Marlin Firmware
https://marlinfw.org
GNU General Public License v3.0
2.06k stars 3.37k forks source link

Malyan M200 config does not compile or function as expected #110

Closed JamesHagerman closed 4 years ago

JamesHagerman commented 4 years ago

Bug Description

PlatformIO builds of Marlin's bugfix-2.0.x branch fail when using the latest Malyan M200 Configuration.h and Configuration_adv.h` files from this repo.

Enabling #define NOZZLE_PARK_FEATURE allows the compile to succeed, but the resulting firmware.bin does not operate as expected on a M200 V2 printer.

My Configurations

Exact copies of the latest Configuration.h and Configuration_adv.h` files from this point in history: https://github.com/MarlinFirmware/Configurations/tree/8f4c32893feecbf1246cddd963ec5032e1d24c2c/config/examples/Malyan/M200

Steps to Reproduce

  1. Update VSCode and PlatformIO
  2. git clone Marlin to C:\
  3. git checkout bugfix-2.0.x
  4. Open Marlin root in PlatformIO
  5. Copy full contents of Configuration.h and Configuration_adv.h from the above link
  6. Open PlatformIO panel in VSCode
  7. Navigate to and expand the env:STM32F070RB_malyan section in the PROJECT TASKS list
  8. Click Clean, verify clean operation succeeds
  9. Click Build
  10. See relevant error output below
  11. Uncomment #define NOZZLE_PARK_FEATURE in Configuration.h
  12. Click Build again
  13. See a successful build

Expected behavior: Successful build that has close to working configurations for this printer

Actual behavior: Build fails and simple modification to get the build to pass still has multiple issues on the printer.

Additional Information

I understand that recent work has been underway to get Marlin working on these printers... but the state of that work is not fully discover-able.

I'm using Octoprint connected over USB to control the printer for testing. Here is the current status of the build output by these configurations after flashing it to the printer:

I'm willing to help test changes, I just don't know where to being in a way that is actually helpful.

Error output from building without NOZZLE_PARK_FEATURE enabled:

> Executing task in folder Marlin: C:\Users\jamis\.platformio\penv\Scripts\platformio.exe run --environment STM32F070RB_malyan <

Processing STM32F070RB_malyan (platform: ststm32; board: malyanM200v2; framework: arduino)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/malyanM200v2.html
PLATFORM: ST STM32 6.1.0 > Malyan M200 V2/Delta
HARDWARE: STM32F070RBT6 48MHz, 16KB RAM, 128KB Flash
DEBUG: Current (stlink) On-board (stlink) External (blackmagic, jlink)
PACKAGES:
 - framework-arduinoststm32 4.10700.200103 (1.7.0)
 - 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 13 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <Adafruit MAX31865 library> 1.0.3
|   |-- <SPI> 1.0
|-- <Arduino-L6470> 0.8.0
|-- <SailfishLCD>
|-- <SlowSoftI2CMaster>
|-- <SPI> 1.0
|-- <Servo> 1.1.2
|-- <IWatchdog> 1.0.0
|-- <Wire> 1.0
Building in release mode
Compiling .pio\build\STM32F070RB_malyan\FrameworkArduinoVariant\PeripheralPins.c.o

[...]

In file included from C:\Users\jamis\.platformio\packages\framework-arduinoststm32@4.10700.200103\cores\arduino\stm32\startup_stm32yyxx.S:1:
C:\Users\jamis\.platformio\packages\framework-arduinoststm32@4.10700.200103\cores\arduino\stm32\stm32_def_build.h:357:2: warning: #warning "No CMSIS startup file defined, custom one should be used" [-Wcpp]
  357 | #warning "No CMSIS startup file defined, custom one should be used"
      |  ^~~~~~~

[...]

Compiling .pio\build\STM32F070RB_malyan\src\src\HAL\STM32\HAL_SPI.cpp.o
Compiling .pio\build\STM32F070RB_malyan\src\src\HAL\STM32\Sd2Card_sdio_stm32duino.cpp.o
Compiling .pio\build\STM32F070RB_malyan\src\src\HAL\STM32\Servo.cpp.o
In file included from c:\marlin\marlin\src\inc\marlinconfig.h:40,
                 from Marlin\src\HAL\STM32\Sd2Card_sdio_stm32duino.cpp:23:
c:\marlin\marlin\src\inc\SanityCheck.h:717:25: error: non-constant condition for static assertion
  717 |   static_assert(nullptr == strstr(EVENT_GCODE_SD_STOP, "G27"), "NOZZLE_PARK_FEATURE is required to use G27 in EVENT_GCODE_SD_STOP.");
      |                 ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c:\marlin\marlin\src\inc\SanityCheck.h:717:34: error: call to non-'constexpr' function 'char* strstr(const char*, const char*)'
  717 |   static_assert(nullptr == strstr(EVENT_GCODE_SD_STOP, "G27"), "NOZZLE_PARK_FEATURE is required to use G27 in EVENT_GCODE_SD_STOP.");
      |                            ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from c:\marlin\marlin\src\inc\marlinconfig.h:40,
                 from Marlin\src\HAL\STM32\timers.h:25,
                 from Marlin\src\HAL\STM32\HAL.h:121,
                 from Marlin\src\HAL\STM32\HAL.cpp:25:
c:\marlin\marlin\src\inc\SanityCheck.h:717:25: error: non-constant condition for static assertion
  717 |   static_assert(nullptr == strstr(EVENT_GCODE_SD_STOP, "G27"), "NOZZLE_PARK_FEATURE is required to use G27 in EVENT_GCODE_SD_STOP.");
      |                 ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c:\marlin\marlin\src\inc\SanityCheck.h:717:34: error: call to non-'constexpr' function 'char* strstr(const char*, const char*)'
  717 |   static_assert(nullptr == strstr(EVENT_GCODE_SD_STOP, "G27"), "NOZZLE_PARK_FEATURE is required to use G27 in EVENT_GCODE_SD_STOP.");
      |                            ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from c:\marlin\marlin\src\inc\marlinconfig.h:40,
                 from Marlin\src\HAL\STM32\HAL_SPI.cpp:25:
c:\marlin\marlin\src\inc\SanityCheck.h:717:25: error: non-constant condition for static assertion
  717 |   static_assert(nullptr == strstr(EVENT_GCODE_SD_STOP, "G27"), "NOZZLE_PARK_FEATURE is required to use G27 in EVENT_GCODE_SD_STOP.");
      |                 ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c:\marlin\marlin\src\inc\SanityCheck.h:717:34: error: call to non-'constexpr' function 'char* strstr(const char*, const char*)'
  717 |   static_assert(nullptr == strstr(EVENT_GCODE_SD_STOP, "G27"), "NOZZLE_PARK_FEATURE is required to use G27 in EVENT_GCODE_SD_STOP.");
      |                            ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
*** [.pio\build\STM32F070RB_malyan\src\src\HAL\STM32\Sd2Card_sdio_stm32duino.cpp.o] Error 1
*** [.pio\build\STM32F070RB_malyan\src\src\HAL\STM32\HAL.cpp.o] Error 1
*** [.pio\build\STM32F070RB_malyan\src\src\HAL\STM32\HAL_SPI.cpp.o] Error 1
In file included from c:\marlin\marlin\src\inc\marlinconfig.h:40,
                 from Marlin\src\HAL\STM32\Servo.cpp:25:
c:\marlin\marlin\src\inc\SanityCheck.h:717:25: error: non-constant condition for static assertion
  717 |   static_assert(nullptr == strstr(EVENT_GCODE_SD_STOP, "G27"), "NOZZLE_PARK_FEATURE is required to use G27 in EVENT_GCODE_SD_STOP.");
      |                 ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c:\marlin\marlin\src\inc\SanityCheck.h:717:34: error: call to non-'constexpr' function 'char* strstr(const char*, const char*)'
  717 |   static_assert(nullptr == strstr(EVENT_GCODE_SD_STOP, "G27"), "NOZZLE_PARK_FEATURE is required to use G27 in EVENT_GCODE_SD_STOP.");
      |                            ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
*** [.pio\build\STM32F070RB_malyan\src\src\HAL\STM32\Servo.cpp.o] Error 1
======================================================================================================================== [FAILED] Took 20.25 seconds ========================================================================================================================
JamesHagerman commented 4 years ago

After poking around at this more, I found what seems to be the primary issue! The following config values need to be set to false in Configuration.h:

#define DISABLE_X false
#define DISABLE_Y false
#define DISABLE_Z false

Once that was set, I had to flash a few times to get the stepper motor directions set correctly. My MPMS V2 ended up using:

#define INVERT_X_DIR true
#define INVERT_Y_DIR false
#define INVERT_Z_DIR false

Again, just to be clear, I also had to uncomment/enable the NOZZLE_PARK_FEATURE to enable it or the compile would fail:

#define NOZZLE_PARK_FEATURE

After all of that, PlatformIO (Core 4.3.4, Home 3.2.2, ST STM32: 6.1.0) was able to compile a working firmware.bin by clicking Build on the env:STM32F070RB_malyan config! Again, I used the bugfix-2.0.x branch of both repos as a starting point (Marlin: 84c43e9ee799bdbaa1e5d53f73b63cca85a57d40, Configurations: 38e200587e26d339e4960a7abad77c728e3812f9).

Oddly, the Fan on and Fan off buttons in Octoprint didn't seem to control either fan but the hotend fan did come on when it started heating so I'm not worried.

I'm running a test print now. So far, the extruder stepper seems to be having a more difficult time (clicking) while running Marlin than it did with the stock firmware...

Test print worked! A few clicks from the extruder, but other than that, it went well!

thinkyhead commented 4 years ago

I've had a hard time getting a working M200 build. Could you ZIP up your project and drop it on a reply so I can compare to my non-working situation?

thinkyhead commented 4 years ago

I'm not sure about the stepper direction inverting settings, since it's so easy to have the plugs flipped backwards on one printer vs. another. We'll need to get feedback from more people in the M200 user groups so we have a larger sample size.