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] Marlin doesn't work on LERDGE-K on Marlin 2.0.9.3 and up. Display doesn't work on LERDGE-K on Marlin 2.0.8.2-2.0.9.2 #24355

Closed
1 task done
odbee opened this issue Jun 14, 2022 · 36 comments

Comments

@odbee
Copy link

odbee commented Jun 14, 2022

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

Yes, and the problem still exists.

Bug Description

i have tried getting marlin to work on my LERDGE-K board with no success so far.
Building works in most versions so far.

With versions 2.0.8.2 to 2.0.9.2 i get a reading using the serial port communcation, so marlin is successfully installed, but the display doesn't work.

With versions 2.0.9.3 and upwards the board doesn't work at all after flashing the firmware no matter what I do.

Bug Timeline

No response

Expected behavior

No response

Actual behavior

No response

Steps to Reproduce

set Configuration.h to:

#define MOTHERBOARD BOARD_LERDGE_K
#define SERIAL_PORT 1
#define TFT_GENERIC
#define TFT_INTERFACE_FSMC
#define TFT_RES_480x320
#define TFT_COLOR_UI

as well as

#define TFT_DRIVER AUTO
or
#define TFT_DRIVER ST7796

Version of Marlin Firmware

all versions

Printer model

No response

Electronics

No response

Add-ons

No response

Bed Leveling

No response

Your Slicer

No response

Host Software

No response

Don't forget to include

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

Additional information & file uploads

Config.zip

@Bob-the-Kuhn
Copy link
Contributor

Confirmed: (mostly)
2.0.8.1 - LCD and USB work
2.0.8.2 - LCD and USB work - strange, version is 2.0.8.1 in configuration.h, 2.0.8.2 in powerup text on USB
2.0.9.0 - LCD and USB work
2.0.9.1 - LCD and USB work
2.0.9.2 - LCD and USB work
2.0.9.3 - doesn't proceed beyond firmware update OK! boot screen - no LCD, no USB after power cycle
bugfix_2.1.x - doesn't proceed beyond firmware update OK! boot screen - no LCD, no USB after power cycle

@Bob-the-Kuhn
Copy link
Contributor

I see only one 2.0.9.3 commit that mentions Lerdge.

Delete after encrypt. Lerdge encrypt only once (b4904cc)

@odbee
Copy link
Author

odbee commented Jun 19, 2022

Confirmed: (mostly) 2.0.8.1 - LCD and USB work 2.0.8.2 - LCD and USB work - strange, version is 2.0.8.1 in configuration.h, 2.0.8.2 in powerup text on USB 2.0.9.0 - LCD and USB work 2.0.9.1 - LCD and USB work 2.0.9.2 - LCD and USB work 2.0.9.3 - doesn't proceed beyond firmware update OK! boot screen - no LCD, no USB after power cycle bugfix_2.1.x - doesn't proceed beyond firmware update OK! boot screen - no LCD, no USB after power cycle

could i get your config file to try out the LCD on older versions? or did you use the one i uploaded?

@Bob-the-Kuhn
Copy link
Contributor

I just made the changes listed in this post.

I did set TFT_DRIVER to ST7796 in all cases except with 2.0.9.2 I tried both.

@odbee
Copy link
Author

odbee commented Jun 19, 2022

I just made the changes listed in this post.

I did set TFT_DRIVER to ST7796 in all cases except with 2.0.9.2 I tried both.

this is very weird. for me it doesn't recognize the display at all.
is it possible for you to send me the whole "Lerdge_K_system" folder you upload to the lerdge board? also, which Version of the display do you have? I have V1.0.2

@Bob-the-Kuhn
Copy link
Contributor

Which version?

Also, I use VSCode to compile Marlin.

@Bob-the-Kuhn
Copy link
Contributor

Here's 2.0.9.2 .

If you want you can post your config files & I'll compile & post the bin file.

@odbee
Copy link
Author

odbee commented Jun 19, 2022

Which version?

Also, I use VSCode to compile Marlin.

i meant the compiled folder you upload to the lerdge board. The "Lerdge_K_system" folder

@Bob-the-Kuhn
Copy link
Contributor

It's in there.

@Bob-the-Kuhn
Copy link
Contributor

Lerdge_K_system.zip

@Bob-the-Kuhn
Copy link
Contributor

Bob-the-Kuhn commented Jun 19, 2022

My LCD has the V1.04 bootloader on it.

V1.0.2 is on the LCD's silkscreen.

V1.0.1 is on the LerdgeK's silkscreen.

@rhapsodyv
Copy link
Member

Check if this make any difference for you: #24353 (comment)

it seems some of the casts are making the compiler behave crazy in some overload optimizations.

@Bob-the-Kuhn
Copy link
Contributor

No luck. Bugfix_2.1.x still hangs after loading the new firmware and is dead after a power cycle.

@thisiskeithb
Copy link
Member

Sounds like the same issues we’re seeing on BX builds.

@odbee
Copy link
Author

odbee commented Jun 20, 2022

My LCD has the V1.04 bootloader on it.

V1.0.2 is on the LCD's silkscreen.

V1.0.1 is on the LerdgeK's silkscreen.

My setup is the same except I have the lerdge V1.0.0.
I have uploaded your firmware with no success on the LCD even though I also have the V1.0.2 LCD.

EDIT:
weirdly enough, after flashing it for the 20th time it worked (on 2.0.9.2)

@rhapsodyv
Copy link
Member

did you try disable SDSUPPORT?

@Bob-the-Kuhn
Copy link
Contributor

Yes, SDSUPPORT is disabled.

@rhapsodyv
Copy link
Member

I have a ledge kit here. I will try use git bisect to find the bad commit.

@Bob-the-Kuhn
Copy link
Contributor

I just tried the #define FTOP(S) (reinterpret_cast<const char* const>(S)) change on 2.0.9.3 and it also hangs after succesful firmware update.

@Bob-the-Kuhn
Copy link
Contributor

@rhapsodyv - if you can get me started I can do the git bisect.

Perhaps these are the steps:

  1. download first failing ZIP (2.0.9.3)
  2. pull up a command window
  3. $ git bisect start
  4. $ git bisect bad
  5. $ git bisect good v2.0.9.2

@ellensp
Copy link
Contributor

ellensp commented Jun 20, 2022

you must use git, needs the full commit history

git clone https://github.com/MarlinFirmware/Marlin.git
git bisect start
git bisect good {commit where it still works}
git bisect bad {commit where it is broken}

git will then select a commit half way between these two commits,
You need to add configs and test this version and confirm is it good or bad
after testing revert these changes (ready for next iteration) and tell git the result with one of these

git bisect good or git bisect bad

git now repeats using a new commit mid way between the new good and bad commits

This is repeated a bunch till it finds the one commit that broke it.

@Bob-the-Kuhn
Copy link
Contributor

Bob-the-Kuhn commented Jun 20, 2022

Stuck at specifying the good and bad commits. a185ce2, 2.0.9.2, and V2.0.9.2 all come back as:

fatal: Needed a single revision
Bad rev input: 2.0.9.2

@rhapsodyv
Copy link
Member

Hint: You can the the commit of version number checking the history of Version.h file:

https://github.com/MarlinFirmware/Marlin/commits/2.1.x/Marlin/Version.h

here you can get the commit for each release, for example.

@Bob-the-Kuhn
Copy link
Contributor

Bob-the-Kuhn commented Jun 20, 2022

I've tried the following - all with the above results.

- git bisect good https://github.com/MarlinFirmware/Marlin/commit/a185ce22cf6e4fb15250815c5c39318606a7e65a
- git bisect good a185ce22cf6e4fb15250815c5c39318606a7e65a
- git bisect good a185ce2
- git bisect good 2.0.9.2
- git bisect good V2.0.9.2

Finally got commit numbers that were accepted by doing a git log.

I can do one bisect then can't get past the "commit or stash" changes error message.

Time for someone that knows what they're doing to jump in.

@Bob-the-Kuhn
Copy link
Contributor

Finally stumbled through all the git bisect steps.

The offending commit is:

commit 6cf6c4cd852bd09c509407057e81e37e36bad52e
Author: Scott Lahteine <[email protected]>
Date:   Tue Oct 19 02:56:44 2021 -0500

    🔨 Delete after encrypt. Lerdge encrypt only once

Interesting - same label as mentioned previously but different commit number.

@rhapsodyv
Copy link
Member

The only meaningful change I see was the removed the
board_build.encrypt = firmware.bin
try add it back and see if it works.
The addition of the script might be the issue too.

@Bob-the-Kuhn
Copy link
Contributor

I was able to get 2.0.9.3 to build & run by just backing out the marlin.py changes.

Doing the same change to bugfix_2.1.x did not work. Usual hang at "firmware update OK" with no USB coms.

What I did on 2.0.9.3:

  1. Backed out stm32f4.ini changes - hang & no com
  2. Backed out marlin.py changes - boots & runs
  3. Restored stm32f4.ini changes - boots & runs

What I did on bugfix_2.1.x:

  1. Backed out marlin.py changes - hang & no com
  2. Tried the Marduino.h FTOP(S) change - hang & no com

Someone needs to verify marlin.py changes is all that was needed on 2.0.9.3.

@rhapsodyv
Copy link
Member

Changing stm34f4.ini + marlin.py didn’t work for 2.1?

@Bob-the-Kuhn
Copy link
Contributor

bugfix_2.1.x works when both are backed out!

@rhapsodyv
Copy link
Member

Only changing stm32f4.ini isn’t enough?

@Bob-the-Kuhn
Copy link
Contributor

Both are neeeded.

I've tried with & without the marlin.py changes several times. Reverting marlin.py is required for it to get past the "firmware update OK" screen.

With the old INI and the new PY, VSCode gives the following:

encrypt([".pio\build\LERDGEK\firmware.bin"], [".pio\build\LERDGEK\firmware.elf"])      
encrypt([".pio\build\LERDGEK\firmware.bin"], [".pio\build\LERDGEK\firmware.elf"])      
*** [.pio\build\LERDGEK\firmware.bin] .pio\build\LERDGEK\firmware.bin: No such file or 
directory
Encrypting .pio\build\LERDGEK\firmware.bin to Lerdge_K_firmware_force.bin

With the old INI and the new PY, a new Lerdge_K_firmware_force.bin is created. The Lerdge firmware loader likes it but it hangs there. Maybe the Lerdge_K_firmware_force.bin file isn't getting encrypted and the Ledge firmware loader is too dumb to notice. The first 320 bytes of the new image is not encrypted so maybe everything the bootloader needs is in the unencrypted section.

I don't see why the old version of the marlin.py program is needed. Seems like the old and new do the same thing.

@Bob-the-Kuhn
Copy link
Contributor

@odbee - does this fix your problems?

@thisiskeithb
Copy link
Member

#24391 has been merged.

@Bob-the-Kuhn
Copy link
Contributor

Just tested the latest bugfix-2.1.x. Compiles with no errors and runs on my Lerdge K.

@odbee
Copy link
Author

odbee commented Jul 3, 2022

@odbee - does this fix your problems?

hey, sorry for the late reply, it seems like the whole issue occured because i fried my display. the new version works now!. ill be running my printer via octoprint for now, thanks alot!!

@github-actions
Copy link

github-actions bot commented Sep 1, 2022

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 Sep 1, 2022
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