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] LASER_POWER_INLINE corrupts EEPROM, M504 crashes Marlin #17947

Closed
kaixxx opened this issue May 10, 2020 · 5 comments
Closed

[BUG] LASER_POWER_INLINE corrupts EEPROM, M504 crashes Marlin #17947

kaixxx opened this issue May 10, 2020 · 5 comments

Comments

@kaixxx
Copy link

kaixxx commented May 10, 2020

Bug Description

I wanted to try out the recent laser improvements in Marlin 2.0 bugfix and compiled it with LASER_FEATURE and LASER_POWER_INLINE enabled. It worked at first, but after I saved some changes to the EEEPROM and restarted, I ran into a boot loop. The only way out was to flash a version without the laser features and rewrite the EEPROM.
I could narrow it down to LASER_POWER_INLINE: if this is enabled, a combination of M500 and M504 crashes Marlin.
I think this might have to do with the new laser settings that are introduced into planner_settings_t (planner.h: 235). Maybe a problem with padding? I have no idea.

My Configurations

BTT SKR 1.4 Board, LPC1768, TMC2209
I am using FLASH_EEPROM_EMULATION, as recommended. I also tried SDCARD_EEPROM_EMULATION, this gave me some kind of size error when loading the stored values.

Configuration.zip

Steps to Reproduce

  1. Compile latest Marlin 2.0 bugfix with LASER_FEATURE and LASER_POWER_INLINE enabled.
  2. Save EEPROM with M500 and verify it with M504

Expected behavior: Message: "EEPROM is ok"
Actual behavior: Crash and boot loop

Additional Information

none

@naka123
Copy link

naka123 commented May 11, 2020

I had same error on SKR1.3 board (same LPC1768 MCU)

There is my temporary hack to fix this error - https://gist.github.com/naka123/8585872be2d4646fbdd36349b239e8f4

With this fix, both FLASH_EEPROM_EMULATION and SDCARD_EEPROM_EMULATION working ok

@kaixxx
Copy link
Author

kaixxx commented May 11, 2020

Thank you, naka123! I have tested your hack, it works!
Why are you not turning this into a pull request? The main problem seems to be that planner.settings.laser is not read properly. This is a major issue that makes the new laser functions pretty much unusable.

@kaixxx kaixxx closed this as completed May 12, 2020
@thinkyhead
Copy link
Member

Now patched in bugfix by moving the laser data out of planner.settings.

@kaixxx
Copy link
Author

kaixxx commented May 14, 2020

nice, will test asap.

@github-actions
Copy link

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 Jul 13, 2020
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

3 participants