Skip to content

Commit

Permalink
BTT SKR Mini E3 V3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Dec 9, 2021
1 parent c3af6bd commit 30d94bc
Show file tree
Hide file tree
Showing 17 changed files with 1,476 additions and 39 deletions.
6 changes: 5 additions & 1 deletion Marlin/src/HAL/STM32/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,11 @@
// Types
// ------------------------

typedef int16_t pin_t;
#ifdef STM32G0B1xx
typedef int32_t pin_t;
#else
typedef int16_t pin_t;
#endif

#define HAL_SERVO_LIB libServo
#define PAUSE_SERVO_OUTPUT() libServo::pause_all_servos()
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/STM32/HAL_MinSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ void install_min_serial() {
HAL_min_serial_out = &TX;
}

#if DISABLED(DYNAMIC_VECTORTABLE) && DISABLED(STM32F0xx) // Cortex M0 can't jump to a symbol that's too far from the current function, so we work around this in exception_arm.cpp
#if NONE(DYNAMIC_VECTORTABLE, STM32F0xx, STM32G0xx) // Cortex M0 can't jump to a symbol that's too far from the current function, so we work around this in exception_arm.cpp
extern "C" {
__attribute__((naked)) void JumpHandler_ASM() {
__asm__ __volatile__ (
Expand Down
4 changes: 3 additions & 1 deletion Marlin/src/HAL/STM32/HAL_SPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ static SPISettings spiConfig;
case SPI_SPEED_6: delaySPIFunc = &delaySPI_2000; break; // desired: 250,000 actual: ~210K
default: delaySPIFunc = &delaySPI_4000; break; // desired: 125,000 actual: ~123K
}
SPI.begin();
#ifndef STM32G0B1xx
SPI.begin();
#endif
}

// Begin SPI transaction, set clock, bit order, data mode
Expand Down
3 changes: 3 additions & 0 deletions Marlin/src/HAL/STM32/timers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@
#elif defined(STM32F4xx) || defined(STM32F7xx) || defined(STM32H7xx)
#define MCU_STEP_TIMER 6 // STM32F401 has no TIM6, TIM7, or TIM8
#define MCU_TEMP_TIMER 14 // TIM7 is consumed by Software Serial if used.
#elif defined(STM32G0xx)
#define MCU_STEP_TIMER 16
#define MCU_TEMP_TIMER 17
#endif

#ifndef HAL_TIMER_RATE
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/shared/backtrace/unwmemaccess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#define START_FLASH_ADDR 0x00000000
#define END_FLASH_ADDR 0x00080000

#elif defined(__STM32F1__) || defined(STM32F1xx) || defined(STM32F0xx)
#elif defined(__STM32F1__) || defined(STM32F1xx) || defined(STM32F0xx) || defined(STM32G0xx)

// For STM32F103ZET6/STM32F103VET6/STM32F0xx
// SRAM (0x20000000 - 0x20010000) (64kb)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/shared/cpu_exception/exception_arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ struct __attribute__((packed)) ContextSavedFrame {
uint32_t ELR;
};

#if DISABLED(STM32F0xx)
#if NONE(STM32F0xx, STM32G0xx)
extern "C"
__attribute__((naked)) void CommonHandler_ASM() {
__asm__ __volatile__ (
Expand Down
67 changes: 34 additions & 33 deletions Marlin/src/core/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,39 +324,40 @@
#define BOARD_BTT_SKR_MINI_E3_V1_0 4024 // BigTreeTech SKR Mini E3 (STM32F103RC)
#define BOARD_BTT_SKR_MINI_E3_V1_2 4025 // BigTreeTech SKR Mini E3 V1.2 (STM32F103RC)
#define BOARD_BTT_SKR_MINI_E3_V2_0 4026 // BigTreeTech SKR Mini E3 V2.0 (STM32F103RC / STM32F103RE)
#define BOARD_BTT_SKR_MINI_MZ_V1_0 4027 // BigTreeTech SKR Mini MZ V1.0 (STM32F103RC)
#define BOARD_BTT_SKR_E3_DIP 4028 // BigTreeTech SKR E3 DIP V1.0 (STM32F103RC / STM32F103RE)
#define BOARD_BTT_SKR_CR6 4029 // BigTreeTech SKR CR6 v1.0 (STM32F103RE)
#define BOARD_JGAURORA_A5S_A1 4030 // JGAurora A5S A1 (STM32F103ZET6)
#define BOARD_FYSETC_AIO_II 4031 // FYSETC AIO_II
#define BOARD_FYSETC_CHEETAH 4032 // FYSETC Cheetah
#define BOARD_FYSETC_CHEETAH_V12 4033 // FYSETC Cheetah V1.2
#define BOARD_LONGER3D_LK 4034 // Alfawise U20/U20+/U30 (Longer3D LK1/2) / STM32F103VET6
#define BOARD_CCROBOT_MEEB_3DP 4035 // ccrobot-online.com MEEB_3DP (STM32F103RC)
#define BOARD_CHITU3D_V5 4036 // Chitu3D TronXY X5SA V5 Board
#define BOARD_CHITU3D_V6 4037 // Chitu3D TronXY X5SA V6 Board
#define BOARD_CHITU3D_V9 4038 // Chitu3D TronXY X5SA V9 Board
#define BOARD_CREALITY_V4 4039 // Creality v4.x (STM32F103RE)
#define BOARD_CREALITY_V427 4040 // Creality v4.2.7 (STM32F103RE)
#define BOARD_CREALITY_V4210 4041 // Creality v4.2.10 (STM32F103RE) as found in the CR-30
#define BOARD_CREALITY_V431 4042 // Creality v4.3.1 (STM32F103RE)
#define BOARD_CREALITY_V431_A 4043 // Creality v4.3.1a (STM32F103RE)
#define BOARD_CREALITY_V431_B 4044 // Creality v4.3.1b (STM32F103RE)
#define BOARD_CREALITY_V431_C 4045 // Creality v4.3.1c (STM32F103RE)
#define BOARD_CREALITY_V431_D 4046 // Creality v4.3.1d (STM32F103RE)
#define BOARD_CREALITY_V452 4047 // Creality v4.5.2 (STM32F103RE)
#define BOARD_CREALITY_V453 4048 // Creality v4.5.3 (STM32F103RE)
#define BOARD_CREALITY_V24S1 4049 // Creality v2.4.S1 (STM32F103RE) v101 as found in the Ender 7
#define BOARD_TRIGORILLA_PRO 4050 // Trigorilla Pro (STM32F103ZET6)
#define BOARD_FLY_MINI 4051 // FLYmaker FLY MINI (STM32F103RCT6)
#define BOARD_FLSUN_HISPEED 4052 // FLSUN HiSpeedV1 (STM32F103VET6)
#define BOARD_BEAST 4053 // STM32F103RET6 Libmaple-based controller
#define BOARD_MINGDA_MPX_ARM_MINI 4054 // STM32F103ZET6 Mingda MD-16
#define BOARD_GTM32_PRO_VD 4055 // STM32F103VET6 controller
#define BOARD_ZONESTAR_ZM3E2 4056 // Zonestar ZM3E2 (STM32F103RCT6)
#define BOARD_ZONESTAR_ZM3E4 4057 // Zonestar ZM3E4 V1 (STM32F103VCT6)
#define BOARD_ZONESTAR_ZM3E4V2 4058 // Zonestar ZM3E4 V2 (STM32F103VCT6)
#define BOARD_ERYONE_ERY32_MINI 4059 // Eryone Ery32 mini (STM32F103VET6)
#define BOARD_BTT_SKR_MINI_E3_V3_0 4027 // BigTreeTech SKR Mini E3 V3.0 (STM32G0B1RE)
#define BOARD_BTT_SKR_MINI_MZ_V1_0 4028 // BigTreeTech SKR Mini MZ V1.0 (STM32F103RC)
#define BOARD_BTT_SKR_E3_DIP 4029 // BigTreeTech SKR E3 DIP V1.0 (STM32F103RC / STM32F103RE)
#define BOARD_BTT_SKR_CR6 4030 // BigTreeTech SKR CR6 v1.0 (STM32F103RE)
#define BOARD_JGAURORA_A5S_A1 4031 // JGAurora A5S A1 (STM32F103ZET6)
#define BOARD_FYSETC_AIO_II 4032 // FYSETC AIO_II
#define BOARD_FYSETC_CHEETAH 4033 // FYSETC Cheetah
#define BOARD_FYSETC_CHEETAH_V12 4034 // FYSETC Cheetah V1.2
#define BOARD_LONGER3D_LK 4035 // Alfawise U20/U20+/U30 (Longer3D LK1/2) / STM32F103VET6
#define BOARD_CCROBOT_MEEB_3DP 4036 // ccrobot-online.com MEEB_3DP (STM32F103RC)
#define BOARD_CHITU3D_V5 4037 // Chitu3D TronXY X5SA V5 Board
#define BOARD_CHITU3D_V6 4038 // Chitu3D TronXY X5SA V6 Board
#define BOARD_CHITU3D_V9 4039 // Chitu3D TronXY X5SA V9 Board
#define BOARD_CREALITY_V4 4040 // Creality v4.x (STM32F103RE)
#define BOARD_CREALITY_V427 4041 // Creality v4.2.7 (STM32F103RE)
#define BOARD_CREALITY_V4210 4042 // Creality v4.2.10 (STM32F103RE) as found in the CR-30
#define BOARD_CREALITY_V431 4043 // Creality v4.3.1 (STM32F103RE)
#define BOARD_CREALITY_V431_A 4044 // Creality v4.3.1a (STM32F103RE)
#define BOARD_CREALITY_V431_B 4045 // Creality v4.3.1b (STM32F103RE)
#define BOARD_CREALITY_V431_C 4046 // Creality v4.3.1c (STM32F103RE)
#define BOARD_CREALITY_V431_D 4047 // Creality v4.3.1d (STM32F103RE)
#define BOARD_CREALITY_V452 4048 // Creality v4.5.2 (STM32F103RE)
#define BOARD_CREALITY_V453 4049 // Creality v4.5.3 (STM32F103RE)
#define BOARD_CREALITY_V24S1 4050 // Creality v2.4.S1 (STM32F103RE) v101 as found in the Ender 7
#define BOARD_TRIGORILLA_PRO 4051 // Trigorilla Pro (STM32F103ZET6)
#define BOARD_FLY_MINI 4052 // FLYmaker FLY MINI (STM32F103RCT6)
#define BOARD_FLSUN_HISPEED 4053 // FLSUN HiSpeedV1 (STM32F103VET6)
#define BOARD_BEAST 4054 // STM32F103RET6 Libmaple-based controller
#define BOARD_MINGDA_MPX_ARM_MINI 4055 // STM32F103ZET6 Mingda MD-16
#define BOARD_GTM32_PRO_VD 4056 // STM32F103VET6 controller
#define BOARD_ZONESTAR_ZM3E2 4057 // Zonestar ZM3E2 (STM32F103RCT6)
#define BOARD_ZONESTAR_ZM3E4 4058 // Zonestar ZM3E4 V1 (STM32F103VCT6)
#define BOARD_ZONESTAR_ZM3E4V2 4059 // Zonestar ZM3E4 V2 (STM32F103VCT6)
#define BOARD_ERYONE_ERY32_MINI 4060 // Eryone Ery32 mini (STM32F103VET6)

//
// ARM Cortex-M4F
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/module/stepper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1380,7 +1380,7 @@ void Stepper::set_directions() {
}

FORCE_INLINE int32_t Stepper::_eval_bezier_curve(const uint32_t curr_step) {
#if defined(__arm__) || defined(__thumb__)
#if !defined(STM32G0B1xx) && (defined(__arm__) || defined(__thumb__)) // TODO: Test define STM32G0xx versus STM32G0B1xx

// For ARM Cortex M3/M4 CPUs, we have the optimized assembler version, that takes 43 cycles to execute
uint32_t flo = 0;
Expand Down
2 changes: 2 additions & 0 deletions Marlin/src/pins/pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,8 @@
#include "stm32f1/pins_BTT_SKR_MINI_E3_V1_2.h" // STM32F1 env:STM32F103RC_btt env:STM32F103RC_btt_USB env:STM32F103RC_btt_maple env:STM32F103RC_btt_USB_maple
#elif MB(BTT_SKR_MINI_E3_V2_0)
#include "stm32f1/pins_BTT_SKR_MINI_E3_V2_0.h" // STM32F1 env:STM32F103RC_btt env:STM32F103RC_btt_USB env:STM32F103RE_btt env:STM32F103RE_btt_USB env:STM32F103RC_btt_maple env:STM32F103RC_btt_USB_maple env:STM32F103RE_btt_maple env:STM32F103RE_btt_USB_maple
#elif MB(BTT_SKR_MINI_E3_V3_0)
#include "stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h" // STM32G0 env:STM32G0B1RE_btt
#elif MB(BTT_SKR_MINI_MZ_V1_0)
#include "stm32f1/pins_BTT_SKR_MINI_MZ_V1_0.h" // STM32F1 env:STM32F103RC_btt env:STM32F103RC_btt_USB env:STM32F103RC_btt_maple env:STM32F103RC_btt_USB_maple
#elif MB(BTT_SKR_E3_DIP)
Expand Down
Loading

0 comments on commit 30d94bc

Please sign in to comment.