Skip to content

Fix SKR 1.4 boot failure with UART3 enabled (MARLIN_DEV_MODE)#20944

Merged
thinkyhead merged 1 commit intoMarlinFirmware:bugfix-2.0.xfrom
zeleps:bugfix-2.0.x-Fix-for-serial-setup
Jan 31, 2021
Merged

Fix SKR 1.4 boot failure with UART3 enabled (MARLIN_DEV_MODE)#20944
thinkyhead merged 1 commit intoMarlinFirmware:bugfix-2.0.xfrom
zeleps:bugfix-2.0.x-Fix-for-serial-setup

Conversation

@zeleps
Copy link
Contributor

@zeleps zeleps commented Jan 31, 2021

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.

@Rockman18
Copy link
Contributor

I've checked with #20810 it's ok for me !

@thinkyhead thinkyhead changed the title FIX: SKR 1.4 fails to boot when UART3 is enabled (MARLIN_DEV_MODE) Fix SKR 1.4 boot failure with UART3 enabled (MARLIN_DEV_MODE) Jan 31, 2021
@thinkyhead thinkyhead merged commit d49969d into MarlinFirmware:bugfix-2.0.x Jan 31, 2021
Jyers pushed a commit to Jyers/Marlin that referenced this pull request Feb 3, 2021
@zeleps zeleps deleted the bugfix-2.0.x-Fix-for-serial-setup branch February 3, 2021 17:23
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
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.

3 participants