Experiences with Open Source Firmware on the Tongsheng TSDZ2

TJS109

Pedelecer
Sep 29, 2017
112
48
76
Glos
Hi,
In theory you can change from the display and the procedure is detailed in the software display manual.
In practice I found this to be impossible to follow and hence re-flashed the unit.
I have since reduced the assistance on level 1 and 2 as I am trying to improve my fitness and pedal a bit more.
I could ghost pedal at 12mph on the flat in level 1 and wanted less assistance than that.
 

ulysse132

Just Joined
Jul 21, 2021
2
2
Thanks for your answer. To be sure, you first have to enable the parameter "Set parameters on startup" ? Only then you can modify the assistance mode ?
 
  • Like
Reactions: Bikes4two

TJS109

Pedelecer
Sep 29, 2017
112
48
76
Glos
Yes I believe that to be so, but like I said I find the user interface for parameter setting impossible to use so always resort to re-flashing the unit.
 
  • Like
Reactions: Bikes4two

Bikes4two

Esteemed Pedelecer
Feb 21, 2020
883
388
Havant
I've followed this thread since it started and now that my TSDZ2 is with Parcel Force as I write, I've been looking to understand the motor configuration/programming side more.

STEP 1 - I am going to stick with one of the stock displays (VLCD6) for the moment, only venturing on to one of the other possibilities once I've experienced the kit in it's 'as supplied' form for a while.
STEP 2 - have a play around with the Java based configuration tool to see how much I can change and improve the stock configuration
STEP 3 - if curiosity gets the better of me, I'll maybe move on to a more comprehensive display and toy with the Open Source Firmware that is out there.

As a precursor to the above, I set about installing the necessary software in my Windows 10 laptop as per the instructions given in this link here and as provided by the OP (@Swizz ).

It didn't all go to plan as I'll explain in case others have had a similar experience - I'm no computer boffin and so the measure I've taken to resolve the issues I found, may not be the best, but here goes:

The info in the link says
  1. download and install Java Runtime Environment
  2. download SDCC and install either the "full version" or at least the version with the "include" and "stm8 libraries" (they are required to compile all ".c" files from the "src/controller" directory and to link the output ".rel" files into a "main.ihx" file). Make sure, that the checkbox for setting the path is activated.
  3. download and install ST Visual Development. Install it directly to C:\ , not to the default folder. The file STVP_CmdLine.exe must be located in C:\STMicroelectronics\st_toolset\stvp. Alternatively you can set the correct path in the file _TSDZ2-Smart-EBike/src/controller/compile_and_flash.bat
  4. download or clone the Github repository and unpack in directly to C:\
  5. Start the Java GUI by double-click on JavaConfigurator.jar in the extracted folder.
Para (1) - yup, straight forward - box ticked
Para (2) - installed SDCC ok but I didn't get presented with any choices about 'full version' etc., I just downloaded and installed what was at the linked site.
Para (3) - installing ST Visual Development - this is where the fun began in that the above instructions say to install in the root directory C:\ - If I did this, then the installation always failed, so I let Windows install the program where it thought best, i.e. C:\Progam Files (x86). So far so good but see later, as all wasn't quite well.
Para (4) - Github is a new thing to me so I'm easily confused. The link took me to a configurator version v20.1C.3 the latest version at the time of writing and SUSPENDED. So I faffed around and found the previous configurator version v20.1C.1 here.

OK - time to start up the configurator as in Para (5) above - yup, all well so far. For the hell of it I decided to hit the 'Compile and Flash' button to see what would happen (bearing in mind that I don't have the TSDZ2 motor yet.) Well the compiling started but came to an end with the error message saying:

44237

Going back to Para (3) above, it says "Alternatively you can set the correct path in the file _TSDZ2-Smart-EBike/src/controller/compile_and_flash.bat" So I opened the .bat file in a text editor only to find:

44238

Now, I'm very rusty on this stuff, but given the error message above, I thought the line STVP_CmdLine should end with .exe to I changed it to

44239

and in the Configurator I hit the 'Compile and Flash' button again - this time the program ran correctly until of course it found that I had no programming lead (tool) or motor connected.

44240

OK, enough for now - I await delivery of the TSDZ2 and also the ST-Link V2 and speed sensor cable.
 
Last edited:

MontyPAS

Esteemed Pedelecer
May 16, 2020
390
148
I've followed this thread since it started and now that my TSDZ2 is with Parcel Force as I write, I've been looking to understand the motor configuration/programming side more.

STEP 1 - I am going to stick with one of the stock displays (VLCD6) for the moment, only venturing on to one of the other possibilities once I've experienced the kit in it's 'as supplied' form for a while.
STEP 2 - have a play around with the Java based configuration tool to see how much I can change and improve the stock configuration
STEP 3 - if curiosity gets the better of me, I'll maybe move on to a more comprehensive display and toy with the Open Source Firmware that is out there.

As a precursor to the above, I set about installing the necessary software in my Windows 10 laptop as per the instructions given in this link here and as provided by the OP (@Swizz ).

It didn't all go to plan as I'll explain in case others have had a similar experience - I'm no computer boffin and so the measure I've taken to resolve the issues I found, may not be the best, but here goes:

The info in the link says
Para (1) - yup, straight forward - box ticked
Para (2) - installed SDCC ok but I didn't get presented with any choices about 'full version' etc., I just downloaded and installed what was at the linked site.
Para (3) - installing ST Visual Development - this is where the fun began in that the above instructions say to install in the root directory C:\ - If I did this, then the installation always failed, so I let Windows install the program where it thought best, i.e. C:\Progam Files (x86). So far so good but see later, as all wasn't quite well.
Para (4) - Github is a new thing to me so I'm easily confused. The link took me to a configurator version v20.1C.3 the latest version at the time of writing and SUSPENDED. So I faffed around and found the previous configurator version v20.1C.1 here.

OK - time to start up the configurator as in Para (5) above - yup, all well so far. For the hell of it I decided to hit the 'Compile and Flash' button to see what would happen (bearing in mind that I don't have the TSDZ2 motor yet.) Well the compiling started but came to an end with the error message saying:

View attachment 44237

Going back to Para (3) above, it says "Alternatively you can set the correct path in the file _TSDZ2-Smart-EBike/src/controller/compile_and_flash.bat" So I opened the .bat file in a text editor only to find:

View attachment 44238

Now, I'm very rusty on this stuff, but given the error message above, I thought the line STVP_CmdLine should end with .exe to I changed it to

View attachment 44239

and in the Configurator I hit the 'Compile and Flash' button again - this time the program ran correctly until of course it found that I had no programming lead (tool) or motor connected.

View attachment 44240

OK, enough for now - I await delivery of the TSDZ2 and also the ST-Link V2 and speed sensor cable.
Be careful..... There is every possibility you could end with a very expensive TSDZ brick!
 
  • Like
Reactions: Bikes4two

TJS109

Pedelecer
Sep 29, 2017
112
48
76
Glos
I think you are going about it in the right way it does pay to be cautious.
The main reasons for the programming process going disastrously wrong are a loss of power or connection in the middle of the programming operation, you have to be quite unlucky.
One warning when you wire up the programmer the wires to have to be as short as you can make them. I didn't do this and had repeated programming failures until corrected.
If you want a non invasive way to test the system when you are ready try reading the option byte or the memory. This should not be capable of doing any damage even if it fails.
 
  • Like
Reactions: Bikes4two

Bikes4two

Esteemed Pedelecer
Feb 21, 2020
883
388
Havant
Be careful..... There is every possibility you could end with a very expensive TSDZ brick!
Could you elaborate on the 'brick' possibility please?

Whilst I'm no expert in software, firmware or flashing memory, I'm no novice either, and so far from the wide reading I've done into the subject, I've not seen an inherent risks of 'bricking it'.

Thanks.
 
  • Like
Reactions: TJS109

MontyPAS

Esteemed Pedelecer
May 16, 2020
390
148
Could you elaborate on the 'brick' possibility please?

Whilst I'm no expert in software, firmware or flashing memory, I'm no novice either, and so far from the wide reading I've done into the subject, I've not seen an inherent risks of 'bricking it'.

Thanks.
Not an expert? Not a novice? Hmmm

Like yourself I looked into re-flashing the PoS TSDZ.
I found the info/instructions available to be VERY disjointed, and too many variables to undertake the task of updating confidently.
Having updated many servers, routers, managed switches, be it it BIOS or firmware. If you have doubts be careful, and if you do not have the means for a recovery, do not attempt.
The very fact that you are posting on here for reassurance, tells me you have doubts?

Saying that its your TSDZ..... Go for it!
Good luck.
 
Last edited:
  • Like
Reactions: Bikes4two

TJS109

Pedelecer
Sep 29, 2017
112
48
76
Glos
I guess it all depends on what you mean by bricking it. My understanding is that the ST6 bootloader resides in the rom area of the chip and cannot be overwritten.
There may be option byte settings that can be miss-set not sure about this.
That being so it should always be possible to download a new program into the chip. That program may have errors and may not function properly and can conceivably damage the motor or controller, but there will still be a recovery mode and it will still be possible to download a correct program.
One safety measure is to save the existing program, data memory and option byte before programming so that you have a known recovery state.
There are several versions of the software and I am not sure which one you are referring to but the one using the stock display and Java configuration tool should ensure that unsafe settings are not selected.
It would be interesting to hear from somebody who has had the misfortune to damage the controller during this process and what the circumstances were.
 

Bikes4two

Esteemed Pedelecer
Feb 21, 2020
883
388
Havant
So continuing on from my post #64 above, the TSDZ2 arrived after some 7 calender days from ordering and a few days after that, the ST LINK/V2.

I installed the motor and ran around a bit (50 miles) to get a feel for the 'out of the box' firmware configuration and then set about playing with the OSF (Open Source Firmware) v20.1C.1 through the Java Configurator tool (which you use if you have the VLCD5, VLCD6 or XH18 displays - and I have the VLCD6).

To cut to the chase, it was a simple and straight forward exercise to make the changes I wanted to in the Java Configurator and then to flash it to the motor through the ST Link/V2 device.

PS - I'm so pleased with the TSDZ2, I bought a 2nd one for the good lady and when I've installed that, I shall again 'fine tune' with the OSF.

PPS - The out of the box firmware worked fine - many say the OSF gives an improved experience, and so it seems, but I need to ride a few more miles to truly evaluate it - it's great fun to do if you're into that sort of thing!
 
Last edited:
  • Like
Reactions: TJS109

Bikes4two

Esteemed Pedelecer
Feb 21, 2020
883
388
Havant
So two bikes each with their own TSDZ2 and both running with the minimal displays (VLCD6) and each with the OSF set up using the Java Configurator tool.

There are many different settings available through the configurator and so far I've only dipped my toes into that area and for the moment I'm just using the Power Assist Mode which works well enough for my type of cycling and I expect I'll stick with that for the moment.

I also opted for a small bottle battery (36v 10Ahr) as I really don't like the look of those Hailong battery cases on the downtube (but that's just me!) - so 360Wh - how did i get on with that?

With a full charge and running on either assist level one or two (aka ECO and TOUR) with the very ocassional assist level three, I squeezed out 51 miles! Now, at the moment I've health issues which limits my 'output' and I can assure you that at no time did I peddle hard or even 'enthusiastically' - I did use the gears as though I didn't have electric assist, e.g. if going up an incline, I lowered the gearing rather than increased the assist level.

At the 45 mile point I noticed the power definitely waning i.e. I needed to go to assist level 3 (SPORT) to get the same level of assist normally given out by the lower assist level (TOUR).

From that point on, the motor power fadded away to very little assistance but even at the 51 mile point, there was still some assistance and the battery was a volt or two away from the cut-off point, but only just i should imagine.

OTHER OBSERVATIONS
  • As said by @Swizz earlier, the crank arms have needed checking for tightness - whether this is a settling in thing or a continuing issue, only time will tell.
  • The motor did come loose a bit on a 30 mile ride yesterday - I suspect this was more to my lack of tightening on the chainstay fixing and the BB shell lock ring during initial installation. I've been more enthusisatic on the tightening now, so we'll see how it goes.
  • Whilst I haven't experienced the E02 TORQUE SENSOR error, I made the mistake of turning on the power whilst pedalling (I'd just started off in a rush and forgot to power up!). Anyway, the power assist was virtually non-existant for a while until i twigged. So I stopped, power off, feet off the pedals too (not just resting on them), powered on again and waited long enough for the battery level to register, and on my way with full functionality restored!
  • During one of the OSF flashings, the data transfer didn't happen - ooh! - after some faffing I discovered one of the small pins in the speed sensor lead going to the motor had bent - so one needs to be careful with these small plugs/sockets - tut tut me for ham fistedness
Other than that the TSDZ2 experience has been absolutely great - whether the pessimism expressed in early posts by Bafang zelots proves founded, will become evident (or not) over time. :cool:

PS - I have no interest in 'talking up' the TSDZ2 - if it has faults and shortcomings, rest assured I will bring them to the fore.
 
  • Like
Reactions: Tony1951 and TJS109

Bikes4two

Esteemed Pedelecer
Feb 21, 2020
883
388
Havant
PS - I have no interest in 'talking up' the TSDZ2 - if it has faults and shortcomings, rest assured I will bring them to the fore.
I've posted some of the info below in another part of the forum here to gain a wider audience - apologies for (partial) cross posting.

I am running the OSF firmware v20.1C.1 (v20.1C.3 is suspended for the time being)
  • I'd promised feedback if anything untoward happened and today it did in that I noticed that although I'd stopped pedalling, the motor was still running on.
  • The 'free running' power seemed to be quite low and with little power - very similar to what you'd get with 'walk mode' I'd guess?
  • Anyway, I stopped the bike (canti -brakes) with little effort, reached down and powered off (down-tube mounted bottle battery) and power back on again and the motor operated normally.
  • Clearly a firmware glitch, but for those who might be spooked by such an event, maybe an ebrake would give some comfort.
  • An ebrake creates a signal for the controller to power down the motor - hopefully the route for that signal is dis-associated from the 'no peddling, switch off the motor' part of the firmware?
Just to give an insight into the type of riding I was doing at the time of the 'run-on' issue:
> 250w, 36v TSDZ2 running at 25kph pedal assist, VCD6 display, no ebrakes or throttle
> battery was maybe 25% discharged
> ambient temperature was around 12degC and the motor had not been worked hard (so no heat build-up) and ridden in ECO mode throughout.
> bike speed at time of issue was maybe 10-15kph
> As I approached a T junction I stopped pedalling and notice the motor noise and looking down to the chain ring, I observed the 'run on'.

Anyone else had similar experiences?

In addition to the above I have had two ocassions where after stopping for a few minutes and then pedalling off again, the power asssist has not been there. A full stop (no wheel rotation and feet off the pedals) and a power down/back on has resolved the issue. A cycling friend on exactly the same motor but with stock firmware has also experienced this just the once in their 500 miles of use.

Apart from that my motor has been fine and has helped me recover from a short illness and I now cycle most places on assist level 1 (ECO) and with peddle assist set to 25kph which is giving me a range between 50 and 60 miles on a 10Ah bottle battery.
 
Last edited:

TJS109

Pedelecer
Sep 29, 2017
112
48
76
Glos
I've posted some of the info below in another part of the forum here to gain a wider audience - apologies for (partial) cross posting.

I am running the OSF firmware v20.1C.1 (v20.1C.3 is suspended for the time being)
  • I'd promised feedback if anything untoward happened and today it did in that I noticed that although I'd stopped pedalling, the motor was still running on.
  • The 'free running' power seemed to be quite low and with little power - very similar to what you'd get with 'walk mode' I'd guess?
  • Anyway, I stopped the bike (canti -brakes) with little effort, reached down and powered off (down-tube mounted bottle battery) and power back on again and the motor operated normally.
  • Clearly a firmware glitch, but for those who might be spooked by such an event, maybe an ebrake would give some comfort.
  • An ebrake creates a signal for the controller to power down the motor - hopefully the route for that signal is dis-associated from the 'no peddling, switch off the motor' part of the firmware?
Just to give an insight into the type of riding I was doing at the time of the 'run-on' issue:
> 250w, 36v TSDZ2 running at 25kph pedal assist, VCD6 display, no ebrakes or throttle
> battery was maybe 25% discharged
> ambient temperature was around 12degC and the motor had not been worked hard (so no heat build-up) and ridden in ECO mode throughout.
> bike speed at time of issue was maybe 10-15kph
> As I approached a T junction I stopped pedalling and notice the motor noise and looking down to the chain ring, I observed the 'run on'.

Anyone else had similar experiences?

In addition to the above I have had two ocassions where after stopping for a few minutes and then pedalling off again, the power asssist has not been there. A full stop (no wheel rotation and feet off the pedals) and a power down/back on has resolved the issue. A cycling friend on exactly the same motor but with stock firmware has also experienced this just the once in their 500 miles of use.

Apart from that my motor has been fine and has helped me recover from a short illness and I now cycle most places on assist level 1 (ECO) and with peddle assist set to 25kph which is giving me a range between 50 and 60 miles on a 10Ah bottle battery.
 

TJS109

Pedelecer
Sep 29, 2017
112
48
76
Glos
I have never experienced any run on but have fitted the e-brake switches as a precaution.
Apologies for asking an obvious question but have you enabled the " startup assistance without pedaling option in the config tool"
 
  • Like
Reactions: Bikes4two

Bikes4two

Esteemed Pedelecer
Feb 21, 2020
883
388
Havant
I have never experienced any run on but have fitted the e-brake switches as a precaution.
Apologies for asking an obvious question but have you enabled the " startup assistance without pedaling option in the config tool"
  • A fair question but no, I haven't enabled that option.
  • Unfortunately there doesn't seem to be a way to 'read back' what the configuration in the motor is (is there?) but I'm confident that I didn't enable that function
  • If I had inadvertently enabled that function I'd have felt the effects during the many times when stopped at junction with the peddle cocked and my foot on the peddle, ready for a quick take-off (and I've ridden some 200 miles in the last couple of weeks on what is my last firmware download)
  • 44797
  • I'm not good at navigating around Github, but I noticed in this link here that the term ghost pedalling was mentioned and supposedly fixed (as per the pic below). I used the term motor run-on but the 'ghost pedalling' term might be a more accurate description.
  • Anyway, ghost pedalling was obviously a problem somewhere along the line and may still be?
  • Maybe this so called 'Rx Buffer' still gets full now and again under certain ride scenarios?
  • 44798
 

TJS109

Pedelecer
Sep 29, 2017
112
48
76
Glos
The forum is active I have posted questions and got prompt answers that may be worth a try.

 
  • Like
Reactions: Bikes4two

Nealh

Esteemed Pedelecer
Aug 7, 2014
19,914
8,135
60
West Sx RH
I see the guys at empowered cycles use the KT lcd3 and 4 on their Tsdz's but one has to open the lcd's to individually preprogramme them as well as having to splice the tonsheng displays wiring to the KT displays, one then gets the full extra feature of the display functions like watts drawn, voltage and an extra PAS level.

Hopefully the future for these OSF features is to dispense with cable connections and to use a BT capable display which some (I believe)are now compatible and have BT connection to carry out the work.
 
  • Like
Reactions: Bikes4two

FrodoBaggins

Pedelecer
Jun 2, 2017
70
25
46
West Yorkshire
I've posted some of the info below in another part of the forum here to gain a wider audience - apologies for (partial) cross posting.

I am running the OSF firmware v20.1C.1 (v20.1C.3 is suspended for the time being)
  • I'd promised feedback if anything untoward happened and today it did in that I noticed that although I'd stopped pedalling, the motor was still running on.
  • The 'free running' power seemed to be quite low and with little power - very similar to what you'd get with 'walk mode' I'd guess?
  • Anyway, I stopped the bike (canti -brakes) with little effort, reached down and powered off (down-tube mounted bottle battery) and power back on again and the motor operated normally.
  • Clearly a firmware glitch, but for those who might be spooked by such an event, maybe an ebrake would give some comfort.
  • An ebrake creates a signal for the controller to power down the motor - hopefully the route for that signal is dis-associated from the 'no peddling, switch off the motor' part of the firmware?
Just to give an insight into the type of riding I was doing at the time of the 'run-on' issue:
> 250w, 36v TSDZ2 running at 25kph pedal assist, VCD6 display, no ebrakes or throttle
> battery was maybe 25% discharged
> ambient temperature was around 12degC and the motor had not been worked hard (so no heat build-up) and ridden in ECO mode throughout.
> bike speed at time of issue was maybe 10-15kph
> As I approached a T junction I stopped pedalling and notice the motor noise and looking down to the chain ring, I observed the 'run on'.

Anyone else had similar experiences?

In addition to the above I have had two ocassions where after stopping for a few minutes and then pedalling off again, the power asssist has not been there. A full stop (no wheel rotation and feet off the pedals) and a power down/back on has resolved the issue. A cycling friend on exactly the same motor but with stock firmware has also experienced this just the once in their 500 miles of use.

Apart from that my motor has been fine and has helped me recover from a short illness and I now cycle most places on assist level 1 (ECO) and with peddle assist set to 25kph which is giving me a range between 50 and 60 miles on a 10Ah bottle battery.
I have had this exact same thing.

it has only happened once and it was about 40 miles into a ride.
It’s never happened again despite putting a few miles on the clock.

flicking the switch on the battery and back in again sorted it out.

I mess with the firmware settings a lot so maybe I can never actually recreate it. But I will keep you all posted
 
  • Like
Reactions: Bikes4two

-Pete-

Finding my (electric) wheels
Sep 17, 2021
10
5
Bucks
I have had this exact same thing.

it has only happened once and it was about 40 miles into a ride.
It’s never happened again despite putting a few miles on the clock.

flicking the switch on the battery and back in again sorted it out.

I mess with the firmware settings a lot so maybe I can never actually recreate it. But I will keep you all posted
This is a really informative thread and a great forum, it's nice to see people helping each other.

I'm nowhere near ready to try OSF on my TSDZ2 (I haven't even mounted it to the bike yet :)) but I wondered if the STLINK adaptor can be plugged into the lighting part of my Y cable, whilst leaving the speed sensor attached? I'd make a short STLINK adaptor with a male 6-pin Jolet plug, so I can reflash, cycle up the road to test, reflash etc without unplugging anything except the USB cable. Anyone tried it?
 

Bikes4two

Esteemed Pedelecer
Feb 21, 2020
883
388
Havant
I have had this exact same thing.

it has only happened once and it was about 40 miles into a ride.
It’s never happened again despite putting a few miles on the clock.

flicking the switch on the battery and back in again sorted it out.

I mess with the firmware settings a lot so maybe I can never actually recreate it. But I will keep you all posted
I've now raised this issue on the Endless Sphere forum here.
 

Advertisers