Help with TSDZ2 programming

Get all your technical information about electric bikes here.
Post Reply
Biggsy   10 mW

10 mW
Posts: 28
Joined: Oct 05 2018 2:42pm

Help with TSDZ2 programming

Post by Biggsy » Aug 22 2019 2:11am

Really hoping that someone could help me get back on the road with my tsdz2.

I installed it and found that the low cadence that it works at is unbearable for me, so started down the route of flashing the open source upgrade, which sounds like it will make this motor work exactly how I need it to.

I took hours and finally managed to flash the LCD 3. I found it very difficult to get a good wire connection between st link and the screen, though finally got there.

I am now having the same problem I think when flashing the motor. I've cut the speed sensor cable on the motor and have spent hours trying to get a good connection between st link and motor, but even when I was sure I had a good connection I got the error on the pc, cannot communicate with device.

I'd be really happy just to purchase a new upgraded controller but can't find one inside of Europe. I contacted a couple of dealers I the US but haven't heard back.

Does anyone know where I could source one in the EU, or have any quick tips on connecting my st link and getting the job done?

Thanks so much for taking the time to read.

Biggsy
France

Aquakitty   100 W

100 W
Posts: 150
Joined: Jun 10 2017 3:07pm

Re: Help with TSDZ2 programming

Post by Aquakitty » Aug 22 2019 12:57pm

Can you post a pic of your connector?

You have brown > RST, black > SWIM, orange > ground and red > 5v? Also are you on Windows or Mac?

Also check that the actual USB plug on the ST-Link isn't loose. I had to resolder mine on because it was so crappy. Changing out the controller is probably more work than just flashing your motor, you are so close! For reference my connector is only about 4 inches long.
Rans Enduro Sport w/Sturmey-Archer XFRD8, TSDZ2 open source mod 48v
GT Verb Comp f/s TSDZ2 open source 48v
Diadora Ampio bargain f/s TSDZ2 48v
2020 Diamant 247 belt drive 1000w 9C 48v
Hardtail made from random bits I had laying around, ginormous old Marzocchi fork, BBS02

James Broadhurst   10 W

10 W
Posts: 73
Joined: Nov 10 2016 3:29pm
Location: Oxford, England

Re: Help with TSDZ2 programming

Post by James Broadhurst » Aug 25 2019 1:54am

RST should not be connected when flashing the motor and only connect Vcc (brown wire) if your bike’s battery is disconnected. Thus at most 3 wires to connect. Very frustrating this job if you don’t do this sort of thing day in, day out. Just slow down and take care!

Biggsy   10 mW

10 mW
Posts: 28
Joined: Oct 05 2018 2:42pm

Re: Help with TSDZ2 programming

Post by Biggsy » Aug 25 2019 7:56am

Thanks a lot guys.

My cable has six wires.
Black
Brown
Orange
white
green
purple

Just to be clear its the cable to the motor I opened up, planning to re-soulder inside the motor afterwards.
I've taken the motor off of the bike to make the whole fiddly process a bit easier.
Aquakitty, your scheme is a bit different to the one on the opensource website and I dont have a red wire.
Aquakitty wrote:
Aug 22 2019 12:57pm
Can you post a pic of your connector?

You have brown > RST, black > SWIM, orange > ground and red > 5v? Also are you on Windows or Mac?
I have been connecting Black to swim, orange to Gnd, purple to RST and brown to 5v.
The connectors are a disaster to keep tight, but at one stage I was sure I was there and it still didn't work.
Always the same error message.
I am using windows 10, and when trying to update drivers for the st link, windows tells me the driver package has nothing for my computer.
James Broadhurst wrote:
Aug 25 2019 1:54am
RST should not be connected when flashing the motor and only connect Vcc (brown wire) if your bike’s battery is disconnected. Thus at most 3 wires to connect. Very frustrating this job if you don’t do this sort of thing day in, day out. Just slow down and take care!
james are you suggesting brown 5V, Black swim and Orange ground?

Thanks a lot for your help!

Aquakitty   100 W

100 W
Posts: 150
Joined: Jun 10 2017 3:07pm

Re: Help with TSDZ2 programming

Post by Aquakitty » Aug 25 2019 12:32pm

Biggsy wrote:
Aug 25 2019 7:56am
Thanks a lot guys.

My cable has six wires.
Black
Brown
Orange
white
green
purple

Just to be clear its the cable to the motor I opened up, planning to re-soulder inside the motor afterwards.
I've taken the motor off of the bike to make the whole fiddly process a bit easier.
Aquakitty, your scheme is a bit different to the one on the opensource website and I dont have a red wire.
Aquakitty wrote:
Aug 22 2019 12:57pm
Can you post a pic of your connector?

You have brown > RST, black > SWIM, orange > ground and red > 5v? Also are you on Windows or Mac?
I have been connecting Black to swim, orange to Gnd, purple to RST and brown to 5v.
The connectors are a disaster to keep tight, but at one stage I was sure I was there and it still didn't work.
Always the same error message.
I am using windows 10, and when trying to update drivers for the st link, windows tells me the driver package has nothing for my computer.
James Broadhurst wrote:
Aug 25 2019 1:54am
RST should not be connected when flashing the motor and only connect Vcc (brown wire) if your bike’s battery is disconnected. Thus at most 3 wires to connect. Very frustrating this job if you don’t do this sort of thing day in, day out. Just slow down and take care!
james are you suggesting brown 5V, Black swim and Orange ground?

Thanks a lot for your help!
You don't need the RST on Windows, but it won't hurt anything. I was told you need it on Mac, which is why I asked. I don't use Mac.
The 5v provides power if you don't have the motor connected to the battery. If the motor is connected to the ebike battery, you don't need it either.
A pic of your connector would help. What exactly are you having trouble "keeping tight"?
Rans Enduro Sport w/Sturmey-Archer XFRD8, TSDZ2 open source mod 48v
GT Verb Comp f/s TSDZ2 open source 48v
Diadora Ampio bargain f/s TSDZ2 48v
2020 Diamant 247 belt drive 1000w 9C 48v
Hardtail made from random bits I had laying around, ginormous old Marzocchi fork, BBS02

Biggsy   10 mW

10 mW
Posts: 28
Joined: Oct 05 2018 2:42pm

Re: Help with TSDZ2 programming

Post by Biggsy » Aug 25 2019 1:47pm

Thanks for getting back to us Aquakitty.
Potentially my connections are fine but maybe the drivers for the ST link are not correct, or conflicting choice of wires to connect.

I did have a similar problem for a long time in flashing the screen, but eventually got there. I am losing hope that this will work.
I've go a bunch of the yellow ST link keys and most have the same printing on the outside, but one has swim and ground in a different spot.

I do appreciate your experience with this, if I don't get there I'll be stuck using the car next week for my 300km commute per week :cry:
Aquakitty wrote:
Aug 22 2019 12:57pm
Can you post a pic of your connector?
tsdz2 connections.jpg
tsdz2 connections.jpg (270.88 KiB) Viewed 665 times

James Broadhurst   10 W

10 W
Posts: 73
Joined: Nov 10 2016 3:29pm
Location: Oxford, England

Re: Help with TSDZ2 programming

Post by James Broadhurst » Aug 25 2019 1:53pm

james are you suggesting brown 5V, Black swim and Orange ground?

Thanks a lot for your help!
Yes

Here’s the wiki
https://github.com/OpenSource-EBike-fir ... e-on-TSDZ2

sfwebcom   10 µW

10 µW
Posts: 6
Joined: Aug 26 2019 8:51am

Re: Help with TSDZ2 programming

Post by sfwebcom » Aug 28 2019 5:15am

Hello..!
i have the same problem...Communication error flashing the motor ctrl.....

flashed lcd3 in a few minutes all ok.

is very frustrating!

there is no way to flash the motor ctrl......

i'll try with another 2 different st link v2 keys and let you knoe results...!

tks to all.

sfwebcom   10 µW

10 µW
Posts: 6
Joined: Aug 26 2019 8:51am

FOUND SOLUTION!!!: Help with TSDZ2 programming

Post by sfwebcom » Aug 28 2019 5:56am

Hi guys,

found solution!!! :bigthumb:

the cables programming between usb keys and speed sensor connector was too long!!!!!

i've used a 15 cm cable and now all it's ok!!!

Communication error disappear...!!!!

tks to all! :mrgreen:

Biggsy   10 mW

10 mW
Posts: 28
Joined: Oct 05 2018 2:42pm

Re: Help with TSDZ2 programming

Post by Biggsy » Sep 01 2019 1:50pm

Ok, I spent 4 more hours today, I am ready to put this thing in the bin.

So I got the TSDZ2 then got a 52 volt battery from em3ev but hadn't thought of the voltage problem.
I cant use the motor at all.
I flashed the screen, slowly but got there.
The motor is impossible;
things I've tried:
5 different st link usb sticks.
Different wiring techniques;
2 different computers
No sketchy chinese wires at all, soldering TSDZ2 directly to the usb st link.
Battery to motor and simply orange to ground, black to swim.

Always the same message- cannot communicate with device.
It's such a disappointment because I had hopes of doing 350km per week on the bike and leaving the car home for my commute.

I hope somebody can give me a magic wand or something, or even sell me a readily flashed controller, before I smash this thing with a hammer.
I'd happily pay for a new controller and shipping to France.
Thanks a lot for anything somebody could do to help.

Biggsy   10 mW

10 mW
Posts: 28
Joined: Oct 05 2018 2:42pm

Re: Help with TSDZ2 programming

Post by Biggsy » Sep 01 2019 2:34pm

sfwebcom wrote:
Aug 28 2019 5:56am
ound solution!!!
James Broadhurst wrote:
Aug 25 2019 1:53pm
Yes

Here’s the wiki
Biggsy wrote:
Aug 25 2019 7:56am
If the motor is connected to the ebike battery, you don't need it either.
A pic of your connector would help. What exactly are you having trouble "keeping tight"?
anything to add guys? You are my gurus!

sfwebcom   10 µW

10 µW
Posts: 6
Joined: Aug 26 2019 8:51am

Re: Help with TSDZ2 programming

Post by sfwebcom » Sep 04 2019 6:51am

i've solved the problem only with a very short cable (maube less than 10 cm) between usb stick and speed connector......looking in front the connector 5 v on top, ground left bottom e swim right bottom...that's all.(wiki instruction)

try with 5 cm programming cable and a long usb male/female cable to connect usb stick to your pc....

let us know.

Aquakitty   100 W

100 W
Posts: 150
Joined: Jun 10 2017 3:07pm

Re: Help with TSDZ2 programming

Post by Aquakitty » Sep 04 2019 9:28pm

Biggsy wrote:
Sep 01 2019 2:34pm
sfwebcom wrote:
Aug 28 2019 5:56am
ound solution!!!
James Broadhurst wrote:
Aug 25 2019 1:53pm
Yes

Here’s the wiki
Biggsy wrote:
Aug 25 2019 7:56am
If the motor is connected to the ebike battery, you don't need it either.
A pic of your connector would help. What exactly are you having trouble "keeping tight"?
anything to add guys? You are my gurus!
The two major things that could be causing this are 1) your connector is too long. My wires are like 3cm total. 2) The ST-Link V2 you received is a dud. On the wiki you'll notice he suggests buying multiples from different vendors because sometimes they are just garbage. Mine, for instance, stopped working because the USB connector was soldered badly (was an easy fix myself).

Bigsy, looking at your pic (sorry I didn't reply sooner) that connector is possibly too long for the motor connection.

Sorry about my original post on the colours, I accidentally looked at the connected wire not the original wire thus the red should be brown. It should be orange > ground, black > SWIM, brown > 5v . Here is a pic of my connectors that work fine:
IMG_20190904_191836.jpg
IMG_20190904_191836.jpg (142.78 KiB) Viewed 557 times
Note the long one is for the LCD, and I had to make the motor one that short to work.

Also why are your ST-Link keys yellow not blue? Just a different vendor or?
Rans Enduro Sport w/Sturmey-Archer XFRD8, TSDZ2 open source mod 48v
GT Verb Comp f/s TSDZ2 open source 48v
Diadora Ampio bargain f/s TSDZ2 48v
2020 Diamant 247 belt drive 1000w 9C 48v
Hardtail made from random bits I had laying around, ginormous old Marzocchi fork, BBS02

James Broadhurst   10 W

10 W
Posts: 73
Joined: Nov 10 2016 3:29pm
Location: Oxford, England

Re: Help with TSDZ2 programming

Post by James Broadhurst » Sep 05 2019 7:40am

Do you configure the ST-link programme with STM8S105x6? And when you do does the little led on the USB link flash blue or red? (clutching at straws ... ) Aqua’s suggestion is worth following. With 2 of these links I have each wired for the lcd and the other the motor. I was lucky, both worked.

Biggsy   10 mW

10 mW
Posts: 28
Joined: Oct 05 2018 2:42pm

Re: Help with TSDZ2 programming

Post by Biggsy » Sep 06 2019 5:00am

sfwebcom wrote:
Sep 04 2019 6:51am
i've solved the problem only with a very short cable (maube less than 10 cm) between usb stick and speed connector......looking in front the connector 5 v on top, ground left bottom e swim right bottom...that's all.(wiki instruction)
Thanks sfwebcom, you might have just given me the detail that justifies trying again for a few more hours.
My interpretation, of the ST link print is the other way around.
RST and SWIM pins totally look on the diagram like they should be the top row, not the bottom.
I am also now keeping the battery connected to avoid 3 connections the the usb stick.

Biggsy   10 mW

10 mW
Posts: 28
Joined: Oct 05 2018 2:42pm

Re: Help with TSDZ2 programming

Post by Biggsy » Sep 06 2019 5:07am

Aquakitty wrote:
Sep 04 2019 9:28pm
Biggsy wrote:
Sep 01 2019 2:34pm
sfwebcom wrote:
Aug 28 2019 5:56am
ound solution!!!
James Broadhurst wrote:
Aug 25 2019 1:53pm
Yes

Here’s the wiki
Biggsy wrote:
Aug 25 2019 7:56am
If the motor is connected to the ebike battery, you don't need it either.
A pic of your connector would help. What exactly are you having trouble "keeping tight"?
anything to add guys? You are my gurus!
The two major things that could be causing this are 1) your connector is too long. My wires are like 3cm total. 2) The ST-Link V2 you received is a dud. On the wiki you'll notice he suggests buying multiples from different vendors because sometimes they are just garbage. Mine, for instance, stopped working because the USB connector was soldered badly (was an easy fix myself).

Bigsy, looking at your pic (sorry I didn't reply sooner) that connector is possibly too long for the motor connection.

Sorry about my original post on the colours, I accidentally looked at the connected wire not the original wire thus the red should be brown. It should be orange > ground, black > SWIM, brown > 5v . Here is a pic of my connectors that work fine:

IMG_20190904_191836.jpg

Note the long one is for the LCD, and I had to make the motor one that short to work.

Also why are your ST-Link keys yellow not blue? Just a different vendor or?
Thanks Aquakitty,
I am now connecting the controller cables direct to the usb to try to get around the length of wires.
I've got 5 different yellow ST Links and one blue one.
They are all but one printed the same. strangely one of the yellow ones has rst and swim the other way around.
I had wondered about my reading of the print and assumed that the top row of connections is SWIM, GND 5V etc
Did you win by using the top or pottom row of pins?

Thanks again!

Post Reply