Command Line Flashing Guide
Firmware Flashing Module
On Linux systems, first set serial port permissions with the following command to avoid errors:
sudo usermod -aG dialout $USER
Note
System reboot required after configuration.
Run
tos flash
command in compiled project directory for one-click flashing. The command automatically downloads tyutool and performs flashing:
cd apps/tuya_cloud/switch_demo
tos flash
tyutool params:
[INFO]: tyut_logger init done.
[INFO]: Run Tuya Uart Tool.
[INFO]: Use default baudrate: [921600]
[INFO]: Use default start address: [0x00]
--------------------
1. /dev/ttyS0
2. /dev/ttyACM0
3. /dev/ttyACM1
^^^^^^^^^^^^^^^^^^^^
Select serial port: 3
[INFO]: Waiting Reset ...
[INFO]: unprotect flash OK.
[INFO]: sync baudrate 921600 success
Erasing: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 4 bytes/s 0:00:04 / 0:00:00
[INFO]: Erase flash success
Writing: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 16 bytes/s 0:00:18 / 0:00:00
[INFO]: Write flash success
[INFO]: CRC check success
[INFO]: Reboot done
[INFO]: Flash write success.
Attention
Chip must enter boot mode before flashing. If serial port is unresponsive, check port selection or potential conflicts.
tos flash tool keeps adding support for new chips. Versions before v1.8.0 require manual upgrades:
Check version:
tos flash --version
Example output:
tyuTool, version 1.8.3
For versions prior to v1.8.0, manually upgrade with:
tos flash upgrade