Skip to content

Commit 4f36e32

Browse files
FLYmakerSiarhei Pantsialei
authored and
Siarhei Pantsialei
committed
Support for FLY MINI (MarlinFirmware#19185)
1 parent 2bfaf88 commit 4f36e32

File tree

7 files changed

+219
-1
lines changed

7 files changed

+219
-1
lines changed

Marlin/src/core/boards.h

+1
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@
320320
#define BOARD_CREALITY_V4 4034 // Creality v4.x (STM32F103RE)
321321
#define BOARD_CREALITY_V427 4035 // Creality v4.2.7 (STM32F103RE)
322322
#define BOARD_TRIGORILLA_PRO 4036 // Trigorilla Pro (STM32F103ZET6)
323+
#define BOARD_FLY_MINI 4037 // FLY MINI (STM32F103RCT6)
323324

324325
//
325326
// ARM Cortex-M4F

Marlin/src/pins/pins.h

+2
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,8 @@
569569
#include "stm32f1/pins_CREALITY_V427.h" // STM32F1 env:STM32F103RET6_creality
570570
#elif MB(TRIGORILLA_PRO)
571571
#include "stm32f1/pins_TRIGORILLA_PRO.h" // STM32F1 env:trigorilla_pro
572+
#elif MB(FLY_MINI)
573+
#include "stm32f1/pins_FLY_MINI.h" // STM32F1 env:FLY_MINI
572574

573575
//
574576
// ARM Cortex-M4F
+172
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
/**
2+
* Marlin 3D Printer Firmware
3+
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4+
*
5+
* Based on Sprinter and grbl.
6+
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7+
*
8+
* This program is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License
19+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20+
*
21+
*/
22+
#pragma once
23+
24+
#ifndef __STM32F1__
25+
#error "Oops! Select an STM32F1 board in 'Tools > Board.'"
26+
#endif
27+
28+
#define BOARD_INFO_NAME "FLY_MINI"
29+
#define BOARD_WEBSITE_URL "github.com/FLYmaker"
30+
#define DISABLE_JTAG
31+
32+
//
33+
// Flash EEPROM Emulation
34+
//
35+
#define FLASH_EEPROM_EMULATION
36+
#define EEPROM_PAGE_SIZE 0x800 // 2KB
37+
#define EEPROM_START_ADDRESS (0x8000000 + 256 * 1024 - 2 * EEPROM_PAGE_SIZE) // 256K firmware space
38+
#define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE
39+
40+
//
41+
// Servos
42+
//
43+
#define SERVO0_PIN PA8
44+
45+
//
46+
// Limit Switches
47+
//
48+
#define X_MIN_PIN PC12
49+
#define X_MAX_PIN PC11
50+
#define Y_MIN_PIN PC10
51+
#define Y_MAX_PIN PA15
52+
#define Z_MIN_PIN PA14
53+
#define Z_MAX_PIN PA13
54+
55+
//
56+
// Steppers
57+
//
58+
#define X_STEP_PIN PB1
59+
#define X_DIR_PIN PB2
60+
#define X_ENABLE_PIN PB10
61+
#ifndef X_CS_PIN
62+
#define X_CS_PIN PB0
63+
#endif
64+
65+
#define Y_STEP_PIN PA2
66+
#define Y_DIR_PIN PC4
67+
#define Y_ENABLE_PIN PC5
68+
#ifndef Y_CS_PIN
69+
#define Y_CS_PIN PA7
70+
#endif
71+
72+
#define Z_STEP_PIN PA3
73+
#define Z_DIR_PIN PA5
74+
#define Z_ENABLE_PIN PA6
75+
#ifndef Z_CS_PIN
76+
#define Z_CS_PIN PA4
77+
#endif
78+
79+
#define E0_STEP_PIN PA1
80+
#define E0_DIR_PIN PC3
81+
#define E0_ENABLE_PIN PA0
82+
#ifndef E0_CS_PIN
83+
#define E0_CS_PIN PC2
84+
#endif
85+
86+
#if ENABLED(TMC_USE_SW_SPI)
87+
#ifndef TMC_SW_MOSI
88+
#define TMC_SW_MOSI PB15
89+
#endif
90+
#ifndef TMC_SW_MISO
91+
#define TMC_SW_MISO PB14
92+
#endif
93+
#ifndef TMC_SW_SCK
94+
#define TMC_SW_SCK PB13
95+
#endif
96+
#endif
97+
98+
#if HAS_TMC_UART
99+
//
100+
// Software serial
101+
//
102+
#define X_SERIAL_TX_PIN PB0
103+
#define X_SERIAL_RX_PIN PB0
104+
#define Y_SERIAL_TX_PIN PA7
105+
#define Y_SERIAL_RX_PIN PA7
106+
#define Z_SERIAL_TX_PIN PA4
107+
#define Z_SERIAL_RX_PIN PA4
108+
#define E0_SERIAL_TX_PIN PC2
109+
#define E0_SERIAL_RX_PIN PC2
110+
#endif
111+
112+
//
113+
// Heaters / Fans
114+
//
115+
#define HEATER_0_PIN PC6
116+
#define HEATER_BED_PIN PC7
117+
#ifndef FAN_PIN
118+
#define FAN_PIN PC8
119+
#endif
120+
#define FAN1_PIN PC9
121+
122+
//
123+
// Temperature Sensors
124+
//
125+
#define TEMP_BED_PIN PC0 // Analog Input
126+
#define TEMP_0_PIN PC1 // Analog Input
127+
128+
//
129+
// LCD Pins
130+
//
131+
132+
//
133+
// LCD / Controller
134+
//
135+
#define ENABLE_SPI2
136+
#define SS_PIN PB12
137+
#define SCK_PIN PB13
138+
#define MISO_PIN PB14
139+
#define MOSI_PIN PB15
140+
141+
#define SDSS SS_PIN
142+
#define SD_DETECT_PIN PB11
143+
144+
#define BEEPER_PIN PC14
145+
146+
#define LCD_PINS_RS PB8
147+
#define LCD_PINS_ENABLE PB9
148+
#define LCD_PINS_D4 PB7
149+
#define LCD_PINS_D5 PB6
150+
#define LCD_PINS_D6 PB5
151+
#define LCD_PINS_D7 PB4
152+
153+
#define BTN_EN1 PD2
154+
#define BTN_EN2 PB3
155+
#define BTN_ENC PC13
156+
157+
//
158+
// Filament runout
159+
//
160+
161+
//
162+
// ST7920 Delays
163+
//
164+
#ifndef ST7920_DELAY_1
165+
#define ST7920_DELAY_1 DELAY_NS(96)
166+
#endif
167+
#ifndef ST7920_DELAY_2
168+
#define ST7920_DELAY_2 DELAY_NS(48)
169+
#endif
170+
#ifndef ST7920_DELAY_3
171+
#define ST7920_DELAY_3 DELAY_NS(715)
172+
#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
MEMORY
2+
{
3+
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 48K - 40
4+
rom (rx) : ORIGIN = 0x08005000, LENGTH = 256K - 20K - 4K
5+
}
6+
7+
/* Provide memory region aliases for common.inc */
8+
REGION_ALIAS("REGION_TEXT", rom);
9+
REGION_ALIAS("REGION_DATA", ram);
10+
REGION_ALIAS("REGION_BSS", ram);
11+
REGION_ALIAS("REGION_RODATA", rom);
12+
13+
/* Let common.inc handle the real work. */
14+
INCLUDE common.inc
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import os
2+
Import("env")
3+
4+
# Relocate firmware from 0x08000000 to 0x08005000
5+
for define in env['CPPDEFINES']:
6+
if define[0] == "VECT_TAB_ADDR":
7+
env['CPPDEFINES'].remove(define)
8+
env['CPPDEFINES'].append(("VECT_TAB_ADDR", "0x08005000"))
9+
10+
custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/fly_mini.ld")
11+
for i, flag in enumerate(env["LINKFLAGS"]):
12+
if "-Wl,-T" in flag:
13+
env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script
14+
elif flag == "-T":
15+
env["LINKFLAGS"][i + 1] = custom_ld_script
16+

buildroot/share/PlatformIO/variants/FLY_F407ZG/PeripheralPins.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ WEAK const PinMap PinMap_PWM[] = {
144144
{PE_5, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1
145145
{PE_6, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2
146146
//{PE_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 0)}, // TIM1_CH2
147-
{PE_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3
147+
//{PE_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3
148148
{PF_6, TIM10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1
149149
{PF_7, TIM11, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1
150150
{PF_8, TIM13, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM13, 1, 0)}, // TIM13_CH1

platformio.ini

+13
Original file line numberDiff line numberDiff line change
@@ -1125,6 +1125,19 @@ build_flags = ${common_stm32.build_flags}
11251125
extra_scripts = ${common.extra_scripts}
11261126
pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
11271127

1128+
#
1129+
# FLY MINI(stm32f103rct6)
1130+
#
1131+
[env:FLY_MINI]
1132+
platform = ${common_stm32f1.platform}
1133+
extends = common_stm32f1
1134+
board = genericSTM32F103RC
1135+
platform_packages = tool-stm32duino
1136+
extra_scripts = ${common.extra_scripts}
1137+
buildroot/share/PlatformIO/scripts/fly_mini.py
1138+
build_flags = ${common_stm32f1.build_flags}
1139+
-DDEBUG_LEVEL=0 -DSS_TIMER=4
1140+
11281141
#
11291142
# FYSETC S6 (STM32F446VET6 ARM Cortex-M4)
11301143
#

0 commit comments

Comments
 (0)