aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/spi_flash/board_defs.py
blob: e6e50a72e7a75b07a116d5296ac15e7af40b2755 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# SPI Flash board definitions
#
# Copyright (C) 2021 Eric Callahan <arksine.code@gmail.com>
#
# This file may be distributed under the terms of the GNU GPLv3 license.

###########################################################
#
# Board Definitions
#
###########################################################

BOARD_DEFS = {
    "generic-lpc1768": {"mcu": "lpc1768", "spi_bus": "ssp1", "cs_pin": "P0.6"},
    "generic-lpc1769": {"mcu": "lpc1769", "spi_bus": "ssp1", "cs_pin": "P0.6"},
    "btt-skr-mini": {"mcu": "stm32f103xe", "spi_bus": "spi1", "cs_pin": "PA4"},
    "btt-skr-mini-v3": {"mcu": "stm32g0b1xx", "spi_bus": "spi1", "cs_pin": "PA4"},
    "btt-skr-mini-v3-b0": {"mcu": "stm32g0b0xx", "spi_bus": "spi1", "cs_pin": "PA4"},
    "flyboard-mini": {
        "mcu": "stm32f103xe",
        "spi_bus": "spi2",
        "cs_pin": "PB12",
        "current_firmware_path": "FLY.CUR",
    },
    "mks-robin-e3": {
        "mcu": "stm32f103xe",
        "spi_bus": "spi2",
        "cs_pin": "PA15",
        "conversion_script": "scripts/update_mks_robin.py",
        "firmware_path": "Robin_e3.bin",
        "current_firmware_path": "Robin_e3.cur",
    },
    # twotrees sapphire 5 v1.1 using mks robin nano 1.2 board
    "mks-robin-v12": {
        "mcu": "stm32f103xe",
        "spi_bus": "swspi",
        "spi_pins": "PC8,PD2,PC12",
        "cs_pin": "PC11",
        "skip_verify": True,
        "conversion_script": "scripts/update_mks_robin.py",
        "firmware_path": "ROBIN_NANO35.BIN",
        "current_firmware_path": "ROBIN_NANO35.BIN",
    },
    "btt-octopus-f407-v1": {
        "mcu": "stm32f407xx",
        "spi_bus": "swspi",
        "spi_pins": "PC8,PD2,PC12",
        "cs_pin": "PC11",
        "skip_verify": True,
    },
    "btt-octopus-f429-v1": {
        "mcu": "stm32f429xx",
        "spi_bus": "swspi",
        "spi_pins": "PC8,PD2,PC12",
        "cs_pin": "PC11",
        "skip_verify": True,
    },
    "btt-octopus-f446-v1": {
        "mcu": "stm32f446xx",
        "spi_bus": "swspi",
        "spi_pins": "PC8,PD2,PC12",
        "cs_pin": "PC11",
        "skip_verify": True,
    },
    "btt-skr-pro": {
        "mcu": "stm32f407xx",
        "spi_bus": "swspi",
        "spi_pins": "PA6,PB5,PA5",
        "cs_pin": "PA4",
    },
    "btt-gtr": {"mcu": "stm32f407xx", "spi_bus": "spi1", "cs_pin": "PA4"},
    "fysetc-spider": {
        "mcu": "stm32f446xx",
        "spi_bus": "spi1",
        "cs_pin": "PA4",
        "current_firmware_path": "OLD.BIN",
    },
    "btt-skr-se-bx": {"mcu": "stm32h743xx", "spi_bus": "spi3a", "cs_pin": "PA15"},
    "btt-skr-3-h743": {
        "mcu": "stm32h743xx",
        "spi_bus": "swspi",
        "spi_pins": "PC8,PD2,PC12",
        "cs_pin": "PC11",
        "skip_verify": True,
    },
    "btt-skr-3-h723": {
        "mcu": "stm32h723xx",
        "spi_bus": "swspi",
        "spi_pins": "PC8,PD2,PC12",
        "cs_pin": "PC11",
        "skip_verify": True,
    },
    "creality-v4.2.2": {
        "mcu": "stm32f103xe",
        "spi_bus": "swspi",
        "spi_pins": "PC8,PD2,PC12",
        "cs_pin": "PC11",
        "skip_verify": True,
    },
    "monster8": {"mcu": "stm32f407xx", "spi_bus": "spi3a", "cs_pin": "PC9"},
    "fly-gemini-v2": {"mcu": "stm32f405xx", "spi_bus": "spi1", "cs_pin": "PA4"},
    "fysetc-cheetah": {
        "mcu": "stm32f401xc",
        "spi_bus": "spi1",
        "cs_pin": "PA4",
        "current_firmware_path": "OLD.BIN",
    },
    "btt-octopus-max-ez": {
        "mcu": "stm32h723xx",
        "spi_bus": "swspi",
        "spi_pins": "PE13,PE14,PE12",
        "cs_pin": "PB12",
        "skip_verify": True,
    },
    "btt-skrat": {"mcu": "stm32g0b1xx", "spi_bus": "spi1", "cs_pin": "PB8"},
    "chitu-v6": {
        "mcu": "stm32f103xe",
        "spi_bus": "swspi",
        "spi_pins": "PC8,PD2,PC12",
        "cs_pin": "PC11",
        #'sdio_bus': 'sdio',
        "conversion_script": "scripts/update_chitu.py",
        "firmware_path": "update.cbd",
        "skip_verify": True,
    },
    "znp-robin-nano-dw-v2.2": {
        "mcu": "stm32f401xc",
        "spi_bus": "spi2",
        "cs_pin": "PB12",
        "firmware_path": "ZNP_ROBIN_NANO.bin",
        "current_firmware_path": "ZNP_ROBIN_NANO.CUR",
    },
}

###########################################################
#
# Board Definition Aliases
#
###########################################################

BOARD_ALIASES = {
    "btt-skr-v1.1": BOARD_DEFS["generic-lpc1768"],
    "btt-skr-v1.3": BOARD_DEFS["generic-lpc1768"],
    "btt-skr-v1.4": BOARD_DEFS["generic-lpc1768"],
    "mks-sgenl-v1": BOARD_DEFS["generic-lpc1768"],
    "mks-sbase": BOARD_DEFS["generic-lpc1768"],
    "smoothieboard-v1": BOARD_DEFS["generic-lpc1769"],
    "btt-skr-turbo-v1.4": BOARD_DEFS["generic-lpc1769"],
    "btt-skr-e3-turbo": BOARD_DEFS["generic-lpc1769"],
    "mks-sgenl-v2": BOARD_DEFS["generic-lpc1769"],
    "btt-skr-mini-v1.1": BOARD_DEFS["btt-skr-mini"],
    "btt-skr-mini-e3-v1": BOARD_DEFS["btt-skr-mini"],
    "btt-skr-mini-e3-v1.2": BOARD_DEFS["btt-skr-mini"],
    "btt-skr-mini-e3-v2": BOARD_DEFS["btt-skr-mini"],
    "btt-skr-mini-e3-v3": BOARD_DEFS["btt-skr-mini-v3"],
    "btt-skr-mini-e3-v3-b0": BOARD_DEFS["btt-skr-mini-v3-b0"],
    "btt-skr-mini-mz": BOARD_DEFS["btt-skr-mini"],
    "btt-skr-e3-dip": BOARD_DEFS["btt-skr-mini"],
    "btt002-v1": BOARD_DEFS["btt-skr-mini"],
    "creality-v4.2.7": BOARD_DEFS["creality-v4.2.2"],
    "btt-skr-2-f407": BOARD_DEFS["btt-octopus-f407-v1"],
    "btt-skr-2-f429": BOARD_DEFS["btt-octopus-f429-v1"],
    "btt-octopus-f407-v1.0": BOARD_DEFS["btt-octopus-f407-v1"],
    "btt-octopus-f407-v1.1": BOARD_DEFS["btt-octopus-f407-v1"],
    "btt-octopus-f429-v1.0": BOARD_DEFS["btt-octopus-f429-v1"],
    "btt-octopus-f429-v1.1": BOARD_DEFS["btt-octopus-f429-v1"],
    "btt-octopus-f446-v1.0": BOARD_DEFS["btt-octopus-f446-v1"],
    "btt-octopus-f446-v1.1": BOARD_DEFS["btt-octopus-f446-v1"],
    "btt-octopus-pro-f429-v1.0": BOARD_DEFS["btt-octopus-f429-v1"],
    "btt-octopus-pro-f446-v1.0": BOARD_DEFS["btt-octopus-f446-v1"],
    "btt-octopus-pro-h723-v1.1": BOARD_DEFS["btt-skr-3-h723"],
    "btt-skr-pro-v1.1": BOARD_DEFS["btt-skr-pro"],
    "btt-skr-pro-v1.2": BOARD_DEFS["btt-skr-pro"],
    "btt-gtr-v1": BOARD_DEFS["btt-gtr"],
    "mks-robin-e3d": BOARD_DEFS["mks-robin-e3"],
    "fysetc-cheetah-v2": BOARD_DEFS["fysetc-cheetah"],
    "fysetc-spider-v1": BOARD_DEFS["fysetc-spider"],
    "fysetc-s6-v1.2": BOARD_DEFS["fysetc-spider"],
    "fysetc-s6-v2": BOARD_DEFS["fysetc-spider"],
    "robin_v3": BOARD_DEFS["monster8"],
    "btt-skrat-v1.0": BOARD_DEFS["btt-skrat"],
    "chitu-v6": BOARD_DEFS["chitu-v6"],
}


def list_boards():
    return sorted(list(BOARD_DEFS.keys()) + list(BOARD_ALIASES.keys()))


def lookup_board(name):
    name = name.lower()
    bdef = BOARD_ALIASES.get(name, BOARD_DEFS.get(name, None))
    if bdef is not None:
        return dict(bdef)
    return None