Controller and firmware rebuild

Board: BTT Scylla V1.0, STM32H723. Firmware: grblHAL with the STM32H7xx driver. The current production firmware settings are recorded in the motion, inputs, and spindle guides. This page documents the rebuild recipe.

Source and build tools

Clone the public dresco/STM32H7xx driver into its own folder. These are setup commands to run when preparing the build environment; they have not been run as part of this guide:

mkdir -p ~/cnc-firmware
cd ~/cnc-firmware
git clone https://github.com/dresco/STM32H7xx.git
cd STM32H7xx
git submodule update --init --recursive

Install PlatformIO Core (CLI), for example with pipx install platformio, and confirm pio --version. A plain upstream clone does not contain the custom build environment and configuration below; apply those required edits to platformio.ini before building.

The recorded driver source reference is bfe5d4f; its grbl submodule is 2bdfeb1, motors 7567c34, trinamic 9b30417, sdcard 2d6d4f6, plugins 3af2119, and spindle 3018480. These references document the source used for the recorded build; they do not by themselves reproduce the custom configuration.

Configuration and build

In STM32H7xx/platformio.ini, select btt_scylla_h723_tmc5160_dualy_pwm_bl128. It inherits common H723, USB-CDC and SD-card settings, uses board generic_stm32h723vg and linker script STM32H723VGTX_BL_FLASH.ld, and adds:

-D BOARD_BTT_SCYLLA
-D HSE_VALUE=25000000
-D TRINAMIC_ENABLE=5160
-D Y_AUTO_SQUARE=1
-D SPINDLE0_ENABLE=SPINDLE_PWM0
-D ESTOP_ENABLE=1
-D CONTROL_ENABLE=CONTROL_ESTOP
-D TOOLSETTER_ENABLE=1
-D PROBE_ENABLE=1

Configure platformio.ini with the custom Scylla dual-Y PWM environments (with and without the 128 KB bootloader offset), dual-Y Modbus-VFD environments, and H723 USB dependency entries using symlink://. These are required configuration edits, not files supplied by the upstream clone. The SD-card recipe uses the _bl128 environment; the non-offset btt_scylla_h723_tmc5160_dualy_pwm environment is for direct programming, not the normal bootloader SD-card method.

Build from the driver directory:

cd ~/cnc-firmware/STM32H7xx
pio run -e btt_scylla_h723_tmc5160_dualy_pwm_bl128

The SD-card image is .pio/build/btt_scylla_h723_tmc5160_dualy_pwm_bl128/firmware.bin. The direct programming environment outputs .pio/build/btt_scylla_h723_tmc5160_dualy_pwm/firmware.bin.

Flash and identify

For the SD-card bootloader procedure, copy the _bl128 firmware.bin to the root of a FAT32 SD card, power off the controller, insert the card, then power on and allow the bootloader to flash. Use the board manual and a matching image.

The current production configuration uses $14=0, $22=5, $36=73; steps/mm X/Y/Z 320/320/800; travel 1240/800/295 mm; rates 12000/12000/3000 mm/min; and acceleration 500/500/100 mm/s². After flashing, reconnect the sender and query $I. The expected identity includes [FIRMWARE:grblHAL], [DRIVER:STM32H723@480MHz], [BOARD:BTT Scylla], [PLUGIN:Trinamic v0.33], and [PLUGIN:SDCARD v1.27]. Query M122 to check for TMC5160 on X, Y, Z and Y2. Confirm the pin map with $pins; the recorded E-stop/toolsetter assignments are PC6 and PE7 respectively. Check the installed controller's responses and pin map before any motion. A successful local build is not evidence that it was flashed or is the image currently installed.

See the historical firmware notes for background.