makerbase-mks / MKS-Robin-Nano-V3.X

Robin nano V3 is an upgraded version of Robin Nano V2.0. The upgrade changes are quite large, including upgrading the MCU to the M4 core, and adding support for USB disk.
GNU General Public License v3.0
134 stars 63 forks source link

Compilation error - Marlin-2.1.1 - mks_robin_nano_v3_usb_flash_drive - TFT_LVGL_UI #134

Open pagabee opened 1 year ago

pagabee commented 1 year ago

It is not possible to compile the actual version of Marlin (2.1.1 aug 7) with the environment mks_robin_nano_v3_usb_flash_drive and TFT_LVGL_UI.

Marlin\src\lcd\extui\mks_ui\tft_lvgl_configuration.cpp: In function 'void tft_lvgl_init()': Marlin\src\lcd\extui\mks_ui\tft_lvgl_configuration.cpp:140:77: error: conditional expression between distinct pointer types 'CardReader::sdcard_driver_t' {aka 'DiskIODriver_SPI_SD'} and 'DiskIODriver_USBFlash*' lacks a cast 140 | card.changeMedia(IS_SD_INSERTED() ? &card.media_driver_sdcard : &card.media_driver_usbFlash); | ^~~~~ *** [.pio\build\mks_robin_nano_v3_usb_flash_drive\src\src\lcd\extui\mks_ui\tft_lvgl_configuration.cpp.o] Error 1

Marlin-2 1 1 issue

Valera-Zhan commented 1 year ago

Hi. If the question is still relevant. Required in the file "Marlin\src\lcd\extui\mks_ui\tft_lvgl_configuration.cpp" replace line 140:

    #if ENABLED(MULTI_VOLUME) && !HAS_SD_HOST_DRIVE
      SET_INPUT_PULLUP(SD_DETECT_PIN);
      map.changing media(IS_SD_INSERTED() ? and memory cards.media_driver_sdcard : &cards.media_driver_usbFlash);
    #endif

with

    #if ENABLED(MULTI_VOLUME) && !HAS_SD_HOST_DRIVE
      SET_INPUT_PULLUP(SD_DETECT_PIN);
      if (read (SD_DETECT_PIN) == Low) in maps.changeMedia(&maps.media_driver_sdcard);
      else card.change the media(&card.media_driver_usb Flash);
    #endif
pagabee commented 1 year ago

Thanks for your code! I will try it.

menezesfreitas commented 1 year ago

Também estou com o mesmo problema

Captura de Tela 2023-05-09 às 23 21 12
simpit303 commented 3 months ago

Dear MKS. USB problem is still existing on Marlin bugfixed 2.1.x You can not compile file as mks_robin_nano_v3_usb_flash_drive_msc with USB_FLASH_DRIVE_SUPPORT defined. When I turn it off compile is going perfect. Please just help because I would like to use USB Stick and SD Card and be able to connect Pronterface or Cura by USB cable.