pvvx / TLSRPGM

TLSR SWire programmer
Other
45 stars 4 forks source link

Error get version floader! #4

Closed MagnusErler closed 8 months ago

MagnusErler commented 8 months ago

I'm following tb-0x-kit-pgm but am receiving the following error when executing the command.

python3 TlsrComProg.py -p /dev/ttyUSB1 -t10000 we 0 /home/magnus/repo/TLSRPGM/sources/UART2SWire/uart2swire.bin 
================================================
TLSR825x Floader version 25.10.23
------------------------------------------------
Open /dev/ttyUSB1, 230400 baud...
Reset module (RTS low)...
Activate (10000 ms)...
Warning: Wrong RX-TX connection?
Connection...
Load <floader.bin> to 0x40000...
Bin bytes writen: 1960
CPU go Start...
------------------------------------------------
Get version floader...
Error get version floader!

I have a TB-03F-KIT and have connected SWS to pin 2 of CH340

It may have something to do with Warning: Wrong RX-TX connection?

pvvx commented 8 months ago

Linux always has problems with any adapters. Everything works great on Windows.

pvvx commented 8 months ago

https://github.com/pvvx/TlsrComProg825x - Workaround for Linux Errors

root@nanopi-r1:~/tlsr# python3 TlsrComProg.py -p /dev/ttyUSB0  rf 0 0x10000 d.bin
================================================
TLSR825x Floader version 25.10.23
------------------------------------------------
Open /dev/ttyUSB0, 230400 baud...
Reset module (RTS low)...
Activate (600 ms)...
Warning: Wrong RX-TX connection?
Connection...
Load <floader.bin> to 0x40000...
Bin bytes writen: 1960
CPU go Start...
------------------------------------------------
ChipID: 0x5562 (TLSR8253), Floader ver: 1.1
Flash JEDEC ID: c86013, Size: 512 kbytes
------------------------------------------------
Read Flash from 0x000000 to 0x010000...
Outfile: d.bin
------------------------------------------------
(1) Warning
MagnusErler commented 8 months ago

I wrote the TLSRPGM program to TB-03F-KIT with a Windows machine and then tried it again with a Linux machine - it seems to work now.

python TlsrPgm.py -s -p/dev/ttyUSB1 i
=======================================================
TLSR82xx TlsrPgm version 12.11.23
-------------------------------------------------------
Open /dev/ttyUSB1, 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 ========================================
CPU Stop... ok
=== Process ===========================================
Chip TLSR825x ID: 0x5562, rev: 0x02
CPU PC=0x00000000 ([0x0602] = 0x05)
Flash JEDEC ID: 0xC86014, Size: 1024 kbytes
Flash Status Register: 0x1c
-------------------------------------------------------
FLASH UID:
000000: 41 50 32 4b 32 39 39 16 01 04 00 66 ff ff ff ff 
000010: c8 01 ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
-------------------------------------------------------
FLASH:
000000: 41 80 00 00 00 00 00 00 4b 4e 4c 54 00 08 88 00 
000010: ae 80 00 00 00 00 00 00 0c 6a 00 00 00 00 00 00 
-------------------------------------------------------
ANALOG REGISTERS:
000000: 48 4c a2 4f 48 02 ff 1d 05 00 00 38 c6 80 00 54 
000010: 0c c0 00 00 00 00 00 00 00 00 00 00 00 00 00 40 
000020: 54 00 00 00 00 00 00 00 00 00 00 2e 1f 15 00 00 
000030: 20 0e 63 80 80 20 00 00 00 ff 00 00 00 00 00 00 
000040: cb 50 1d 00 80 00 00 00 00 00 00 00 ff ff ff 0f 
000050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
000060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
000070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 
000080: 48 4c a2 4f 48 02 ff 1d 05 00 00 38 c6 80 00 54 
000090: 0c c0 00 00 00 00 00 00 00 00 00 00 00 00 00 40 
0000a0: 54 00 00 00 00 00 00 00 00 00 00 2e 1f 15 00 00 
0000b0: 20 0e 63 80 80 20 00 00 00 ff 00 00 00 00 00 00 
0000c0: e4 50 1d 00 80 00 00 00 00 00 00 00 ff ff ff 0f 
0000d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
0000e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
0000f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 
-------------------------------------------------------
REGISTERS:
000060: 00 00 c0 ff 1f 37 20 00 02 00 02 00 01 02 1f 00 
000070: 00 04 00 04 00 00 00 00 00 00 00 64 00 02 62 55 

Your suggested workaround for Linux to write the program however didn't work for me

pvvx commented 8 months ago

In Linux there are problems with setting wait timeouts for COM ports.