Skip to content
2 changes: 1 addition & 1 deletion Marlin/src/HAL/STM32/HAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ TERN_(POSTMORTEM_DEBUGGING, extern void install_min_serial());

// HAL initialization task
void HAL_init() {
FastIO_init();
//FastIO_init(); // Moved in setup()

// Ensure F_CPU is a constant expression.
// If the compiler breaks here, it means that delay code that should compute at compile time will not work.
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/STM32/fastio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include "../../inc/MarlinConfig.h"

GPIO_TypeDef* FastIOPortMap[LastPort + 1];
GPIO_TypeDef* FastIOPortMap[LastPort + 1] = { 0 };

void FastIO_init() {
LOOP_L_N(i, NUM_DIGITAL_PINS)
Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/MarlinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,10 @@ inline void tmc_standby_setup() {
* - Set Marlin to RUNNING State
*/
void setup() {
#ifdef HAL_STM32
FastIO_init();
#endif

#ifdef BOARD_PREINIT
BOARD_PREINIT(); // Low-level init (before serial init)
#endif
Expand Down
9 changes: 1 addition & 8 deletions Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,12 @@
// Avoid nozzle heat and fan start before serial init
#define BOARD_OPENDRAIN_MOSFETS

#define BOARD_INIT_OD_PINS() { \
#define BOARD_PREINIT() { \
OUT_WRITE_OD(HEATER_0_PIN, 0); \
OUT_WRITE_OD(HEATER_BED_PIN, 0); \
OUT_WRITE_OD(FAN_PIN, 0); \
}

#ifdef MAPLE_STM32F1
// Only Maple Framework allow that early
#define BOARD_PREINIT BOARD_INIT_OD_PINS
#else
#define BOARD_INIT BOARD_INIT_OD_PINS
#endif

//
// PWM for a servo probe
// Other servo devices are not supported on this board!
Expand Down
2 changes: 1 addition & 1 deletion ini/stm32-common.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
platform = ststm32@~12.1
board_build.core = stm32
build_flags = ${common.build_flags}
-std=gnu++14
-std=gnu++14 -DHAL_STM32
-DUSBCON -DUSBD_USE_CDC
-DTIM_IRQ_PRIO=13
-DADC_RESOLUTION=12
Expand Down