pvvx / TLSRPGM

TLSR SWire programmer
Other
50 stars 5 forks source link

Read OK, but can't write/erase. No error. Write protected? #6

Closed wiredcow closed 7 months ago

wiredcow commented 7 months ago

Hi!

I'm trying to use TlsrPgm (with TB-03-KIT) to flash a new firmware to a TS0202 motion sensor (https://github.com/Suxsem/TS0202-PIR-Sensor-Zigbee-firmware).

I can read the flash OK...

TlsrPgm.py -w -a 100 -p COM9 rf 0 0x100000 dump.bin
=======================================================
TLSR82xx TlsrPgm version 27.04.21
-------------------------------------------------------
Open COM9, 230400 bit/s... ok
PGM: ChipID: 0x5562 (TLSR825x), ver: 0.0.0.1
swdiv 5, addrlen 3, swbuf [5a 00 06 02 00 05], pwr On
SWire bit rate: 0.9600 Mbits/s
=== PreProcess ========================================
Hard reset Ext.MCU 50 ms... ok
Activate 100 ms... ok
CPU PC=0x00000000
=== Process ===========================================
Outfile: dump.bin
Read Flash from 0x000000 to 0x100000...
 Worked Time: 66.076 sec

I verify that the dump file is OK by looking for ID strings (TS0202, TZ3000). The new firmware has a different ID (My_TS0202, Suxsem).

But writing...

TlsrPgm.py -w -a 100 -p COM9 we 0 motionSensor_TS0202_1.0.bin
=======================================================
TLSR82xx TlsrPgm version 27.04.21
-------------------------------------------------------
Open COM9, 230400 bit/s... ok
PGM: ChipID: 0x5562 (TLSR825x), ver: 0.0.0.1
swdiv 5, addrlen 3, swbuf [5a 00 06 02 00 05], pwr On
SWire bit rate: 0.9600 Mbits/s
=== PreProcess ========================================
Hard reset Ext.MCU 50 ms... ok
Activate 100 ms... ok
CPU PC=0x00000000
=== Process ===========================================
Inputfile: motionSensor_TS0202_1.0.bin
Write Flash data 0x00000000 to 0x0001e7e4...
 Worked Time: 10.799 sec

It looks like it worked, but nothing was actually written. If I read the flash again, I get the old firmware.

I also tried to erase all...

TlsrPgm.py -w -a 100 -p COM9 ea
=======================================================
TLSR82xx TlsrPgm version 27.04.21
-------------------------------------------------------
Open COM9, 230400 bit/s... ok
PGM: ChipID: 0x5562 (TLSR825x), ver: 0.0.0.1
swdiv 5, addrlen 3, swbuf [5a 00 06 02 00 05], pwr On
SWire bit rate: 0.9600 Mbits/s
=== PreProcess ========================================
Hard reset Ext.MCU 50 ms... ok
Activate 100 ms... ok
CPU PC=0x00000000
=== Process ===========================================
Erase All Flash ...
 Worked Time: 0.334 sec

Again, when I read the flash after this to verify, no change.

Even after that "erase all", the motion sensor still works, like nothing happened.

Maybe it's write protected? Any suggestions what I should do?

1 2

pvvx commented 7 months ago

Update version (31.10.23). Has built-in write protection removal.

wiredcow commented 7 months ago

The updated version works. Thank you!