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

Return 'false' on EEPROM connection fail #14776

Merged

Conversation

trouch
Copy link
Contributor

@trouch trouch commented Jul 30, 2019

Requirements

  • STM32F1 MCU
  • #define SD_DETECT_PIN

Description

With FYSETC Cheetah board, EEPROM file doesn't get loaded when booting.
After debugging with SWD probe, I found the first_load function sets loaded=true no matter of the access return, avoiding to properly load EEPROM file when SD got detected.

Without this fix, here is the console output:

[Connected]
start
echo:PowerUp
Marlin 2.0.0-RC0

echo: Last Updated: 2019-07-19 | Author: (trouch, config)
echo:Compiled: Jul 27 2019
echo: Free Memory: 28631  PlannerBufferBytes: 1728
echo:EEPROM version mismatch (EEPROM= Marlin=V68)
echo:Hardcoded Default Settings Loaded
Testing X connection... OK
Testing Y connection... OK
Testing Z connection... OK
Testing E connection... OK
echo:SD card ok

With that fix:

[Connected]
start
echo:PowerUp
Marlin 2.0.0-RC0

echo: Last Updated: 2019-07-19 | Author: (trouch, config)
echo:Compiled: Jul 27 2019
echo: Free Memory: 28631  PlannerBufferBytes: 1728
echo:Hardcoded Default Settings Loaded
Testing X connection... OK
Testing Y connection... OK
Testing Z connection... OK
Testing E connection... OK
echo:SD card ok
echo:V68 stored settings retrieved (614 bytes; crc 176)

IDK if that's the right approach to fix it, but it's the simpler one I found to avoid extra pre-compiler conditions and make it a general improvement.

@thinkyhead thinkyhead changed the title fix: SD EEPROM loading with SD_DETECT Return 'false' on EEPROM connection fail Jul 30, 2019
@thinkyhead
Copy link
Member

thinkyhead commented Jul 30, 2019

This will work. Ultimately it will be best for Marlin to be savvy enough to know when it can talk to EEPROM so it will not even try until that point. Initialization of TMC drivers (and a few other things) is tied up with EEPROM, so the more reliable that can be at startup, the better.

@thinkyhead thinkyhead merged commit fdbc733 into MarlinFirmware:bugfix-2.0.x Jul 30, 2019
tpruvot added a commit to tpruvot/Marlin that referenced this pull request Aug 5, 2019
Variant of the PR MarlinFirmware#14824, required since the PR MarlinFirmware#14776 (31 july)

the typo is only seen with DEBUG_EEPROM_READWRITE
@trouch trouch deleted the fix/sddetect-eepromload branch August 11, 2019 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants