-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
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
Fix STM32F1 SPI device init, MKS_LCD12864 #19271
Fix STM32F1 SPI device init, MKS_LCD12864 #19271
Conversation
To add to this, it's only an issue if you boot with an SD card inserted and it takes 30 seconds (vs. booting without one which only takes ~3 seconds). After Marlin is done booting, inserting an SD card works fine and I get a |
To save you from reading all the text below, this is likely a board/bootloader issue causing a 30 second delay when cold booting with an SD card inserted and not a Marlin issue. I tried some additional LCD controllers on the Robin E3 board and still get the 30 second lockup on boot with an SD card inserted: * Note: Onboard SD card pins are shared with the LCD controller pins on this board Working with @rhapsodyv on Discord, it's likely the board/bootloader since I don't get serial output from Marlin until right after that 30 seconds and Marlin appears to boot normally (except for the SD Init Fail error):
@makerbase-mks / @mks-viva : Why does the board lock up with "boot..." on the LCD for 30 seconds while an SD card is inserted on boot? |
…reen for MKS_LCD12864
…lcd back again, as it fixes the contrast in the startup
After more testing with @rhapsodyv, the Marlin bootscreen can now be enabled on the Nano V2, Robin E3, and Robin Lite3 boards with MKS Mini 12864 & LCD12864 LCDs after adding a delay and the LCD has proper contrast from the start of the boot process. |
Thanks to @thisiskeithb dedication to get everything as right as possible, and his tests, we fixed more old issues with the MKS_LCD12864. Now its even show the marlin boot screen correctly! 🚀 |
297cf1e
to
2f20711
Compare
@thisiskeithb @rhapsodyv |
The original issue (#19159) was for a Gen-L (8-bit) and the LCD12864A, but that hasn't been addressed yet since neither @rhapsodyv or I have that LCD. AVR uses software serial, so this fix doesn't apply. Can you work on getting that LCD/motherboard combo working? |
* commit 'bc7720c0cd3917f44200c0b78e1b635e4c7b6797': (483 commits) Minor HAL cleanup [cron] Bump distribution date (2020-09-09) Update HAL/STM32 platform to 8.0 (MarlinFirmware#18496) Make M600 heat up the nozzle. Reset runout on fail. (MarlinFirmware#19298) [cron] Bump distribution date (2020-09-08) TFT is neither "graphical" nor "character" (MarlinFirmware#19297) Sanity-check BABYSTEP_DISPLAY_TOTAL with ColorUI (MarlinFirmware#19284) Fix M166 Gradient Mix for DELTA (MarlinFirmware#19285) Separate Neopixel followup (MarlinFirmware#19287) Clean up LCD conditionals, DWIN Whitespace cleanup Adjust GTR PeripheralPins to avoid timer conflicts (MarlinFirmware#19183) STM32F1 EP with USB_COMPOSITE (MarlinFirmware#19281) Menu items for Separate NeoPixel (MarlinFirmware#19280) [cron] Bump distribution date (2020-09-07) Clarify disabling StallGuard for axes (MarlinFirmware#19263) Touch UI long filenames fixes (MarlinFirmware#19262) Fix Ender 3 V2 (DWIN) buffer overrun (MarlinFirmware#19268) Fix STM32F1 SPI device init, MKS_LCD12864 (MarlinFirmware#19271) Emergency Parser for STM32F1 (MarlinFirmware#19279) ... # Conflicts: # .github/issue_template.md # Marlin/Configuration.h # Marlin/Configuration_adv.h # README.md
* commit 'bc7720c0cd3917f44200c0b78e1b635e4c7b6797': (483 commits) Minor HAL cleanup [cron] Bump distribution date (2020-09-09) Update HAL/STM32 platform to 8.0 (MarlinFirmware#18496) Make M600 heat up the nozzle. Reset runout on fail. (MarlinFirmware#19298) [cron] Bump distribution date (2020-09-08) TFT is neither "graphical" nor "character" (MarlinFirmware#19297) Sanity-check BABYSTEP_DISPLAY_TOTAL with ColorUI (MarlinFirmware#19284) Fix M166 Gradient Mix for DELTA (MarlinFirmware#19285) Separate Neopixel followup (MarlinFirmware#19287) Clean up LCD conditionals, DWIN Whitespace cleanup Adjust GTR PeripheralPins to avoid timer conflicts (MarlinFirmware#19183) STM32F1 EP with USB_COMPOSITE (MarlinFirmware#19281) Menu items for Separate NeoPixel (MarlinFirmware#19280) [cron] Bump distribution date (2020-09-07) Clarify disabling StallGuard for axes (MarlinFirmware#19263) Touch UI long filenames fixes (MarlinFirmware#19262) Fix Ender 3 V2 (DWIN) buffer overrun (MarlinFirmware#19268) Fix STM32F1 SPI device init, MKS_LCD12864 (MarlinFirmware#19271) Emergency Parser for STM32F1 (MarlinFirmware#19279) ... # Conflicts: # .github/issue_template.md # README.md
* 2.0.x: (483 commits) Minor HAL cleanup [cron] Bump distribution date (2020-09-09) Update HAL/STM32 platform to 8.0 (MarlinFirmware#18496) Make M600 heat up the nozzle. Reset runout on fail. (MarlinFirmware#19298) [cron] Bump distribution date (2020-09-08) TFT is neither "graphical" nor "character" (MarlinFirmware#19297) Sanity-check BABYSTEP_DISPLAY_TOTAL with ColorUI (MarlinFirmware#19284) Fix M166 Gradient Mix for DELTA (MarlinFirmware#19285) Separate Neopixel followup (MarlinFirmware#19287) Clean up LCD conditionals, DWIN Whitespace cleanup Adjust GTR PeripheralPins to avoid timer conflicts (MarlinFirmware#19183) STM32F1 EP with USB_COMPOSITE (MarlinFirmware#19281) Menu items for Separate NeoPixel (MarlinFirmware#19280) [cron] Bump distribution date (2020-09-07) Clarify disabling StallGuard for axes (MarlinFirmware#19263) Touch UI long filenames fixes (MarlinFirmware#19262) Fix Ender 3 V2 (DWIN) buffer overrun (MarlinFirmware#19268) Fix STM32F1 SPI device init, MKS_LCD12864 (MarlinFirmware#19271) Emergency Parser for STM32F1 (MarlinFirmware#19279) ... # Conflicts: # Marlin/Configuration.h # platformio.ini
Hi every body. tried the new bugfix but doesn't help with character LCD. |
That’s completely different hardware than what this PR addresses. |
@thisiskeithb i had asked them to re-test, not knowing if the delays from this would impact it at all. Apparently not, so further discussion on it should not occur here. |
ok tnx for the information. |
Description
Some PINs file have
ENABLE_SPI2
, to select the SPI 2 as the main device. But the current code start the SPI object with the SPI 1.If any code try to use SPI before calling
spiInit
function (that set it according to board pins), the SPI will not work.And this is the problem with #19269 . The LCD code in u8glib don't call
spiInit
, it rely on the current SPI selected from the global SPI object.The MKS fix call SD card mount in the init of marlin code. The SD mount code call
spiInit
, putting the SPI to the right device, so its the reason why LCD works after the sd card mount. That SD mount just hide the real problem.This fix start the SPI object with according with the board definition. It solves the problem in the root cause.
@thisiskeithb tested it and solved the LCD problem.
But it generate other issue: a very long boot time, that I'm looking for and. We check and that issue always happens, even with the old and mks pr. It's a boot loader issue. The delay happens before marlin ever starts.SD Init Fail error
Benefits
Configurations
Related Issues
#19269
#19159