Skip to content

Commit

Permalink
🐛 Fix boot / SD for STM32 (F103Rx) boards (MarlinFirmware#22087)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhapsodyv authored and ptoal committed Dec 16, 2021
1 parent ffbd30f commit 2869f6d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions Marlin/src/HAL/STM32/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ uint16_t HAL_adc_get_result();
#ifdef STM32F1xx
#define JTAG_DISABLE() AFIO_DBGAFR_CONFIG(AFIO_MAPR_SWJ_CFG_JTAGDISABLE)
#define JTAGSWD_DISABLE() AFIO_DBGAFR_CONFIG(AFIO_MAPR_SWJ_CFG_DISABLE)
#define JTAGSWD_RESET() AFIO_DBGAFR_CONFIG(AFIO_MAPR_SWJ_CFG_RESET); // Reset: FULL SWD+JTAG
#endif

#define PLATFORM_M997_SUPPORT
Expand Down
9 changes: 9 additions & 0 deletions Marlin/src/MarlinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1126,6 +1126,7 @@ void setup() {
#endif

#if HAS_FREEZE_PIN
SETUP_LOG("FREEZE_PIN");
SET_INPUT_PULLUP(FREEZE_PIN);
#endif

Expand All @@ -1134,11 +1135,19 @@ void setup() {
OUT_WRITE(SUICIDE_PIN, !SUICIDE_PIN_INVERTING);
#endif

#ifdef JTAGSWD_RESET
SETUP_LOG("JTAGSWD_RESET");
JTAGSWD_RESET();
#endif

#if EITHER(DISABLE_DEBUG, DISABLE_JTAG)
delay(10);
// Disable any hardware debug to free up pins for IO
#if ENABLED(DISABLE_DEBUG) && defined(JTAGSWD_DISABLE)
SETUP_LOG("JTAGSWD_DISABLE");
JTAGSWD_DISABLE();
#elif defined(JTAG_DISABLE)
SETUP_LOG("JTAG_DISABLE");
JTAG_DISABLE();
#else
#error "DISABLE_(DEBUG|JTAG) is not supported for the selected MCU/Board."
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h
Original file line number Diff line number Diff line change
Expand Up @@ -288,3 +288,4 @@

#define ONBOARD_SPI_DEVICE 1 // SPI1
#define ONBOARD_SD_CS_PIN PA4 // Chip select for "System" SD card
#define SDSS ONBOARD_SD_CS_PIN

0 comments on commit 2869f6d

Please sign in to comment.