MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.23k stars 19.22k forks source link

[BUG] Binary files not listed with M20 without E3V2 ProUI #24332

Open The-EG opened 2 years ago

The-EG commented 2 years ago

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

Yes, and the problem still exists.

Bug Description

Sending an M20 or M20 F (with CUSTOM_FIRMWARE_UPLOAD enabled) does not result in *.bin files being listed.

Bug Timeline

Most likely #23878

Expected behavior

*.bin files to be listed when appropriate from M20 and M20 F

Actual behavior

No *.bin files listed.

Steps to Reproduce

  1. Put a firmware *.bin file on an SD card.
  2. Put sdcard into printer
  3. Run M20 F
  4. Observe bin file not listed

Version of Marlin Firmware

Bugfix-2.1.x 2022-06-11

Printer model

Ender 3 Pro

Electronics

v4.2.7 board, CR10_STOCKDISPLAY

Add-ons

No response

Bed Leveling

UBL Bilinear mesh

Your Slicer

Other (explain below)

Host Software

OctoPrint

Don't forget to include

Additional information & file uploads

ender3pro.zip

Looking at cardreader.h, fileisBinary and setBinFlag are no-ops unless DO_LIST_BIN_FILES is defined.

  static bool fileIsBinary() { return TERN0(DO_LIST_BIN_FILES, flag.filenameIsBin); }
  static void setBinFlag(const bool bin) { TERN(DO_LIST_BIN_FILES, flag.filenameIsBin = bin, UNUSED(bin)); }

DO_LIST_BIN_FILES is defined in Conditionals_LCD.h:

#if ENABLED(DWIN_LCD_PROUI)
  #define DO_LIST_BIN_FILES 1
#endif

So, fileIsBinary always returns 0. :-1:

The-EG commented 2 years ago

As a quick test: chucking a #define DO_LIST_BIN_FILES 1 at the end of Configuration_adv.h causes the bin files to be listed properly.

Also, this causes them to be listed in the Print From Media LCD menu. I'm not sure if that's intended or not.