Skip to content

Commit

Permalink
flashsd: Add support for chitu-v6 (#6671) (#416)
Browse files Browse the repository at this point in the history
Add flashsd configuration for Tronxy x5sa and other printers based on
Chitu v6 board.

These boards should support sdio (this is what the schematic details),
however I couldn't get this working from a quick try.

Signed-off-by: Bevan Weiss <[email protected]>
Co-authored-by: Bevan Weiss <[email protected]>
  • Loading branch information
rogerlz and bevanweiss authored Oct 29, 2024
1 parent 9fbc9d5 commit 50da0b4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 20 deletions.
12 changes: 12 additions & 0 deletions scripts/spi_flash/board_defs.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"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",
},
Expand Down Expand Up @@ -97,6 +98,16 @@
"cs_pin": "PC11",
"skip_verify": True,
},
"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,
},
"monster8": {"mcu": "stm32f407xx", "spi_bus": "spi3a", "cs_pin": "PC9"},
"fly-gemini-v2": {"mcu": "stm32f405xx", "spi_bus": "spi1", "cs_pin": "PA4"},
"fysetc-cheetah": {
Expand Down Expand Up @@ -155,6 +166,7 @@
"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"],
}


Expand Down
33 changes: 13 additions & 20 deletions scripts/spi_flash/spi_flash.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,26 +79,19 @@ def translate_serial_to_tty(device):


def check_need_convert(board_name, config):
if board_name.lower().startswith("mks-robin-e3"):
# we need to convert this file
robin_util = os.path.join(
fatfs_lib.KLIPPER_DIR, "scripts/update_mks_robin.py"
)
klipper_bin = config["klipper_bin_path"]
robin_bin = os.path.join(
os.path.dirname(klipper_bin),
os.path.basename(config["firmware_path"]),
)
cmd = "%s %s %s %s" % (
sys.executable,
robin_util,
klipper_bin,
robin_bin,
)
output("Converting Klipper binary to MKS Robin format...")
os.system(cmd)
output_line("Done")
config["klipper_bin_path"] = robin_bin
conv_script = config.get("conversion_script")
if conv_script is None:
return
conv_util = os.path.join(fatfs_lib.KLIPPER_DIR, conv_script)
klipper_bin = config["klipper_bin_path"]
dest_bin = os.path.join(
os.path.dirname(klipper_bin), os.path.basename(config["firmware_path"])
)
cmd = "%s %s %s %s" % (sys.executable, conv_util, klipper_bin, dest_bin)
output("Converting Klipper binary to custom format...")
os.system(cmd)
output_line("Done")
config["klipper_bin_path"] = dest_bin


###########################################################
Expand Down

0 comments on commit 50da0b4

Please sign in to comment.