From 067f0e73dc2d437002bc72682877860cc49159a5 Mon Sep 17 00:00:00 2001 From: xC0000005 <32139633+xC0000005@users.noreply.github.com> Date: Mon, 5 Aug 2019 12:57:21 -0700 Subject: [PATCH 01/14] Add pause/resume, use more ExtUI --- Marlin/src/lcd/extui_malyan_lcd.cpp | 71 +++++++++++++---------------- 1 file changed, 32 insertions(+), 39 deletions(-) diff --git a/Marlin/src/lcd/extui_malyan_lcd.cpp b/Marlin/src/lcd/extui_malyan_lcd.cpp index dde1a4c8ff7a..5647dc371bbb 100644 --- a/Marlin/src/lcd/extui_malyan_lcd.cpp +++ b/Marlin/src/lcd/extui_malyan_lcd.cpp @@ -119,10 +119,10 @@ void process_lcd_c_command(const char* command) { LIMIT(feedrate_percentage, 10, 999); break; - case 'T': thermalManager.setTargetHotend(atoi(command + 1), 0); break; + case 'T': ExtUI::setTargetTemp_celsius(atoi(command + 1), ExtUI::extruder_t::E0); break; #if HAS_HEATED_BED - case 'P': thermalManager.setTargetBed(atoi(command + 1)); break; + case 'P': ExtUI::setTargetTemp_celsius(atoi(command + 1), ExtUI::heater_t::BED); break; #endif default: SERIAL_ECHOLNPAIR("UNKNOWN C COMMAND", command); @@ -180,29 +180,30 @@ void process_lcd_eb_command(const char* command) { * X, Y, Z, A (extruder) */ void process_lcd_j_command(const char* command) { - static bool steppers_enabled = false; char axis = command[0]; + float axis_position = 0; + bool axis_known = false; + #define MOVE_AXIS(TARGET) \ + axis_known = true; \ + axis_position = ExtUI::getAxisPosition_mm(TARGET); \ + axis_position += atof(command + 1) / 10.0; \ + ExtUI::setAxisPosition_mm(axis_position, TARGET); switch (axis) { case 'E': - // enable or disable steppers - // switch to relative - queue.enqueue_now_P(PSTR("G91")); - queue.enqueue_now_P(steppers_enabled ? PSTR("M18") : PSTR("M17")); - steppers_enabled = !steppers_enabled; break; case 'A': - axis = 'E'; - // fallthru + MOVE_AXIS(ExtUI::extruder_t::E0); + break; case 'Y': + MOVE_AXIS(ExtUI::axis_t::Y); + break; case 'Z': - case 'X': { - // G0 - // The M200 class UI seems to send movement in .1mm values. - char cmd[20]; - sprintf_P(cmd, PSTR("G1 %c%03.1f"), axis, atof(command + 1) / 10.0); - queue.enqueue_one_now(cmd); - } break; + MOVE_AXIS(ExtUI::axis_t::Z); + break; + case 'X': + MOVE_AXIS(ExtUI::axis_t::X); + break; default: SERIAL_ECHOLNPAIR("UNKNOWN J COMMAND", command); return; @@ -234,25 +235,18 @@ void process_lcd_j_command(const char* command) { void process_lcd_p_command(const char* command) { switch (command[0]) { + case 'P': + ExtUI::pausePrint(); + write_to_lcd_P(PSTR("{SYS:PAUSED}")); + break; + case 'R': + ExtUI::resumePrint(); + write_to_lcd_P(PSTR("{SYS:RESUMED}")); + break; case 'X': - #if ENABLED(SDSUPPORT) - // cancel print - write_to_lcd_P(PSTR("{SYS:CANCELING}")); - last_printing_status = false; - card.stopSDPrint( - #if SD_RESORT - true - #endif - ); - queue.clear(); - quickstop_stepper(); - print_job_timer.stop(); - thermalManager.disable_all_heaters(); - thermalManager.zero_fan_speeds(); - wait_for_heatup = false; - write_to_lcd_P(PSTR("{SYS:STARTED}")); - #endif - break; + ExtUI::stopPrint(); + write_to_lcd_P(PSTR("{SYS:STARTED}")); + break; case 'H': // Home all axis queue.enqueue_now_P(PSTR("G28")); @@ -405,8 +399,7 @@ namespace ExtUI { /** * The Malyan LCD actually runs as a separate MCU on Serial 1. * This code's job is to siphon the weird curly-brace commands from - * it and translate into gcode, which then gets injected into - * the command queue where possible. + * it and translate into ExtUI operations where possible. */ inbound_count = 0; LCD_SERIAL.begin(500000); @@ -455,13 +448,13 @@ namespace ExtUI { // If there was a print in progress, we need to emit the final // print status as {TQ:100}. Reset last percent done so a new print will // issue a percent of 0. - const uint8_t percent_done = IS_SD_PRINTING() ? card.percentDone() : last_printing_status ? 100 : 0; + const uint8_t percent_done = (ExtUI::isPrinting()||ExtUI::isPrintingFromMediaPaused()) ? ExtUI::getProgress_percent() : last_printing_status ? 100 : 0; if (percent_done != last_percent_done) { char message_buffer[16]; sprintf_P(message_buffer, PSTR("{TQ:%03i}"), percent_done); write_to_lcd(message_buffer); last_percent_done = percent_done; - last_printing_status = IS_SD_PRINTING(); + last_printing_status = ExtUI::isPrinting(); } #endif } From be03ca5b2562d90d68738f1f505ac475290bdfa3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 6 Aug 2019 06:27:38 -0500 Subject: [PATCH 02/14] move_axis as a lambda --- Marlin/src/lcd/extui_malyan_lcd.cpp | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/Marlin/src/lcd/extui_malyan_lcd.cpp b/Marlin/src/lcd/extui_malyan_lcd.cpp index 5647dc371bbb..8cf2a623d582 100644 --- a/Marlin/src/lcd/extui_malyan_lcd.cpp +++ b/Marlin/src/lcd/extui_malyan_lcd.cpp @@ -180,29 +180,25 @@ void process_lcd_eb_command(const char* command) { * X, Y, Z, A (extruder) */ void process_lcd_j_command(const char* command) { - char axis = command[0]; - float axis_position = 0; - bool axis_known = false; - #define MOVE_AXIS(TARGET) \ - axis_known = true; \ - axis_position = ExtUI::getAxisPosition_mm(TARGET); \ - axis_position += atof(command + 1) / 10.0; \ - ExtUI::setAxisPosition_mm(axis_position, TARGET); - - switch (axis) { + auto move_axis = [](const auto axis) { + float dist = atof(command + 1) / 10.0; + ExtUI::setAxisPosition_mm(ExtUI::getAxisPosition_mm(axis) + dist, axis); + } + + switch (command[0]) { case 'E': break; case 'A': - MOVE_AXIS(ExtUI::extruder_t::E0); + move_axis(ExtUI::extruder_t::E0); break; case 'Y': - MOVE_AXIS(ExtUI::axis_t::Y); + move_axis(ExtUI::axis_t::Y); break; case 'Z': - MOVE_AXIS(ExtUI::axis_t::Z); + move_axis(ExtUI::axis_t::Z); break; - case 'X': - MOVE_AXIS(ExtUI::axis_t::X); + case 'X': + move_axis(ExtUI::axis_t::X); break; default: SERIAL_ECHOLNPAIR("UNKNOWN J COMMAND", command); @@ -245,7 +241,7 @@ void process_lcd_p_command(const char* command) { break; case 'X': ExtUI::stopPrint(); - write_to_lcd_P(PSTR("{SYS:STARTED}")); + write_to_lcd_P(PSTR("{SYS:STARTED}")); break; case 'H': // Home all axis From 8d1ec04b7b3269e1fbb5141f8b584f9be8ae328d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 6 Aug 2019 06:27:48 -0500 Subject: [PATCH 03/14] Keep SYS:CANCELING ? --- Marlin/src/lcd/extui_malyan_lcd.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Marlin/src/lcd/extui_malyan_lcd.cpp b/Marlin/src/lcd/extui_malyan_lcd.cpp index 8cf2a623d582..0306719fb0ec 100644 --- a/Marlin/src/lcd/extui_malyan_lcd.cpp +++ b/Marlin/src/lcd/extui_malyan_lcd.cpp @@ -240,6 +240,7 @@ void process_lcd_p_command(const char* command) { write_to_lcd_P(PSTR("{SYS:RESUMED}")); break; case 'X': + write_to_lcd_P(PSTR("{SYS:CANCELING}")); ExtUI::stopPrint(); write_to_lcd_P(PSTR("{SYS:STARTED}")); break; From 02374116240385e7f38ea200bf963c91c00f0a93 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 6 Aug 2019 06:34:57 -0500 Subject: [PATCH 04/14] Fix M200 config --- config/examples/Malyan/M200/Configuration.h | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/config/examples/Malyan/M200/Configuration.h b/config/examples/Malyan/M200/Configuration.h index 39fbccdaf705..c6827918fa99 100644 --- a/config/examples/Malyan/M200/Configuration.h +++ b/config/examples/Malyan/M200/Configuration.h @@ -2030,7 +2030,7 @@ // // Touch-screen LCD for Malyan M200 printers // -//#define MALYAN_LCD +#define MALYAN_LCD // // Third-party or vendor-customized controller interfaces. @@ -2051,15 +2051,6 @@ //============================ Other Controllers ============================ //============================================================================= -// -// CONTROLLER TYPE: Standalone / Serial -// - -// -// LCD for Malyan M200 printers. -// -#define MALYAN_LCD - // // ADS7843/XPT2046 ADC Touchscreen such as ILI9341 2.8 // From b75a0cd699e8cbd416060c0b30c0edc87e69248b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 6 Aug 2019 06:35:30 -0500 Subject: [PATCH 05/14] Include Malyan M200 build instructions --- config/examples/Malyan/M200/README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 config/examples/Malyan/M200/README.md diff --git a/config/examples/Malyan/M200/README.md b/config/examples/Malyan/M200/README.md new file mode 100644 index 000000000000..d78dab4a11ea --- /dev/null +++ b/config/examples/Malyan/M200/README.md @@ -0,0 +1 @@ +### Malyan M200 Build Instructions From ebfcb10550f4818a7fa12ac607f309377d2f539e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 6 Aug 2019 19:59:50 -0500 Subject: [PATCH 06/14] Tweak Malyan LCD style, optional errors --- Marlin/src/lcd/extui_malyan_lcd.cpp | 87 ++++++++++------------------- 1 file changed, 31 insertions(+), 56 deletions(-) diff --git a/Marlin/src/lcd/extui_malyan_lcd.cpp b/Marlin/src/lcd/extui_malyan_lcd.cpp index 0306719fb0ec..aa1db23579e6 100644 --- a/Marlin/src/lcd/extui_malyan_lcd.cpp +++ b/Marlin/src/lcd/extui_malyan_lcd.cpp @@ -45,6 +45,8 @@ #if ENABLED(MALYAN_LCD) +#define DEBUG_MALYAN_LCD + #include "extensible_ui/ui_api.h" #include "ultralcd.h" @@ -62,6 +64,9 @@ #define LONG_FILENAME_LENGTH 0 #endif +#define DEBUG_OUT ENABLED(DEBUG_MALYAN_LCD) +#include "../core/debug_out.h" + // On the Malyan M200, this will be Serial1. On a RAMPS board, // it might not be. #define LCD_SERIAL Serial1 @@ -125,7 +130,7 @@ void process_lcd_c_command(const char* command) { case 'P': ExtUI::setTargetTemp_celsius(atoi(command + 1), ExtUI::heater_t::BED); break; #endif - default: SERIAL_ECHOLNPAIR("UNKNOWN C COMMAND", command); + default: DEBUG_ECHOLNPAIR("UNKNOWN C COMMAND ", command); } } @@ -163,9 +168,7 @@ void process_lcd_eb_command(const char* command) { write_to_lcd(message_buffer); } break; - default: - SERIAL_ECHOLNPAIR("UNKNOWN E/B COMMAND", command); - return; + default: DEBUG_ECHOLNPAIR("UNKNOWN E/B COMMAND ", command); } } @@ -181,28 +184,17 @@ void process_lcd_eb_command(const char* command) { */ void process_lcd_j_command(const char* command) { auto move_axis = [](const auto axis) { - float dist = atof(command + 1) / 10.0; + const float dist = atof(command + 1) / 10.0; ExtUI::setAxisPosition_mm(ExtUI::getAxisPosition_mm(axis) + dist, axis); } switch (command[0]) { - case 'E': - break; - case 'A': - move_axis(ExtUI::extruder_t::E0); - break; - case 'Y': - move_axis(ExtUI::axis_t::Y); - break; - case 'Z': - move_axis(ExtUI::axis_t::Z); - break; - case 'X': - move_axis(ExtUI::axis_t::X); - break; - default: - SERIAL_ECHOLNPAIR("UNKNOWN J COMMAND", command); - return; + case 'E': break; + case 'A': move_axis(ExtUI::extruder_t::E0); break; + case 'Y': move_axis(ExtUI::axis_t::Y); break; + case 'Z': move_axis(ExtUI::axis_t::Z); break; + case 'X': move_axis(ExtUI::axis_t::X); break; + default: DEBUG_ECHOLNPAIR("UNKNOWN J COMMAND ", command); } } @@ -244,10 +236,7 @@ void process_lcd_p_command(const char* command) { ExtUI::stopPrint(); write_to_lcd_P(PSTR("{SYS:STARTED}")); break; - case 'H': - // Home all axis - queue.enqueue_now_P(PSTR("G28")); - break; + case 'H': queue.enqueue_now_P(PSTR("G28")); break; // Home all axes default: { #if ENABLED(SDSUPPORT) // Print file 000 - a three digit number indicating which @@ -329,9 +318,7 @@ void process_lcd_s_command(const char* command) { #endif } break; - default: - SERIAL_ECHOLNPAIR("UNKNOWN S COMMAND", command); - return; + default: DEBUG_ECHOLNPAIR("UNKNOWN S COMMAND ", command); } } @@ -345,34 +332,22 @@ void process_lcd_command(const char* command) { current++; // skip the leading {. The trailing one is already gone. byte command_code = *current++; - if (*current != ':') { - SERIAL_ECHOLNPAIR("UNKNOWN COMMAND FORMAT", command); - return; - } - - current++; // skip the : - - switch (command_code) { - case 'S': - process_lcd_s_command(current); - break; - case 'J': - process_lcd_j_command(current); - break; - case 'P': - process_lcd_p_command(current); - break; - case 'C': - process_lcd_c_command(current); - break; - case 'B': - case 'E': - process_lcd_eb_command(current); - break; - default: - SERIAL_ECHOLNPAIR("UNKNOWN COMMAND", command); - return; + if (*current == ':') { + + current++; // skip the : + + switch (command_code) { + case 'S': process_lcd_s_command(current); break; + case 'J': process_lcd_j_command(current); break; + case 'P': process_lcd_p_command(current); break; + case 'C': process_lcd_c_command(current); break; + case 'B': + case 'E': process_lcd_eb_command(current); break; + default: DEBUG_ECHOLNPAIR("UNKNOWN COMMAND ", command); + } } + else + DEBUG_ECHOLNPAIR("UNKNOWN COMMAND FORMAT ", command); } /** From bcbcc5b0edcd568a9e983e414960ca70066e1263 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 6 Aug 2019 20:43:26 -0500 Subject: [PATCH 07/14] Update extui_malyan_lcd.cpp --- Marlin/src/lcd/extui_malyan_lcd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/extui_malyan_lcd.cpp b/Marlin/src/lcd/extui_malyan_lcd.cpp index aa1db23579e6..b8b4e713faf3 100644 --- a/Marlin/src/lcd/extui_malyan_lcd.cpp +++ b/Marlin/src/lcd/extui_malyan_lcd.cpp @@ -45,7 +45,7 @@ #if ENABLED(MALYAN_LCD) -#define DEBUG_MALYAN_LCD +//#define DEBUG_MALYAN_LCD #include "extensible_ui/ui_api.h" From 86d8390ec8d81c81a436714c8d861b0d380ffa06 Mon Sep 17 00:00:00 2001 From: xC0000005 <32139633+xC0000005@users.noreply.github.com> Date: Wed, 7 Aug 2019 10:26:52 -0700 Subject: [PATCH 08/14] minor fix to lambda. --- Marlin/src/lcd/extui_malyan_lcd.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Marlin/src/lcd/extui_malyan_lcd.cpp b/Marlin/src/lcd/extui_malyan_lcd.cpp index b8b4e713faf3..bb571f60be2e 100644 --- a/Marlin/src/lcd/extui_malyan_lcd.cpp +++ b/Marlin/src/lcd/extui_malyan_lcd.cpp @@ -183,17 +183,18 @@ void process_lcd_eb_command(const char* command) { * X, Y, Z, A (extruder) */ void process_lcd_j_command(const char* command) { - auto move_axis = [](const auto axis) { - const float dist = atof(command + 1) / 10.0; + const float dist = atof(command + 1) / 10.0; + + auto move_axis = [](const auto axis, float dist) { ExtUI::setAxisPosition_mm(ExtUI::getAxisPosition_mm(axis) + dist, axis); - } + }; switch (command[0]) { case 'E': break; - case 'A': move_axis(ExtUI::extruder_t::E0); break; - case 'Y': move_axis(ExtUI::axis_t::Y); break; - case 'Z': move_axis(ExtUI::axis_t::Z); break; - case 'X': move_axis(ExtUI::axis_t::X); break; + case 'A': move_axis(ExtUI::extruder_t::E0, dist); break; + case 'Y': move_axis(ExtUI::axis_t::Y, dist); break; + case 'Z': move_axis(ExtUI::axis_t::Z, dist); break; + case 'X': move_axis(ExtUI::axis_t::X, dist); break; default: DEBUG_ECHOLNPAIR("UNKNOWN J COMMAND ", command); } } From 8fd31f4398dca0f67708c758ec72883ba4780e4e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 8 Aug 2019 02:28:31 -0500 Subject: [PATCH 09/14] Try using a capture --- Marlin/src/lcd/extui_malyan_lcd.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Marlin/src/lcd/extui_malyan_lcd.cpp b/Marlin/src/lcd/extui_malyan_lcd.cpp index bb571f60be2e..c9ce9170a3bc 100644 --- a/Marlin/src/lcd/extui_malyan_lcd.cpp +++ b/Marlin/src/lcd/extui_malyan_lcd.cpp @@ -183,18 +183,18 @@ void process_lcd_eb_command(const char* command) { * X, Y, Z, A (extruder) */ void process_lcd_j_command(const char* command) { - const float dist = atof(command + 1) / 10.0; - auto move_axis = [](const auto axis, float dist) { + auto move_axis = [command](const auto axis) { + const float dist = atof(command + 1) / 10.0; ExtUI::setAxisPosition_mm(ExtUI::getAxisPosition_mm(axis) + dist, axis); }; switch (command[0]) { case 'E': break; case 'A': move_axis(ExtUI::extruder_t::E0, dist); break; - case 'Y': move_axis(ExtUI::axis_t::Y, dist); break; - case 'Z': move_axis(ExtUI::axis_t::Z, dist); break; - case 'X': move_axis(ExtUI::axis_t::X, dist); break; + case 'Y': move_axis(ExtUI::axis_t::Y); break; + case 'Z': move_axis(ExtUI::axis_t::Z); break; + case 'X': move_axis(ExtUI::axis_t::X); break; default: DEBUG_ECHOLNPAIR("UNKNOWN J COMMAND ", command); } } From 1d7585937105976e98c53d12dee5c51162ec6d0b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 8 Aug 2019 03:36:52 -0500 Subject: [PATCH 10/14] Update README.md --- config/examples/Malyan/M200/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/examples/Malyan/M200/README.md b/config/examples/Malyan/M200/README.md index d78dab4a11ea..02a889218081 100644 --- a/config/examples/Malyan/M200/README.md +++ b/config/examples/Malyan/M200/README.md @@ -1 +1,3 @@ ### Malyan M200 Build Instructions + +Under Construction From 653b2fa184ba9a842e1fb1dd6015f2f655808462 Mon Sep 17 00:00:00 2001 From: xC0000005 <32139633+xC0000005@users.noreply.github.com> Date: Thu, 8 Aug 2019 22:33:06 -0700 Subject: [PATCH 11/14] Add build instructions. --- config/examples/Malyan/M200/README.md | 35 ++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/config/examples/Malyan/M200/README.md b/config/examples/Malyan/M200/README.md index 02a889218081..3c7b09eae2d8 100644 --- a/config/examples/Malyan/M200/README.md +++ b/config/examples/Malyan/M200/README.md @@ -1,3 +1,36 @@ ### Malyan M200 Build Instructions -Under Construction +Malyan M200 series firmware currently builds using the Arduino IDE. These instructions should +guide you through the configuration and compilation. + +1. Install the Arduino IDE from your favorite source (arduino.cc, windows store, app store) +2. Launch the IDE to add the ST boards manager: + a. From the file menu, select preferences + b. Add this link in the "*Additional Boards Managers URLs*" field: + https://github.com/stm32duino/BoardManagerFiles/raw/master/STM32/package_stm_index.json + c. Select "Show verbose ouptut during: compilation" +3. From the tools menu, choose Board, and at the top, Boards Manager +4. Type Malyan into the search field. +5. The only boards shown will be STM32 Cords by STMicroelectronics. The version should be at least 1.6.0, but if it's later, that's fine. Choose install. This will download many tools and packages, be patient. +6. From the Tools Menu, choose board, and scroll all the way down to 3D Printer Boards. + Select 3D Printer Boards.. +7. From the Tools Meny, choose board part number: + a. If you own a M200 V1 or early run (black V2), choose Malyan M200 V1 + b. If you own a M200 V2 later run (white/black) or V3 (Pro), choose Malyan M200 V2 (The V2 and V3 both share an STM32F070 MCU). Note that the V3 pinout is not complete - autolevel does not work. +8. From the Tools Menu, choose USB Support, CDC No Generic Serial. +9. Download the Marlin Source code from the bugfix-2.0.x branch. Unzip it +10. In the \Marlin-bugfix-2.0.x\Marlin directory are configuration.h and configuration_adv.h. Copy the ones from ..\config\examples\Malyan\M200 over these. +11. If you have an early run V2, the steps per MM are roughly half. Consult the mpminipro.com wiki for steps for your unit - modify configuration.h. +12. Inverting Axis - there's no pattern to which axis will need to be inverted - the only way to know is to test your particular printer. If you DO know, go ahead and invert the right ones. +13. Open the marlin.ino in Arduino. (it's in marlin-bugfix-2.0.x\Marlin). +14. From the sketch menu, select File->Export Compiled Binary. +15. When compilation is done, you've built firmware. The next stage is to flash it on. To do this look for a line like: +"C:\\Users\\Administrator\\Documents\\ArduinoData\\packages\\STM32\\tools\\arm-none-eabi-gcc\\8.2.1-1.7/bin/arm-none-eabi-objcopy" -O binary "C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\arduino_build_335240/Marlin.ino.elf" "C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\arduino_build_335240/Marlin.ino.bin" + The file "marlin.ino.bin" is your firmware. M200 (v1-3) and M300 printers require flashing via SD card. Use the SD card which came with the printer if possible - the bootloader is very picky about SD cards. Copy marlin.ino.bin to your SD card under three names: firmware.bin, update.bin, and fcupdate.flg. +16. Insert the SD card into your printer. Make sure the X axis is in the middle of the bed and the Y axis is as well (X and Y closed signals a UI upgrade to the bootloader). +17. Powercycle the printer. The first flash may take longer - don't be surprised if the .99 version number doesn't show up until after the UI has launched the default screen. +18. Remove the SD card and remove the fcupdate.flg file to prevent accidentally reflashing. +19. Test endstops, homing directions, and run a PID autotune. + +Welcome to Marlin 2.x... + From 1badd847cf30dca526b8e85db5603d2a631816c0 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 16 Aug 2019 19:55:53 -0500 Subject: [PATCH 12/14] Update README.md --- config/examples/Malyan/M200/README.md | 44 +++++++++++++-------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/config/examples/Malyan/M200/README.md b/config/examples/Malyan/M200/README.md index 3c7b09eae2d8..82dcf1a45ef8 100644 --- a/config/examples/Malyan/M200/README.md +++ b/config/examples/Malyan/M200/README.md @@ -5,32 +5,30 @@ guide you through the configuration and compilation. 1. Install the Arduino IDE from your favorite source (arduino.cc, windows store, app store) 2. Launch the IDE to add the ST boards manager: - a. From the file menu, select preferences - b. Add this link in the "*Additional Boards Managers URLs*" field: + - Open the **Preferences** dialog. + - Add this link in the "*Additional Boards Managers URLs*" field: https://github.com/stm32duino/BoardManagerFiles/raw/master/STM32/package_stm_index.json - c. Select "Show verbose ouptut during: compilation" -3. From the tools menu, choose Board, and at the top, Boards Manager -4. Type Malyan into the search field. + - Select "**Show verbose ouptut during: compilation**." +3. Select **Tools** > **Board** > **Boards Manager**. +4. Type "Malyan" into the Search field. 5. The only boards shown will be STM32 Cords by STMicroelectronics. The version should be at least 1.6.0, but if it's later, that's fine. Choose install. This will download many tools and packages, be patient. 6. From the Tools Menu, choose board, and scroll all the way down to 3D Printer Boards. Select 3D Printer Boards.. -7. From the Tools Meny, choose board part number: - a. If you own a M200 V1 or early run (black V2), choose Malyan M200 V1 - b. If you own a M200 V2 later run (white/black) or V3 (Pro), choose Malyan M200 V2 (The V2 and V3 both share an STM32F070 MCU). Note that the V3 pinout is not complete - autolevel does not work. -8. From the Tools Menu, choose USB Support, CDC No Generic Serial. -9. Download the Marlin Source code from the bugfix-2.0.x branch. Unzip it -10. In the \Marlin-bugfix-2.0.x\Marlin directory are configuration.h and configuration_adv.h. Copy the ones from ..\config\examples\Malyan\M200 over these. -11. If you have an early run V2, the steps per MM are roughly half. Consult the mpminipro.com wiki for steps for your unit - modify configuration.h. -12. Inverting Axis - there's no pattern to which axis will need to be inverted - the only way to know is to test your particular printer. If you DO know, go ahead and invert the right ones. -13. Open the marlin.ino in Arduino. (it's in marlin-bugfix-2.0.x\Marlin). -14. From the sketch menu, select File->Export Compiled Binary. -15. When compilation is done, you've built firmware. The next stage is to flash it on. To do this look for a line like: -"C:\\Users\\Administrator\\Documents\\ArduinoData\\packages\\STM32\\tools\\arm-none-eabi-gcc\\8.2.1-1.7/bin/arm-none-eabi-objcopy" -O binary "C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\arduino_build_335240/Marlin.ino.elf" "C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\arduino_build_335240/Marlin.ino.bin" - The file "marlin.ino.bin" is your firmware. M200 (v1-3) and M300 printers require flashing via SD card. Use the SD card which came with the printer if possible - the bootloader is very picky about SD cards. Copy marlin.ino.bin to your SD card under three names: firmware.bin, update.bin, and fcupdate.flg. -16. Insert the SD card into your printer. Make sure the X axis is in the middle of the bed and the Y axis is as well (X and Y closed signals a UI upgrade to the bootloader). -17. Powercycle the printer. The first flash may take longer - don't be surprised if the .99 version number doesn't show up until after the UI has launched the default screen. -18. Remove the SD card and remove the fcupdate.flg file to prevent accidentally reflashing. -19. Test endstops, homing directions, and run a PID autotune. +7. From the Tools Menu, choose board part number: + - If you own a M200 V1 or early run (black V2), choose **Malyan M200 V1**. + - If you own a M200 V2 later run (white/black) or V3 (Pro), choose **Malyan M200 V2** (The V2 and V3 both share an STM32F070 MCU). Note that the V3 pinout is not complete (autolevel doesn't work as of this writing). +8. From the **Tools** menu, choose **USB Support** > **CDC No Generic Serial**. +9. Download the latest Marlin source (from the [bugfix-2.0.x](https://github.com/MarlinFirmware/Marlin/tree/bugfix-2.0.x) branch) and unzip it. +10. Look in the `Marlin` subdirectory for the `Configuration.h` and `Configuration_adv.h` files. Replace these files with the configurations in the `config\examples\Malyan\M200` folder. +11. If you have an early-run V2, the steps-per-mm are roughly half. Consult the [mpminipro.com wiki](https://mpminipro.com/) for the steps that apply to your unit. Modify `Configuration.h`. +12. Inverting Axis. There's no pattern to axes will need to be inverted. The only way to know is to test your particular printer. If you *do* know, go ahead and invert the correct axes. +13. Open the `Marlin/Marlin.ino` file in Arduino IDE. +14. From the **Sketch** menu, select **File** > **Export Compiled Binary**. +15. When compilation is done you've built the firmware. The next stage is to flash it to the board. To do this look for a line like this: `"path/to/bin/arm-none-eabi-objcopy" -O binary "/path/to/Marlin.ino.elf" "/path/to/Marlin.ino.bin"` + The file `Marlin.ino.bin` is your firmware binary. M200 (v1-3) and M300 printers require flashing via SD card. Use the SD card that came with the printer if possible. The bootloader is very picky about SD cards. Copy `Marlin.ino.bin` to your SD card under three names: `firmware.bin`, `update.bin`, and `fcupdate.flg`. +16. Insert the SD card into your printer. Make sure the X and Y axes are centered in the middle of the bed. (When X and Y endstops are closed this signals a UI upgrade to the bootloader.) +17. Power-cycle the printer. The first flash may take longer. Don't be surprised if the .99 version number doesn't show up until after the UI has launched the default screen. +18. Remove the SD card and delete the `fcupdate.flg` file from the card to prevent an accidental re-flash. +19. Test the endstops and homing directions, run M303 PID autotune, and verify all features are working correctly. Welcome to Marlin 2.x... - From 4adac57b787bffc378cd6513d7d190b734af5d33 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 16 Aug 2019 20:00:27 -0500 Subject: [PATCH 13/14] Update README.md --- config/examples/Malyan/M200/README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/config/examples/Malyan/M200/README.md b/config/examples/Malyan/M200/README.md index 82dcf1a45ef8..84490786e191 100644 --- a/config/examples/Malyan/M200/README.md +++ b/config/examples/Malyan/M200/README.md @@ -11,10 +11,9 @@ guide you through the configuration and compilation. - Select "**Show verbose ouptut during: compilation**." 3. Select **Tools** > **Board** > **Boards Manager**. 4. Type "Malyan" into the Search field. -5. The only boards shown will be STM32 Cords by STMicroelectronics. The version should be at least 1.6.0, but if it's later, that's fine. Choose install. This will download many tools and packages, be patient. -6. From the Tools Menu, choose board, and scroll all the way down to 3D Printer Boards. - Select 3D Printer Boards.. -7. From the Tools Menu, choose board part number: +5. The only board listed will be "**STM32 Cores by STMicroelectronics**." Any version from 1.6.0 up is fine. Choose install. This will download many tools and packages, be patient. +6. Open the **Tools** > **Board** submenu, scroll all the way down, and select **3D Printer Boards**. +7. From the **Tools** menu, select a board part number: - If you own a M200 V1 or early run (black V2), choose **Malyan M200 V1**. - If you own a M200 V2 later run (white/black) or V3 (Pro), choose **Malyan M200 V2** (The V2 and V3 both share an STM32F070 MCU). Note that the V3 pinout is not complete (autolevel doesn't work as of this writing). 8. From the **Tools** menu, choose **USB Support** > **CDC No Generic Serial**. From 8cd2202cc48b7ba379c885db5df54d18b528a8a8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 16 Aug 2019 20:01:35 -0500 Subject: [PATCH 14/14] Update extui_malyan_lcd.cpp --- Marlin/src/lcd/extui_malyan_lcd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/extui_malyan_lcd.cpp b/Marlin/src/lcd/extui_malyan_lcd.cpp index 208c48dd4153..f03d667af676 100644 --- a/Marlin/src/lcd/extui_malyan_lcd.cpp +++ b/Marlin/src/lcd/extui_malyan_lcd.cpp @@ -420,7 +420,7 @@ namespace ExtUI { // If there was a print in progress, we need to emit the final // print status as {TQ:100}. Reset last percent done so a new print will // issue a percent of 0. - const uint8_t percent_done = (ExtUI::isPrinting()||ExtUI::isPrintingFromMediaPaused()) ? ExtUI::getProgress_percent() : last_printing_status ? 100 : 0; + const uint8_t percent_done = (ExtUI::isPrinting() || ExtUI::isPrintingFromMediaPaused()) ? ExtUI::getProgress_percent() : last_printing_status ? 100 : 0; if (percent_done != last_percent_done) { char message_buffer[16]; sprintf_P(message_buffer, PSTR("{TQ:%03i}"), percent_done);