🐛 Fix boot / SD for STM32 (F103Rx) boards (#22087)
This commit is contained in:
parent
d322e495b2
commit
3491e49c5f
@ -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
|
||||
|
@ -1126,6 +1126,7 @@ void setup() {
|
||||
#endif
|
||||
|
||||
#if HAS_FREEZE_PIN
|
||||
SETUP_LOG("FREEZE_PIN");
|
||||
SET_INPUT_PULLUP(FREEZE_PIN);
|
||||
#endif
|
||||
|
||||
@ -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."
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user