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] not compiling with SDSORT_DYNAMIC_RAM enabled #24772

Closed
1 task done
Hasi123 opened this issue Sep 17, 2022 · 6 comments
Closed
1 task done

[BUG] not compiling with SDSORT_DYNAMIC_RAM enabled #24772

Hasi123 opened this issue Sep 17, 2022 · 6 comments

Comments

@Hasi123
Copy link

Hasi123 commented Sep 17, 2022

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

Yes, and the problem still exists.

Bug Description

If you enable SDSORT_DYNAMIC_RAM with the latest Marlin, I get this error on compilation:

C:\Users\David\Documents\GitHub\Marlin\Marlin\src\sd\cardreader.cpp: In static member function 'static void CardReader::presort()': C:\Users\David\Documents\GitHub\Marlin\Marlin\src\sd\cardreader.cpp:1062:72: error: incompatible types in assignment of 'char*' to 'char [66]' #define SET_SORTNAME(I) (sortnames[I] = strdup(longest_filename())) ^ C:\Users\David\Documents\GitHub\Marlin\Marlin\src\sd\cardreader.cpp:1155:13: note: in expansion of macro 'SET_SORTNAME' SET_SORTNAME(i); ^~~~~~~~~~~~ exit status 1 Error compiling for board Sanguino.

Obviously you have to disable SDCARD_RATHERRECENTFIRST and enable SDCARD_SORT_ALPHA and SDSORT_USES_RAM...

Expected behavior

No compiler errors.

Actual behavior

Compiler error.

Steps to Reproduce

Compile FW with Arduino IDE

Version of Marlin Firmware

2.1.1

Printer model

Custom i3 style

Electronics

Melzi

Don't forget to include

  • A ZIP file containing your Configuration.h and Configuration_adv.h.

Additional information & file uploads

Configuration.zip

@tjeerdvandijk
Copy link

I have this same bug aswell

@scrith
Copy link

scrith commented Jan 30, 2023

I am experiencing this same issue with the release build of 2.1.2 as well.

@Bob-the-Kuhn
Copy link
Contributor

SDSORT_DYNAMIC_RAM requires SDSORT_CACHE_NAMES to be set to true. The default configuration_adv.h has SDSORT_CACHE_NAMES set to false.

I'll add a sanity check to warn users of this requirement.

@Bob-the-Kuhn
Copy link
Contributor

This issue is being closed because it is addressed by PR #25318

@scrith
Copy link

scrith commented Jan 30, 2023

SDSORT_DYNAMIC_RAM requires SDSORT_CACHE_NAMES to be set to true. The default configuration_adv.h has SDSORT_CACHE_NAMES set to false.

I'll add a sanity check to warn users of this requirement.

How can the two lines labelled "most expensive" and "least expensive" both be required simultaneously?
Also the compiler error says that SDSORT_USES_RAM is required.
Are all 3 options required to be set to true?
How does one reduce the expense of SD sorting if the most expensive option is required to be enabled?

@github-actions
Copy link

github-actions bot commented Apr 1, 2023

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 Apr 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants