From b8f92fdfa9ef396617c4689a2deec3ed72a5d6f4 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Thu, 18 Oct 2018 02:44:16 +0200 Subject: [PATCH 1/2] MK2.5 printers set mmu to stealth mode (using Mx code), required mmu2 buildnr can be different for MK2.5 and MK3 printers --- Firmware/Configuration.h | 4 +-- Firmware/mmu.cpp | 27 ++++++++++++++++--- .../variants/1_75mm_MK25-RAMBo10a-E3Dv6full.h | 1 + .../variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h | 1 + .../variants/1_75mm_MK3-EINSy10a-E3Dv6full.h | 1 + 5 files changed, 29 insertions(+), 5 deletions(-) diff --git a/Firmware/Configuration.h b/Firmware/Configuration.h index 3549ba5f..65c67b1a 100644 --- a/Firmware/Configuration.h +++ b/Firmware/Configuration.h @@ -7,8 +7,8 @@ #define STR(x) STR_HELPER(x) // Firmware version -#define FW_VERSION "3.4.1" -#define FW_COMMIT_NR 1356 +#define FW_VERSION "3.4.2" +#define FW_COMMIT_NR 1358 // FW_VERSION_UNKNOWN means this is an unofficial build. // The firmware should only be checked into github with this symbol. #define FW_DEV_VERSION FW_VERSION_UNKNOWN diff --git a/Firmware/mmu.cpp b/Firmware/mmu.cpp index 3e71737a..a7d8d8bc 100644 --- a/Firmware/mmu.cpp +++ b/Firmware/mmu.cpp @@ -11,6 +11,7 @@ #include "cardreader.h" #include "ultralcd.h" #include "sound.h" +#include "printers.h" #include #define CHECK_FINDA ((IS_SD_PRINTING || is_usb_printing) && (mcode_in_progress != 600) && !saved_printing && e_active()) @@ -23,8 +24,6 @@ #define MMU_HWRESET #define MMU_RST_PIN 76 -#define MMU_REQUIRED_FW_BUILDNR 83 - bool mmu_enabled = false; bool mmu_ready = false; @@ -148,13 +147,35 @@ void mmu_loop(void) bool version_valid = mmu_check_version(); if (!version_valid) mmu_show_warning(); else puts_P(PSTR("MMU version valid")); + + if ((PRINTER_TYPE == PRINTER_MK3) || (PRINTER_TYPE == PRINTER_MK3_SNMM)) + { +#ifdef MMU_DEBUG + puts_P(PSTR("MMU <= 'P0'")); +#endif //MMU_DEBUG + mmu_puts_P(PSTR("P0\n")); //send 'read finda' request + mmu_state = -4; + } + else + { +#ifdef MMU_DEBUG + puts_P(PSTR("MMU <= 'M1'")); +#endif //MMU_DEBUG + mmu_puts_P(PSTR("M1\n")); //set mmu mode to stealth + mmu_state = -5; + } + + } + return; + case -5: + if (mmu_rx_ok() > 0) + { #ifdef MMU_DEBUG puts_P(PSTR("MMU <= 'P0'")); #endif //MMU_DEBUG mmu_puts_P(PSTR("P0\n")); //send 'read finda' request mmu_state = -4; } - return; case -4: if (mmu_rx_ok() > 0) { diff --git a/Firmware/variants/1_75mm_MK25-RAMBo10a-E3Dv6full.h b/Firmware/variants/1_75mm_MK25-RAMBo10a-E3Dv6full.h index 626c64e8..94fc8e96 100644 --- a/Firmware/variants/1_75mm_MK25-RAMBo10a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK25-RAMBo10a-E3Dv6full.h @@ -481,6 +481,7 @@ //#define SUPPORT_VERBOSITY +#define MMU_REQUIRED_FW_BUILDNR 132 //#define MMU_DEBUG //print communication between MMU2 and printer on serial #endif //__CONFIGURATION_PRUSA_H diff --git a/Firmware/variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h b/Firmware/variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h index cb13e8ad..f9d761a4 100644 --- a/Firmware/variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h @@ -482,6 +482,7 @@ //#define SUPPORT_VERBOSITY +#define MMU_REQUIRED_FW_BUILDNR 132 //#define MMU_DEBUG //print communication between MMU2 and printer on serial #endif //__CONFIGURATION_PRUSA_H diff --git a/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h b/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h index ea1951f4..c0f38a1a 100644 --- a/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h @@ -613,6 +613,7 @@ //#define SUPPORT_VERBOSITY +#define MMU_REQUIRED_FW_BUILDNR 83 //#define MMU_DEBUG //print communication between MMU2 and printer on serial #endif //__CONFIGURATION_PRUSA_H From bc247ca02c0c4557be8afeeb1b21c55290c9d14e Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Fri, 19 Oct 2018 17:54:48 +0200 Subject: [PATCH 2/2] MK2.5 sw reset at setup function --- Firmware/Configuration.h | 2 +- Firmware/Marlin_main.cpp | 3 +++ Firmware/mmu.cpp | 5 ++++- Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h | 1 + 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Firmware/Configuration.h b/Firmware/Configuration.h index 65c67b1a..3328352d 100644 --- a/Firmware/Configuration.h +++ b/Firmware/Configuration.h @@ -8,7 +8,7 @@ // Firmware version #define FW_VERSION "3.4.2" -#define FW_COMMIT_NR 1358 +#define FW_COMMIT_NR 1360 // FW_VERSION_UNKNOWN means this is an unofficial build. // The firmware should only be checked into github with this symbol. #define FW_DEV_VERSION FW_VERSION_UNKNOWN diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 80f21058..eeb73105 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -1180,6 +1180,9 @@ void setup() } MYSERIAL.begin(BAUDRATE); fdev_setup_stream(uartout, uart_putchar, NULL, _FDEV_SETUP_WRITE); //setup uart out stream +#ifndef W25X20CL + SERIAL_PROTOCOLLNPGM("start"); +#endif //W25X20CL stdout = uartout; SERIAL_ECHO_START; printf_P(PSTR(" " FW_VERSION_FULL "\n")); diff --git a/Firmware/mmu.cpp b/Firmware/mmu.cpp index a7d8d8bc..50748eab 100644 --- a/Firmware/mmu.cpp +++ b/Firmware/mmu.cpp @@ -21,8 +21,9 @@ #define MMU_CMD_TIMEOUT 300000ul //5min timeout for mmu commands (except P0) #define MMU_P0_TIMEOUT 3000ul //timeout for P0 command: 3seconds -#define MMU_HWRESET +#ifdef MMU_HWRESET #define MMU_RST_PIN 76 +#endif //MMU_HWRESET bool mmu_enabled = false; @@ -92,8 +93,10 @@ int8_t mmu_rx_start(void) //initialize mmu2 unit - first part - should be done at begining of startup process void mmu_init(void) { +#ifdef MMU_HWRESET digitalWrite(MMU_RST_PIN, HIGH); pinMode(MMU_RST_PIN, OUTPUT); //setup reset pin +#endif //MMU_HWRESET uart2_init(); //init uart2 _delay_ms(10); //wait 10ms for sure mmu_reset(); //reset mmu (HW or SW), do not wait for response diff --git a/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h b/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h index c0f38a1a..443f7e07 100644 --- a/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h @@ -614,6 +614,7 @@ //#define SUPPORT_VERBOSITY #define MMU_REQUIRED_FW_BUILDNR 83 +#define MMU_HWRESET //#define MMU_DEBUG //print communication between MMU2 and printer on serial #endif //__CONFIGURATION_PRUSA_H