Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Fysetc Mini12864 Panel freezes with 2.0.9.2 and above builds on Artillery Hornet #23244

Closed
Sonicboom247 opened this issue Dec 1, 2021 · 15 comments

Comments

@Sonicboom247
Copy link

Sonicboom247 commented Dec 1, 2021

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

Yes, and the problem still exists.

Bug Description

Compiling firmware for 2.0.9.2 and up to the absolute latest bugfix, the Fysetc mini 12864 v1 TFT (STM32F401RCT6) freezes at the Marlin logo and upon restart of printer the screen stays blank., flashing back to 2.0.9.1 corrects issue.

Bug Timeline

2.0.9.2

Expected behavior

printer display to work on restart

Actual behavior

display shows the marlin logo and version and stays there.

Steps to Reproduce

compile firmware for Artillery Hornet which is comprised of the Artillery Ruby board with the Fysetc mini 12864 v1 TFT

Version of Marlin Firmware

2.0.9.3 and 2.0.9.2

Printer model

Artillery Hornet

Electronics

Stock Artillery Ruby board and display

Add-ons

none

Bed Leveling

MBL Manual Bed Leveling

Your Slicer

Cura

Host Software

Cura

Additional information & file uploads

I did find this in Fysetcs article https://wiki.fysetc.com/Mini12864_Panel/ but do not see ultralcd_impl_DOGM.h

Step4. add the codes in ultralcd_impl_DOGM.h.
You need to add a shorts codes to ultralcd_impl_DOGM.h, otherwise your screen may not have text displayed, or it may not be clear. Add "u8g.setContrast(255);" in the "static void lcd_implementation_init()" function:

@Sonicboom247 Sonicboom247 changed the title [BUG] Fysetc Mini12864 Panel not working with 2.0.9.2 and above builds [BUG] Fysetc Mini12864 Panel freezes with 2.0.9.2 and above builds on Artillery Hornet Dec 3, 2021
@HuguesDug
Copy link

Buttons are not working as well : anet A8 with latest bugfix

@Christophegriffo
Copy link

Regarde dans / inc/ conditionals_post.h/ #elif enabeld(fysetec_mini_12864)
Met 255 ~~ligne 376, 377

@Sonicboom247
Copy link
Author

@Christophegriffo is that what was removed? I will test this shortly as i am now getting error: unknown board: Artillery_Ruby

@ellensp
Copy link
Contributor

ellensp commented Dec 5, 2021

@Sonicboom247
In platformio.ini
default_envs = Artillery_Ruby
In Configuration.h
#define MOTHERBOARD BOARD_ARTILLERY_RUBY

@Sonicboom247
Copy link
Author

@ellensp
Thank you for confirming, that is exactly how i have had it since 2.0.9.1
platformio
board

@Sonicboom247
Copy link
Author

@Christophegriffo , thank you, changed to 255, hope to test once i can build
fysetc

@Sonicboom247
Copy link
Author

also just compared, the latest boards.h and
#define BOARD_ARTILLERY_RUBY 4237 // Artillery Ruby (STM32F401RCT6) is no longer listed.

@ellensp
Copy link
Contributor

ellensp commented Dec 6, 2021

@Sonicboom247
Played with a few things to work out what gives that exact error

In ini/stm32f4.ini is

[env:Artillery_Ruby]
platform          = ${common_stm32.platform}
extends           = common_stm32
board             = marlin_Artillery_Ruby

etc

The board is set incorrectly here. you seem to have
board = Artillery_Ruby

@Sonicboom247
Copy link
Author

Sonicboom247 commented Dec 6, 2021

@ellensp you ROCK! that was it! not sure how that was changed but it is now building!, thanks so much for going the extra mile, was able to flash but TFT still stays stuck at Marlin logo and after reset i don't even get the Marlin logo even after the change @Christophegriffo mentioned for Conditionals_post.h

@Sonicboom247
Copy link
Author

went back to 2.0.9.1 in the meantime

@Sonicboom247
Copy link
Author

@ellensp can you take a quick gander at step 4 of this link and let me know if this could be the issue? https://wiki.fysetc.com/Mini12864_Panel/ not sure if ultralcd_impl_DOGM.h was removed from Marlin or merged with another file.

Thanks

@Sonicboom247
Copy link
Author

Sonicboom247 commented Dec 20, 2021

just tested again after changing inc/Conditionals_post.h to 255 from 120 but still display freezes at marlin logo and after reset it stays blank

#elif ENABLED(FYSETC_MINI_12864)
  #define _LCD_CONTRAST_INIT 255

in looking through all the changes from 2.0.9.1 to current, i do not see any mention of the V1, seems like everything is 1.2 and above. but no idea if that makes a difference other than LED functionality.

Conditionals_LCD.h

#elif ANY(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1, FYSETC_GENERIC_12864_1_1)

  #define FYSETC_MINI_12864
  #define DOGLCD
  #define IS_ULTIPANEL 1
  #define LED_COLORS_REDUCE_GREEN
  #if ENABLED(PSU_CONTROL) && EITHER(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1)
    #define LED_BACKLIGHT_TIMEOUT 10000
  #endif

some change in bugfix2.0

#include <U8glib-HAL.h>

#if ENABLED(FYSETC_MINI_12864)
  #define SPISEND_SW_DUE u8g_spiSend_sw_DUE_mode_3

static void u8g_sw_spi_shift_out(uint8_t dataPin, uint8_t clockPin, uint8_t val) {
  #if EITHER(FYSETC_MINI_12864, MKS_MINI_12864)
    swSpiTransfer_mode_3(val, SPI_speed, clockPin, -1, dataPin);
  #else
    swSpiTransfer_mode_0(val, SPI_speed, clockPin, -1, dataPin);
  #endif

case U8G_COM_MSG_CHIP_SELECT:
      #if EITHER(FYSETC_MINI_12864, MKS_MINI_12864)  // LCD SPI is running mode 3 while SD card is running mode 0
        if (arg_val) {                               //   SCK idle state needs to be set to the proper idle state before
                                                     //   the next chip select goes active
          u8g_SetPILevel(u8g, U8G_PI_SCK, 1);        // Set SCK to mode 3 idle state before CS goes active
          u8g_SetPILevel(u8g, U8G_PI_CS, LOW);
        }
        else {
          u8g_SetPILevel(u8g, U8G_PI_CS, HIGH);
          u8g_SetPILevel(u8g, U8G_PI_SCK, 0);  // Set SCK to mode 0 idle state after CS goes inactive
        }
      #else
        u8g_SetPILevel(u8g, U8G_PI_CS, !arg_val);
      #endif
      break;

    case U8G_COM_MSG_WRITE_BYTE:
      u8g_sw_spi_shift_out(u8g->pin_list[U8G_PI_MOSI], u8g->pin_list[U8G_PI_SCK], arg_val);
      break;

    case U8G_COM_MSG_WRITE_SEQ: {
        uint8_t *ptr = (uint8_t *)arg_ptr;
        while (arg_val > 0) {
          u8g_sw_spi_shift_out(u8g->pin_list[U8G_PI_MOSI], u8g->pin_list[U8G_PI_SCK], *ptr++);
          arg_val--;
        }
      }
      break;

      case U8G_COM_MSG_WRITE_SEQ_P: {
        uint8_t *ptr = (uint8_t *)arg_ptr;
        while (arg_val > 0) {
          u8g_sw_spi_shift_out(u8g->pin_list[U8G_PI_MOSI], u8g->pin_list[U8G_PI_SCK], u8g_pgm_read(ptr));
          ptr++;
          arg_val--;
        }
      }
      break;

    case U8G_COM_MSG_ADDRESS:                     /* define cmd (arg_val = 0) or data mode (arg_val = 1) */
      u8g_SetPILevel(u8g, U8G_PI_A0, arg_val);
      break;
  }
  return 1;
}

#ifdef __cplusplus
  }
#endif

#elif NONE(TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI, HAS_MARLINUI_HD44780) && HAS_MARLINUI_U8GLIB

  #include <U8glib-HAL.h>
  uint8_t u8g_com_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) {return 0;}

#endif // HAS_MARLINUI_U8GLIB && !IS_U8GLIB_ST7920

@thinkyhead
Copy link
Member

not sure if ultralcd_impl_DOGM.h was removed from Marlin

ultralcd_impl_DOGM.h => marlinui_DOGM.h

@thisiskeithb
Copy link
Member

This will be fixed in #23446

@github-actions
Copy link

github-actions bot commented Mar 5, 2022

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.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants