Difficulty re-flashing TSDZ2b - Ultimately successful, but why so many errors?

gazzer

1 µW
Joined
Aug 5, 2023
Messages
3
Location
North Carolina
A few weeks ago, a fault with my TSZD2b/860c/OSF rendered it non-functional. A bit of research here led me to the likelihood that the controller's Option Byte was corrupted. I was able to finally resolve the issue by re-flashing the Option Byte; however it was rather tedious due to all of the error messages I was getting. I've added snippets of the log file below showing the pertinent messages, which show, in my mind, flaky communication through the ST-link v2 clone I was using. I must have attempted reprogramming 10 times until success.

So my question, finally: Is this communication issue/error train caused by the STLink device? Wiring connection was short and I verified all of the pins? I did try a different STLink device with the same flaky results. Also tried 3.3v and also with and without the SWIM-RST wire. I have 2 additional STLink v2 devices that I have not yet tried, but they are all visibly the same so I'd expect the same behavior.

If my difficulty was related to the STLink device(s), can anyone recommend one that would be reliable? Thanks much.

---------------------------------------------------------------------

> Reading OPTION BYTE area...
Error on Option Bytes (complementary bytes). Reprogram Option Bytes of device
< OPTION BYTE reading failed.

> Loading file E:\s-trike-option.s19 in OPTION BYTE area ...
< File successfully loaded. File Checksum 0x20
> Programming OPTION BYTE area...
Cannot communicate with the device !
Check the SWIM cable connection and check all the needed pin connections on the SWIM connector.
If the application code uses Swim Disable and Reset pin as Output or has disabled SWIM Clock Divider: Try Now to SWITCH OFF and ON the application Power Supply while NRST Reset pin is forced low.

< OPTION BYTE programming failed.
Error on Option Bytes (complementary bytes). Reprogram Option Bytes of device
Problem while trying to Reset swim and device. Apply a Power On Reset

Error : < OPTION BYTE programming failed.
> Programming OPTION BYTE area...
Error : Error checking device ! Check the configuration or the device !

> Programming OPTION BYTE area...
Programming failed on Option Byte
< OPTION BYTE programming failed.

> Reading OPTION BYTE area...
Wrong device selected ! Check the configuration or the device !
< OPTION BYTE reading failed.

> Programming OPTION BYTE area...
Error : Error checking device ! Check the configuration or the device !
Error : < OPTION BYTE programming failed.

> Programming OPTION BYTE area...
Error : Error checking device ! Check the configuration or the device !
Error : < OPTION BYTE programming failed.

> Programming OPTION BYTE area...
Error : Wrong device selected ! Check the configuration or the device !
Error : Programming failed on Option Byte
Error : < OPTION BYTE programming failed.

> Programming OPTION BYTE area...
< OPTION BYTE programming completed.
> Verifying OPTION BYTE area...
< OPTION BYTE successfully verified.g failed.

> Programming OPTION BYTE area...
Wrong device selected ! Check the configuration or the device !

Programming failed on Option Byte
< OPTION BYTE programming failed.

> Programming OPTION BYTE area...
< OPTION BYTE programming completed.

> Verifying OPTION BYTE area...
< OPTION BYTE successfully verified.


Yay

 
It can be flaky. I can usually tell when I plug the USB side of the STM into my PC and there is no audio response of it detecting a new USB device. Then I'll unplug the STM from the bike. So far, it all works after that,

It is interesting that the embrusa tool does not write the Option Byte. I try to avoid reloading the firmware, Never know how long the STM will work, I bought mine from eco-cycles before he shut down. I just ordered a 5 pin cable from aliexpress, since I have another STM module to make a new one.
 
Thanks. I'm making up a new shorter cable and will experiment with the 4 clones that I've purchased. Hopeful that I'll find one that works better than the others.

Re: the Option Byte - my understanding (which is rather limited) is that this defines how the controller responds to commands to read or program the other areas. Once loaded successfully, there should be no need to mess with it unless corrupted.

Thanks again
 
Thanks for the info on the Option byte. I've got a never used TSDZ2 controller board. WIll have to see how the option byte data differs, providing that reading it doesn't alter it,

By the way, I went to reprogram my TSDZ2 and wouldn't you know, it stopped responding after I changed a value and went for a ride. Unplugged everything, restarted the programs and whew, it came back.
 
I have a similar problem and am wondering if you have any advice. This is the third time in 2.5 years that my TSZD2b/860c/OSF setup has crashed. Like the prior two times, the screen will start but get stuck on the startup screen with a message "error brakes or coms." The prior two times, the solution was to reflash the option byte file with STVP by connecting to the motor via the speed sensor cable with an ST-Link cable. This time, when I set it up exactly as I have before, the STVP won't connect to the motor. It gives me the following error message over and over--the same error I get if I try to run the "read" function (or any other) when there's nothing at all plugged into the cable.

Cannot communicate with the device !
Check the SWIM cable connection and check all the needed pin connections on the SWIM connector.
If the application code uses Swim Disable and Reset pin as Output or has disabled SWIM Clock Divider: Try Now to SWITCH OFF and ON the application Power Supply while NRST Reset pin is forced low.

The ST-Link cable appears fine. The cables coming from the motor all appear fine.
Do you have any advice? (or even if you don't have suggestions on how to fix it, any advice about what kind of professional I need to find to help?)
Thanks!
 
Back
Top