Warning
This project is not thoroughly tested yet!
Reliably read, write and erase flash memory for Telink Zigbee boards (eg. TLSR8258) with just a USB-to-serial converter.
D:\Progetti\tuyaZigbee\Telink Zigbee serial flash tool>Telink_Tools.py
Telink_Tools.py v0.2 dev Suxsem
usage: Telink_Tools.py [-h] [--port PORT] {write_flash,read_flash,erase_flash} ...
Telink_Tools.py v0.2 dev Suxsem - Telink Zigbee serial flash tool - edit by Suxsem
positional arguments:
{write_flash,read_flash,erase_flash}
Run Telink_Tools.py -h for additional help
write_flash Write data to flash
read_flash Read flash
erase_flash erase 4K (a sector)
options:
-h, --help show this help message and exit
--port, -p PORT Serial port device

Clone or download the repository and execute Telink_Tools.py in a system with Python installed.
1 MB flash
Telink_Tools.py -p COM3 read_flash 0 1048576 dump.bin
512 KB flash
Telink_Tools.py -p COM3 read_flash 0 524288 dump.bin
Telink_Tools.py -p COM3 erase_flash 0 3
Note
The flash must be erased before writing.
Compute the number of minimum sectors to be erased (1 sector = 4 KB).
Telink_Tools.py -p COM3 erase_flash 0 31
Telink_Tools.py -p COM3 write_flash 0 motionSensor_TS0202.bin