Fix SKR 1.4 boot failure with UART3 enabled (MARLIN_DEV_MODE)#20944
Merged
thinkyhead merged 1 commit intoMarlinFirmware:bugfix-2.0.xfrom Jan 31, 2021
Merged
Conversation
Contributor
|
I've checked with #20810 it's ok for me ! |
Rockman18
approved these changes
Jan 31, 2021
Jyers
pushed a commit
to Jyers/Marlin
that referenced
this pull request
Feb 3, 2021
susisstrolch
pushed a commit
to susisstrolch/Marlin
that referenced
this pull request
Feb 16, 2021
… into bugfix-2.0.x * 'bugfix-2.0.x' of https://github.com/MarlinFirmware/Marlin: (121 commits) [cron] Bump distribution date (2021-02-04) [cron] Bump distribution date (2021-02-03) Add "more" menu in LVGL interface (MarlinFirmware#20940) Evaluate ANY_SERIAL_IS in place Note (MarlinUI) limit on PREHEAT settings (MarlinFirmware#20966) Update a UBL comment (MarlinFirmware#20931) STM32 Shared Media - USB Mass Storage Device (MarlinFirmware#20956) Multi-language pertains to Color UI (MarlinFirmware#20972) Touch Calibration Screen auto-save option (MarlinFirmware#20971) Include ui_common for MARLIN_LOGO_FULL_SIZE (MarlinFirmware#20963) Fix host_response_handler compile (MarlinFirmware#20962) [cron] Bump distribution date (2021-02-02) LVGL UI G-code console (MarlinFirmware#20755) [cron] Bump distribution date (2021-02-01) Refresh screen on M22 (detach) (MarlinFirmware#20958) Fix AutoReporter implementation (MarlinFirmware#20959) Serial refactor followup (MarlinFirmware#20932) Init serial ports first (MarlinFirmware#20944) Remove extra G29 V newlines (MarlinFirmware#20955) [cron] Bump distribution date (2021-01-31) ...
kpishere
pushed a commit
to kpishere/Marlin
that referenced
this pull request
Feb 19, 2021
W4tel-BiDi
pushed a commit
to W4tel-BiDi/Marlin
that referenced
this pull request
Apr 5, 2021
thinkyhead
pushed a commit
that referenced
this pull request
Apr 30, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Invoking SETUP_LOG() before initializing serial ports will fail on an SKR 1.4 with UART3 enabled (either as SERIAL_PORT or SERIAL_PORT_2) and the board resets immediately.
Configurations
#define SERIAL_PORT 3
...
#define MOTHERBOARD BOARD_BTT_SKR_V1_4
...
#define PSU_CONTROL
...
#define MARLIN_DEV_MODE
the above defines will cause SETUP_LOG() to run before serial setup.
Related Issues
#20933 #20810
In relation to #20810, it appears that the related issue is a race condition rather than a deterministic behavior, so it's not a fix, but rather a speed improvement. If this solution breaks #20810 and serial ports must be setup after KILL_PIN, it would be a good idea to remove SETUP_LOG() from all the code before serial setup, to avoid the crash.
On the other hand, it might be worthwhile to investigate why UART3 crashes (while UART0 does not) when used uninitialized, and fix that issue, but I don't have the means to debug the issue at this level.