makerbase-mks / MKS-OWL

MKS OWL motherboard is FDM 3d printing mainboard using an NXP LPC5528 32-bit Cortex-M33 MCU, it intergrated 5-axis plug-in stepper driver interfaces, supports MKS TS35 and MKS MINI12864 V3 , supports USB flash storage, and runs marlin v2.x firmware.
GNU General Public License v3.0
6 stars 3 forks source link

This marlin build breaks paths in PlatformIO #5

Open 3DSmitty opened 1 year ago

3DSmitty commented 1 year ago

After building this board in VSCode / PlatformIO I an unable to build any other board / any version of marlin. Every platform can not be found. I had to uninstall everything and re-install to be able to build marlin again. This firmware is very disappointing full of many bugs. I am going back to SGEN L until this firmware can be fixed.

thisiskeithb commented 1 year ago

A standard implementation is being worked on:

Lack of watchdog support from MKS is a bit concerning since that requires you to disable this key safety feature for this board/LPC5528 HAL.

ellensp commented 1 year ago

Broken src/HAL/platform.h

#elif 1
  #define HAL_PATH(PATH, NAME) XSTR(PATH/LPC5528/NAME)
  #ifndef HAS_LPC55XX
    #define HAS_LPC55XX   // set define with LPC5528 and LPC5516 for MKS
  #endif

everything after here is ignored..

This is a nasty thing to do...

3DSmitty commented 1 year ago

@thisiskeithb Hi Keith! Very Happy to hear that! The HAL code seems very different compared to the other NXP chips...

3DSmitty commented 1 year ago

@ellensp Yes I noticed that....ugh.

They also hacked this in MKS_OWL/Marlin/src/MarlinCore.cpp

  inline void finishSDPrinting() {
    if (marlin_state == MF_SD_COMPLETE) {
      if (once_flag == 0) {
        stop_print_time();

        flash_preview_begin = false;
        default_preview_flg = false;
        clear_cur_ui();
        lv_draw_dialog(DIALOG_TYPE_FINISH_PRINT);

        once_flag = true;

        #if HAS_SUICIDE
          if (gCfgItems.finish_power_off) {
            gcode.process_subcommands_now(F("M1001"));
            queue.inject(F("M81"));
            marlin_state = MF_RUNNING;
          }
        #endif
      }
    }

    if (queue.enqueue_one(F("M1001"))) {  // Keep trying until it gets queued
      marlin_state = MF_RUNNING;          // Signal to stop trying
      TERN_(PASSWORD_AFTER_SD_PRINT_END, password.lock_machine());
      TERN_(DGUS_LCD_UI_MKS, ScreenHandler.SDPrintingFinished());
    }
  }

Which breaks if you try to define a different type of LCD screen.

The original code looks like:

  inline void finishSDPrinting() {
    if (queue.enqueue_one(F("M1001"))) {  // Keep trying until it gets queued
      marlin_state = MF_RUNNING;          // Signal to stop trying
      TERN_(PASSWORD_AFTER_SD_PRINT_END, password.lock_machine());
      TERN_(DGUS_LCD_UI_MKS, ScreenHandler.SDPrintingFinished());
    }
  }