Skip to content

rssdev10/riden-flashtool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔧 Riden Flash & Calibration Tool

Rust CLI for Riden RD60xx power supplies: firmware flashing, calibration, RTC sync, and memory-preset import/export.

Cross-platform tool for flashing firmware on Riden power supply units.

Originally derived from tjko/riden-flashtool. Calibration workflow inspired by simeonmiteff/cal-riden-psu and fdi.sk/posts/riden-cal.

📋 Supported Models

RD6006, RD6006P, RD6006W, RD6012, RD6012P, RD6018, RD6024, RD6030.

The tool keeps a device table with model-specific voltage/current limits and register decimal scaling so calibration and memory preset JSON files use real units instead of raw register values.

✨ Features

  • Firmware flashing with bootloader auto-switch.
  • Calibration register export/import as JSON.
  • Interactive calibration register editor.
  • Guided calibrate --wizard flow for target and display calibration.
  • Automatic iterative DISPLAY-only calibration via calibrate --auto-display-voltage and calibrate --auto-display-current (no external instrument required, uses the trusted DAC as reference).
  • Custom wizard points via --voltage-min, --voltage-max, --current-min, --current-max.
  • RTC sync with sync-time.
  • Memory preset export/import for M0..M9.
  • Register-map and raw register dumping tools.

📦 Download Pre-built Binaries

Ready-to-use binaries for Windows, Linux, and macOS are available in the Releases section.

💻 Supported Platforms:

  • 🪟 Windows (x64): riden-flashtool-windows-amd64.exe.zip
  • 🐧 Linux (x64): riden-flashtool-linux-amd64.zip
  • 🐧 Linux (ARM64): riden-flashtool-linux-arm64.zip
  • 🍎 macOS (Intel): riden-flashtool-darwin-amd64.zip
  • 🍎 macOS (Apple Silicon): riden-flashtool-darwin-arm64.zip

Each release includes SHA-256 checksums for verification. Simply download, extract, and run!

macOS unsigned binaries

If you run a release binary downloaded from GitHub Releases, macOS may block it because it is not signed with an Apple developer certificate.

xattr -d com.apple.quarantine ./riden-flashtool

If needed, also allow it once from System Settings → Privacy & Security.

🛠️ Build from Source

  1. Install Rust toolchain
  2. Build from source:
cargo build --release
# Binary appears at: ./target/release/riden-flashtool

⚡ Quick Start

# List serial ports
./riden-flashtool list

# Identify the connected PSU
./riden-flashtool info /dev/tty.usbserial-XXXX

# Flash firmware
./riden-flashtool flash /dev/tty.usbserial-XXXX firmware.bin

Commands

list           List candidate serial ports
info           Identify the connected device
flash          Flash firmware
calibrate      Interactive calibration (register editor, --wizard, --auto-display-voltage, --auto-display-current)
cal-export     Export calibration registers to JSON
cal-import     Restore calibration registers from JSON
sync-time      Set device RTC from host clock
memory-export  Export M0..M9 memory presets to JSON
memory-import  Restore M0..M9 memory presets from JSON
dump-regs      Read a range of holding registers
register-map   Print the documented Riden Modbus register map

🔧 Calibration

Always export a backup before modifying calibration registers:

./riden-flashtool cal-export /dev/tty.usbserial-XXXX --file ./backups/

Restore a saved calibration:

./riden-flashtool cal-import /dev/tty.usbserial-XXXX calibration.json

For the full calibration guide — wizard flow, automatic DISPLAY calibration, register descriptions, and formulas — see docs/calibration.md.

Memory Presets

Export all memory presets:

./riden-flashtool memory-export /dev/tty.usbserial-XXXX --file presets.json
./riden-flashtool memory-export /dev/tty.usbserial-XXXX --file ./presets/

Restore them later:

./riden-flashtool memory-import /dev/tty.usbserial-XXXX presets.json --yes

The JSON file stores V, I, OVP, and OCP in real units plus the source model id so cross-device restores are explicit.

RTC Sync

./riden-flashtool sync-time /dev/tty.usbserial-XXXX

The tool reads RTC registers 48..53, writes host time, then verifies the result.

Register Map

./riden-flashtool register-map

This prints the documented Riden holding-register map along with the internal variant table used by the tool.

🔩 Firmware Flashing

Flash a firmware file (the tool auto-switches the device into bootloader mode if needed):

./riden-flashtool flash /dev/tty.usbserial-XXXX firmware.bin

⚠️ Force mode (DANGEROUS — bypasses model checks):

./riden-flashtool flash /dev/tty.usbserial-XXXX firmware.bin --force

⚠️ CRITICAL WARNINGS: -- May permanently brick your device if firmware is incompatible

  • No warranty or support provided for forced operations
  • Use at your own risk - you may render your device unusable
  • Only for advanced users who understand the consequences

Safer alternatives:

  • Wait for official support for your device model
  • Contact the developer to request support for new models
  • Use only firmware specifically designed for your exact device model

📄 Example Output

Serial port: /dev/ttyUSB0 (115200bps)
Firmware size: 109888 bytes
Check if device in bootloader... No
Found device: RD6006 (60062) v1.40
Rebooting to bootloader...
Device info (bootloader):
    Model: RD6006 (60062)
    Firmware: v1.40
    S/N: 000xxxxx
Updating firmware...b'OK'
Firmware update complete.

🆘 Recovery Mode

If device fails to boot after flashing:

  1. Manual bootloader entry: Press/hold ENTER while powering on unit
  2. Re-run flashtool with firmware file

Custom Baud Rate

Override the default 115200 baud rate:

./riden-flashtool --speed 9600 list
./riden-flashtool --speed 9600 info /dev/tty.usbserial-XXXX
./riden-flashtool --speed 9600 flash /dev/tty.usbserial-XXXX firmware.bin

Troubleshooting

Device not responding:

  • Verify "Interface" setting is USB in PSU menu
  • Connect directly to computer (avoid USB hubs)
  • On Linux, ensure serial port permissions: sudo usermod -aG dialout $USER
  • Use /dev/tty.usbserial-... on macOS rather than /dev/cu....

Calibration not persistent:

  • Check that register 54 write succeeded (commit magic 0x1501)
  • Use --verbose to see raw Modbus traffic for debugging

Calibration taking too long:

  • The tool now flushes and reopens the port automatically between interactive prompts to prevent buffer stale issues

Failed firmware flashing:

  • Try again in bootloader mode (press/hold ENTER while powering on)

License

MIT. See LICENSE.txt.

About

Riden RD60xx Firmware Flash Tool

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages