Maintanence TSDZ2 Motor projects

TongSheng TSDZ2 what Firmware options are there?

If you find this article useful and you would like to support the work we do as an All Ability Cycling charity please consider sending us a small domain via our PayPal Charity fund page.

UPDATED MAY 2021

Please note I have tried to update this article to reflect all the options available in May 2021 and so some of my previous comments back in 2020 are out of date. I have tried to explain this in the update notes  

If you have seen any of my other blog articles on the TSDZ2 Mid drive motor you will know that I have been testing this motor with multiple different firmware’s over the last year or so. I have linked through to the open source GitHub pages for this, but as time has moved on its maybe not quiet as clear as it once was as to the options available for this motor. So In this post I wanted to summarise the different paths you can now take when changing the firmware on your own TSDZ2 motor.

So Lets start at the beginning and talk about what tools you will need to make any firmware changes to your Motor..

Tools needed.

In order to upgrade the firmware on your TSDZ2 motor you will first need to either purchase or build your own programming cable.

Unfortunately I have not yet found a UK or indeed european seller of the cables but you can find some worldwide sellers such as eco-bike.com and electrifybike.com however these are based in the US and as such once you add delivery you are looking at around $50 for the cable.

DIY option.

Its clear from the sellers above that these are exactly the same cable you can make yourself if you are confident with a soldering iron and testing the pinout of cables.

Here is my cable and pinout diagram..

(I purchased a tsdz2 speed sensor extension cable to cut off the 6 pin plug)

stlink-TSDZ2-pinout

TIP:- Make the cable as short as possible as you can have issues with volt drop anything longer! and then to connect to your PC/ laptop use a standard USB extension cable.

As you can see you will need a ST-Link v2 USB programmer these are easy to come by on ebay or AliExpress for about £4, but word of warning the pinouts are not all the same so check the image carefully! 

All together you should be able to make your own cable for under £15 if you have some heat shrink to hand.

Software

With the exception of the Original screen open source firmware ( we will come onto that later) all of the programming of the TSDZ2 is done using one tool from ST labs called st visual programmer STVP-STM32 (email registration is needed and link sent to email address – no cost)

After downloading and installing the software and drivers the first thing you will be prompted to do is choose the ST chip you wish to communicate with. so select the following options when prompted.

Once done you should be presented with the main screen

If all has gone well you should now be able to click on the Read -> All tabs menu to read the current configuration of your tsdz2 motor.

There are 3 tabs of data memory, ‘Program Memory ‘, ‘Data Memory’ and ‘Option Bytes’. if the read has been successful you should now see these areas full of data. I would recommend at this stage you save each tab to a file using the File -> Save option so you have a copy of your motors stock firmware should you ever what to revert it to how it was.

So for example you select the program tab, and save that at ‘my-stock-firmware-program-tab.hex ( choose the intel hex format) then choose the data tab and save that tab as my-stock-firmware-data-tab.hex, and the same for the option tab.

You can now start playing with the different firmware options….

Stock Firmware upgrades

So this blog post is all about upgrading the firmware to the new opensource variants isn’t it?

Well yes that’s to come but before the opensource firmware’s were developed one of the fist things that was discovered with the TSDZ2 was that many of the different variants of the motor that were sold as 250w,350w,500w and even 750w were the exact same hardware but used slightly different firmware. In fact in many case the difference is one or two bytes changed that record the voltage and current the motor uses.

So in many cases customers who purchased a ‘250w’ motor could simply install the firmware for a 500w motor and unlock the intended power of the motor.

So if you are looking to simply unlock your motor and keep the original screen and use a stock firmware this is the simplest option for you.

A full list of fantastic instructions and a link to the original stock firmware files look here on eco-ebike.com

UPDATE: 2024 this link has been removed but can still be viewed in the wayback Machine here

please note they also cover the stlink cable and software, they use the original stlink v2 device which works in the same way but looks somewhat different to the clones you will find online like the one above)

Bring on the Open Source Firmware!

Ok you have got this far, and maybe you like me have experimented with upgrading your firmware to the unrestricted stock firmware but now you want to see what the opensource community has to offer. what do you need to know?

well first think to ask yourself is are you happy to change the screen and potentially cut up and re-solder some cables to mate a new screen with the motor?

If you are against this level of hacking then a safe option is to try out the custom firmware threat developed by the user emmebrusa that is specifically designed to work with the original TongSheng screens like the VLCD5,VLCD6 and xh18. This will only require you to reprogram the motor using the stvp-tool above, but no other physical changes to the cable.

Stock screen firmware fork by emmebrusa

Maybe a little out of order as this version of the opensource firmware is indeed a fork of the original work done by Casainho which I will get onto shortly, but I wanted to mention it first as its most likely to appeal to people who are looking to try out custom firmware on there own TSDZ2 for the first time.

For all the information on how to use this firmware take a look at the wiki here.

This firmware uses a specially developed Java tool that allows you to choose all the settings you require to compile a special pre-configured firmware for your motor and screen. This is needed as the original screen is not reprogrammed and so only basic settings can be made using it.

I have been testing this fork for a while now and I have to say for such a simple upgrade to a stock setup it’s very good. You don’t get all the extra information the larger screens provide, but using the windows java tool makes it really easy and quick to make changes, save profiles and upload to the motor.

So if you are looking at switching over from the stock firmware and are not quite ready to make new cables and buy new screens this is an excellent starting point.

configurator-tab1-1configurator-tab2-1configurator-tab3-1

The 4 modes available currently are…

POWER ASSIST assistance proportional to the power (Torque x Cadence) on the pedals.
TORQUE ASSIST assistance proportional to the torque on the pedals.
CADENCE ASSIST assistance subordinated to the movement of the pedals.
EMTB ASSIST assistance with progressive percentage of the torque on the pedals.

It can take a little while to get the software setup but if you follow the guide its all explained and there is plenty of help on the forum.

You can find the Endless Sphere forum that covers all of this firmware development here

And if you want to take a look at the code repository it is available here

Update May 2021 (My personal favorite option)
emmebrusa has taken this development fork further and merged his code with the ‘Casainho’ source code (see below)

This now brings all of his features to the new displays 850C/860C and SW102 and even the old KT-LCD3 screen. This is fantastic as it now means there is one development fork that is an option for stock and replacement screens. I have been testing this build and it is currently my favorite yet as it has all of the mode options and flexibility as well as options for stock or modified hardware. 

For more information on all of emmebrusa firmware options have a look here

If you are running a 850C or 860C of SW102 screen I would recommend this path. However for consistency I want to still include the Casainho firmware below as it is also an excellent option and as the original developer I want to support his hard work….

OpenSource-Ebike-firmware / Colour_LCD by Casainho

This is the original and still current opensource Firmware developed by Casainho but integrating many features and ideas from other contributors, it has developed significantly since it was first created.

Originally the development focused on the use of the KT LCD3 screen which worked very well but had a fundamental issue in that it only had a small amount of memory which meant that some features could simply not be added to it without removing other features. There were some very clever hacks developed to make best use of the memory to get around this limitation as much as possible but ultimately the decision was made to start developing the firmware around screens that offered much more programming space and the new features would work on. So in the current form only the following screens are supported.

Bafang 850C, 860C and the sw102.

So if you wish to use the very latest and greatest version of the Opensource software, you will need to purchase and wire up one of these screens to use it.

Its also worth understanding that in order to use the screen it also needs to have customer firmware installed and this has its own software and installation paths.

Note the sw102 screen is initially tricky to write firmware too as it needs to be physically opened to gain access to the programming pins.

The initial hard wired programming steps are here

Once programmed you can seal it up again and from then on upgrade over Bluetooth! which is great.

I have opened 4 units to date and have a technique that works for me but its not as easy to open as the KT-LCD3 and the Bafang 850/860C screens can now be programmed with the correct hardware without opening at all.

The Main Wiki that covers all instructions on installation and features is here

Latest built firmware for upload is available here

The Endless Sphere Forum for all discussions on this current firmware is here

You will find mentions of the older firmware’s that did support the KT-LCD3 screen within the forum and in some of the setup guides, this is no longer valid for the current builds but still very useful for those that are interesting in using this screen and are happy not to be using the very latest version.

 

So why would you want to still use the KT-LCD3 screen or indeed any of the older Firmware versions? 

Update may 2021 Please note the following information is now out of date and much of this work has been merged into the emmebrusa fork mentioned above, I have left this here as I think it is still useful for anyone who has a KT-LCD3 screen 

Ok, the simple answer is if you are new to the opensource firmware then either of the options above would be ideal.

As by now i’m sure you are aware that in the charity we use the tsdz2 for a few adapted bikes and each of these has its own special requirements. Back end of 2019, we were working with the then beta version 19 of the firmware that was primarily being built by a user called Buba, and at the time he did some fantastic experimental work on different power modes for the TSDZ2. so you could choose to power the motor in either in toque only mode, cadence only mode or the traditional power mode ( mixture of cadence and torque). For one of our specific riders who rides with a prosthetic leg, the cadence only mode was an ideal solution that fixed the hunting the motor would experience in any torque based modes having these options was a great feature for us.

Luckily this fork was still kept and there is now a dedicated page for instructions here

The last release that supported the KT-LCD3 was v0.20.0-beta. 1

I ran this release for several months on my own bike without issue and its what’s running on ‘Bob’ the adapted trike, so this was the firmware I personally recommend for the most flexible options for power delivery

Buba also added a cool light feature that would link into the e-brakes to change from flashing to solid when braking! (now included in the emmebrusa builds as well)

Its also supports the awesome eMTB Assist mode, which is a blast for tricky climbing and general mountain bike tracks (very responsive)

Hopefully that helps new comers navigate the current (May 2021) options for adding opensource firmware to your TSDZ2. I’m sure there will be future developments, and I will try to add those as they happen, but feel free to add comments if you think I have missed any areas. I did not want to replicate the information that is already out there too much but rather give a overall navigation to the relevant webpages.

Update Jan 2023

Just a small note: Look out for ST-Link adapters that had a slightly different pinout. I did have some issues with this ‘Gold’ one originally and thought it was faulty, but having tested it again it appears to be working fine with the GND and SWIM pins swapped.

Different Pinout
Standard Pinout

Update August 2023

Stock firmware can also be found here

77 comments on “TongSheng TSDZ2 what Firmware options are there?

  1. Pingback: Experimenting with the TongSheng TSDZ2 Mid drive system Part 1 – Empowered People

  2. Thank you for this!

    I have bought the ST Link and am now just awaiting a speed sensor cable. I intend to keep the VLCD5 screen but am looking forward to seeing how close the new firmware makes the riding experience to my friends Steps equipped Ridgeback.

    Am already finding the range of the TDZ to be very good with a 14.5Ah battery but will gladly take further improvements.

    Like

    • Neil Perry @ Empowered People

      Ahh good to hear! Hopefully you will like the new firmware, the latest build for the stock screens is very solid and has lots of options to how it responds. I would suggest you try the emtb option. Also with the cable for the ST Link be sure to make it short and use a usb extension. I had issue with a cable that was only 15cm long but it worked when only 5cm long. Really seams to matter for some reason.

      Like

      • Okay will bear in mind thankya. I did not know their were different options for the stock screen build. I had a quick look at it when building the bike a few months ago so will have to investigate further.

        Like

      • Yes With the stock screen and motor you can use a special fork of the OpenSource firmware that has lots of options. have a look at the ‘Stock screen firmware fork’ section in this article above. you will need the ST link to update the firmware and the java tools that the guide links to but once setup its actually very easy to tick some options and upload with a single click ( like starting within the eMTB mode), then revert back if needed or try something else and upload. Tip you don’t need to run the tsdz2 with the speed sensor in while testing) so you can leave it unplugged if you are repeatable uploading , quick ride, and trying something else) the speed sensor cable can be a bit stiff when its new so its nice not to have to keep plugging it back in 10 times in a row!

        Like

      • Okay thank you for the tips.

        May I ask re: the other displays you are using – are the battery gauges any more accurate? If there is one negative about the stock display…the battery gauge is pretty useless

        Like

      • Neil Perry @ Empowered People

        Yes with the other screens you can choose to display a battery guage in percentage so you know you have say 38% left. Seams quite accurate maybe drops off a bit quick under 20% but it does not jump around as much under load there are settings for the battery resistance to help filter that out.

        Like

      • Ah okay. Food for thought for the future.

        Like

  3. Just an update for you – have done the deed and done a forum post on the pedalecs.co.uk forum >>> https://www.pedelecs.co.uk/forum/threads/experiences-with-open-source-firmware-on-the-tongsheng-tsdz2.39384/#post-583408 where I will add for details as I fine tune it. Have linked this blog post in it & I hope you don’t mind?

    Thank you again for this post and for recommending the eMTB map. I was impressed by the original setup for what is just a universal kit but am bowled over by the improvement the new firmware gives. I am going to tweak it further to soften it a bit as the take up of drive is a bit too eager in the lowest setting. Really enjoying it though!

    Liked by 1 person

    • Neil Perry @ Empowered People

      Hi Isla, ah great to hear. you are more than welcome to mention us on pedelecs forum! Yes I found aswell that the stock settings for the open source firmware did not match my torque sensor very well and it was generaly a bit keen. So I recommend you calibrate the torque sensor if you can. Details here https://github.com/OpenSource-EBike-firmware/TSDZ2_wiki/wiki/How-to-calibrate-the-torque-sensor for firmware version 1.0.0 and up. I have just uploaded to 1.1.0 today to test a few new tweaks like dial trip meters and it’s reset my torque cues so I will need to input those again myself :).

      Liked by 1 person

      • Ah greta okay – thanks for the tip – I will have a look at that!

        Like

      • Neil, have I read it wrong or do I need one of the other displays to calibrate the sensor?

        Like

      • Neil Perry @ Empowered People

        Ahh sorry if you use the stock screen and special firmware for it then you don’t need to calibrate the torque sensor. That only cameras in for firmware version 1.0.0 and IP camera that uses the 850c,860c or sw102 screens. Sorry I forget which screen you were using.

        Like

      • Ah no worries! Will just play around with the parameters then.

        Like

  4. Hi. I have the sw102 display and I’m trying to pair it with my tsdz2 motor. I plugged it in but it didn’t really work. As I expected the combination of tongsheng motor and bafang display won’t work. So can I somehow update the tsdz2’s controller firmware to match the display. I don’t really know what to do, so I would like to hear if someone has tips for me.

    Thanks in advance

    Like

    • Hi,

      in order to us ethe SW102 display you will need to use the Opensource Firmware on the TSDZ2. It will not work with the standard stock firmware. As well as flashing your motor you will also have to open and flash the SW102 display as this will be likely running its stock firmware for a bafang motor. this is all explained on the Github pages I link to here https://empoweredpeople.co.uk/2020/05/28/tongsheng-tsdz2-what-firmware-options-are-there/

      Have a look at the ‘OpenSource-Ebike-firmware / Colour_LCD by Casainho‘ section I have links to all the information.

      Personally having used the sw102 screen for some time with the TSDZ2 I do find that its not as nice to use as the larger 850c/860c screens but has the obvious advantage of being very small. The main issue for most people is the initial setup is a real pain and its easy to slightly damage the plastics and loose the water proof nature.

      Like

  5. Hi again…

    Thanks for your reply!

    I soldered the wires from sw102 to my stlinkv2, but it didn’t work. It seems like I had some minor imperfections on the tin and couldn’t connect everything well. I’m worrying if the PCB has burned. Sooo… I can’t connect the wires to the swd pads. I have also bought a conversion cable to fit to the motor and with that I tested that the display’s still working. So is there any other option tho connect wires? Can I cut open the sw102’s wire and solder wires to there. Similarly as done in flashing the motor controller. Or use the conversion cable somehow…
    I’m not going to give up yet 🙂

    Like

  6. Thanks for your help.
    Unfortunately, I couldn’t fix the old display. It still works but the soldering pads are so damaged that it can’t be flashed.
    So I have to buy a new one.
    If I understood correctly the display down below is already flashed and will be just plug and play, as I still have the stock firmware on my tsdz2? And I already have a conversion cable so only the display is required. No soldering 🙂

    https://www.eco-ebike.com/products/minimalist-sw102-display-for-tongsheng-tsdz2

    Like

    • Neil Perry @ Empowered People

      Yes I believe so that version looks to flashed for a TSDZ2 stock firmware. Your damaged display should still work for a bafang motor, so still has some value . Depending on the damage it may still be possible to flash if the pads go to any traces that could be soldered to. But like you say that may no longer be possible?

      Like

  7. Hello,
    Some necessary background: I’m a 74 year old cancer patient with Multiple Myeloma, a blood disease that weakens the bones. I’ve been in chemotherapy continuously for twelve years. I have a pin in my right femur that goes the length of the bone and the doctors would like to replace the ball of my right hip which I probably won’t do.

    Needless to say, I’m out of shape. But since I can’t walk for long distances and with COVID around I’m reluctant to go to therapy or have surgery I’ve decided to build a tadpole trike with torque assistance from the Tongsheng motor adjusted for torque that I can manage. Which will be asymmetrical. The trike will be 2” square 6063 aluminum tubing, Sturmey Archer 5 speed rear hub and S/A front hub brakes. The rear end will be suspended and 20” wheels all around. The frame will be a simple cruciform much like KMX trikes. I’ll fabricate a mesh seat. I’m thinking that I will want either the 850C or 860C display. I would appreciate your advice on my project and especially on displays and the current status of software to enhance my trike riding experience.

    Thanks for any advice you can give me.

    Like

    • Hi Steve,

      As far as the current status of the OpenSource firmware for the TSDZ2 in version 1.1.0 https://github.com/OpenSourceEBike/Color_LCD/releases there is support for Torque Sensor calibration both left and right. this is designed to allow you to accurately calibrate the digital value the sensor provides at set weights applied to the pedal is known. so when you say all 10KG the display knows that is 10KG and can use that to calculate the force being applied and multiply by the assist factor to give a equivalent power to the motor. Usually this process is used to fine tune the torque sensor so it feels natural and correct. but if you say want to give your right crank more assistance than your left you could in effect manually calibrate these values wrong . For example if you add 10KG weight and the value returned is say 32 units to give twice the power you double this value in the table you create its like telling the motor you are pressing with twice the force you are on that side. Its not a liner response so you may have to experiment wit the values but in theory you can make it an asymmetrical response. to be honest I had a similar issue with a trike rider who has a prosthetic leg but at the time this torque sensing feature had not been developed and we opted for not using torque sensing at all and switched the TSDZ2 to a cadence sensing motor only to resolve the issue. I would also be wary about using the Sturmey Archer 5 speed rear hub with high power levels as its known that applying 100’s Watts of motor under power will kill many internal geared hubs. so this may require you to run lower power levels that you are wanting to. Bafang mid drive motors help address this using a shift sensor that tells the motor to stop providing power during shifting, and there are ways to use this sensor with the TSDZ2 by simulating the ebrake on shifting. its a bit crude but should work to protect the gears under shifting. but This will add a delay in power when shifting which is not ideal. I have to admit i have not experimented with using a shift sensor on the TSDZ2 yet only on the Bafang BBS02 motors. as far as fitting onto your frame as long as the ‘Bottom Bracket’ and space around is suitable most tadpole trikes are perfect, the fact its box section should not be an issue, you just need to find somewhere to mount the battery using either riv-
      nuts or another mount/plate. I hope that helps.

      Like

      • Thank you for all the good advice. My first purchase was the S/A 5 speed hub so I’m committed to that. When I did my research this was described as the strongest S/A gearbox for my application. I intended to pause pedaling during shifting any way but your suggestion is worth pursuing as I learn more of the software and what I can spoof. As for displays, I’m looking at the 850c or the 860c. Do you like these or a different display altogether? I’m looking for ease of hacking, ease of use and good visibility. I got a very good deal on a battery mounted on a rear rack. I’m not thrilled with that much weight mounted that high but the price was too good to pass up. One last question: with significantly different pressures applied to the pedals by my left leg versus my right, am I likely to get major “throbbing” from the motor and potentially catastrophic failure of the motor or the chain or the gearbox?

        Like

      • Hi Steve, Sorry i forgot to talk about the displays. yes I personally have an 850C and it works well but the 860C is better visibility in sunlight and I think slightly better water resistant so if you have the choice the 860C is better sure.

        they are both easy to flash without the need to open them up which is a major bonus. but you will need to make or purchase to flash it.

        see https://github.com/OpenSourceEBike/TSDZ2_wiki/wiki/Flash-the-firmware-on-860C-850C-using-bootloader for more details.

        One last question: with significantly different pressures applied to the pedals by my left leg versus my right, am I likely to get major “throbbing” from the motor and potentially catastrophic failure of the motor or the chain or the gearbox?

        No the motor should be fine it wont damage but the throbbing or hunting is what you will expect to see with stock firmware as it is very quick to detect torque change per crank and will slow down on half a stoke if the torque is not similar.

        This is why you need to either calibrate the torque sensor to adjust for this and make the ‘weaker’ leg appear to be as strong as the strong leg, or like I did switch to a cadence only mode ( specific older opensource firware needed to use this) that ignores the torque all together and simply applies power based on rotation speed only ( which is much easier to keep with a weeker leg)

        We used the TSDZ2 on a recent hand-trike conversion which in effect is all power on half stroke then nothing for the next half stroke and it works great, aslong as the rider can power the half storke well the hunting isn’t too bad the motor can ‘fill in the gap’ very well.

        so it really does depend on the rider but you have options.

        Ok very steep climbs you want to use your gears to keep the motor speed reasonably high as they are most efficient at higher cadences but as long as you have the gearing well setup that should be fine. The hunting will not damage the gears or chain, its a ramp up and down. damage is more linked to the motor being under power while the gear change happens so you do indeed have to either stop pedaling, change gear, start pedaling. or if you have e-brakes fitted just press the brake a small amount which is enough to tell the motor you are braking ( and stops power) but not enough to actually brake the wheel. ( this is in effect what the gear shifter detector is doing automatically for you.

        Like

  8. I am using a C3 display and using the stock 52v program. I am still getting assist at level 0 and hard to tell but all other assist levels seem the same. I have two tsdz2 motors and have switched out all parts with no change in the issue.

    Like

  9. Please, correct the post, the new firmware based in marcoq´s job is developed by mbrusa,

    more info in http://www.jobike.it/forum/topic.asp?TOPIC_ID=76426&whichpage=91

    Like

  10. Simon G

    Thank you for this extremely well detailed article. I have the VLCD6 on my MTB as I like the minimalist size. I have been pondering for some time with the OSF and purchased an STlink some weeks ago. What has been holding me back has been “to much information” and this article explained many things. As the VLCD6 is very limited, I am still unsure of what setting I should use in the Java configurator as I want to display MPH not KPH. When I set up originally I used the little formula on the wheel size to fool the display. Not sure what will happen if I set the configuration to MPH before I upload. Anyway, will be giving it a try at some stage soon. Thanks once again

    Like

    • I wouldn’t mind if someone comment re setting in configurator or display? I am still pondering this one

      Like

  11. Wolfgang Wolters

    Hi Neil, first of all, thank you very much for your work and writing. I have a question regarding your “favorite”. I ordered a tsdz2 with 850c display as a kit. I think this means the display will fit without any changes. Would your “favorite” (mbrusa) work with that display? Do I have to manipulate the display like for the flexible open firmware from casainho? I’m a little confused?

    Greetings Wolfgang

    Like

    • Neil Perry @ Empowered People

      Hi Wolfgang, I have recently heard of a few ‘stock’ kits that are now being shipped with an 850c display. But I haven’t actually seen one in person myself. I assume they run stock firmware on the motor and custom firmware on the 850c to work with the stock protocol of the motor. It may be possible to use the emmebrusa firmware designed for stock screens but in the java app you choose the screen you have and the options don’t include the 850c. But to be honest if you were going down the Open source route you would be better using emmebrusa build that’s designed for the 850c screen and flash the motor to suite .This is what I am referring to in my may 2021 update and what I am currently using on my tsdz2 and 850c screen.

      Like

      • Wolfgang Wolters

        Hi Neil,

        Thanks for the fast reply. Is this the firmware that you are talking about?
        https://endless-sphere.com/forums/viewtopic.php?f=30&t=110682

        Greetings Wolfgang

        Like

      • Neil Perry @ Empowered People

        Hi yes that’s the main thread with links to each build (depending on your screen) I am running ‘Open source firmware TSDZ2-v20.1C-860C’ (the 850c bin file) just done 22 miles on 30% battery today with it and it’s been perfect.

        Like

      • Wolfgang Wolters

        Great, I’ll give that a try when the kit has arrived and is built to the bike.

        Like

  12. Giuseppe

    thank you to have summarized and organized all those information. It helped me a lot to make all the job. It works great.

    Like

  13. Wolfgang Wolters

    Hi Neil,

    my motor kit is on the way and I can’t wait to mount it to one of my pacers.
    Here is a question to you or probably other readers to.
    My brother who told me about the tsdz2 owns a pacer converted with a tsdz2 (sfm du250) . He bought his motor 6 years ago. We are trying to flash his motor too. We discovered that on his setup the speed sensor connector has only 4 pins (the two middle pins are not present). Following some posts the 5v supply is not mandatory for flashing if the motor is connected to the battery. Every time we try to read the software from the motor with the st tools the connection fails.
    Could it be that there are older versions of the motor that cannot be flashed /programmed?

    Greetings Wolfgang

    Like

  14. I wouldn’t mind if someone comment re setting in configurator or display? I am still pondering this one. Also as MTB do i default to that setting?

    Like

    • Neil Perry @ Empowered People

      You would set the mode to kph or mph with the Java configurator. But you would also have to set the display as well to match and light the right LCD elements to be lit ‘kph’ or ‘mph’. Follow the stock display configuration manual for that.

      Like

      • Thanks for your reply Neil – VLCD6 only shows KPH – which is was my confusion with which to set in Java configurator. I wasn’t sure if setting MPH in configurator would override setting on the display or would stay as KPH (if you see what I mean)

        Like

      • Neil Perry @ Empowered People

        Hi Simon. Oh that a pain I didn’t know the vlcd6 only shows kph. Yes no way round that unless you change screens I guess.

        Like

      • Neil Perry @ Empowered People

        Saw this today on the tsdz2 Facebook group specificaly in regards to getting a mph reading on the vlcd6 ….When setting up wheel diameter multiply chart number by .621. Example: 26 inch wheel = 200 x .621. So set to 124 instead of 200. It will give you MPH reading (close enough), 20 inch wheel set to 99 (chart says 160). https://m.facebook.com/groups/734929600180813/permalink/1500681096938989/?comment_id=1500694623604303

        Like

  15. Wolfgang Wolters

    Hi Neil,

    I’m still waiting for my motor to arrive.
    A new problem occurred as my brother who told me about the tsdz2 owns one too. His motor isn’t about 5 years old (sfm du 250; probably a German label). We tried to flash his motor. As we tried to connect the cables from the st programmer to the speed sensor connector we discovered that it has only 4 pins. The two middle pins are missing. In some forum threads they stated that this would be no problem as one could also connect the battery of the motor as power source for the flashing process. So we tried to flash with power from the motor and Swim and Ground connected to the speed sensor connector. Unfortunately webh had no success so far. The flash tool always tells us that there is problems connecting to the device. Do you or someone else of the readers know of problems occurring with only 4 pin connector?

    Greetings Wolfgang

    Like

    • Neil Perry @ Empowered People

      Hi Wolfgang,

      I haven’t seen this issue before if I am honest but I can see why the microcontroller would need to be powered in order to flash it. I have never tried it without 5v connected but I would expect that you would have to turn it n the display to switch the motor controller on and for it to power the microcontroller with 5v. Have you done that?

      Failing that you could always open the motor and remove the controller to connect directly to 5v the positions of gnd and 5v as well as swim and Reset RST are documented. Have you checked If RST is connected as this is what tells the microcontroller to reboot into the bootloader to be flashed. You will need this I think.

      Like

      • Wolfgang Wolters

        Hi Neil,

        Thanks for your reply.
        Problem solved 🙂
        After opening the housing there is a special cable with connector inside. Probably for servicing purposes. My brother made some trial and error to find out SWIM and Ground. No need for RST. Success. He is so happy with the new firmware.
        I will post the color coding for the connector later.

        Greetings Wolfgang

        Like

  16. Wolfgang Wolters

    … and my Motor arrived on Saturday. I mounted it yesterday.
    I noticed some vertical play on the bottom bracket axle. Did you or anyone else experienced the same problem?
    I know this is a little off topic 😉

    Greetings Wolfgang

    Like

  17. Wolfgang Wolters

    Special connector inside the Motor Housing colour code:
    Black = GND
    yellow = SWIM

    Like

  18. I followed your guide to make 2 cables. Thank you. The colors of the extension cables matched yours for one of them. On the other, purple was replaced with red.
    I have made at box with cable retention for the cable. It is available here:
    https://www.thingiverse.com/thing:4904891

    Like

  19. Paul Cowley

    Hi

    About a year ago I converted my first bike, my old 1997 Raleigh Amazon MTB. I installed the TSDZ2 36v 250w motor to ensure it was road legal and I must say I have been very impressed with it so much so I want to convert another.

    My next conversation is going to be used off road and I’m considering using the higher powered TSDZ2 48v 750w motor. I’m going to stick with the standard factory out of the box firmware as I’m not brave enough to go open source just yet but want to make sure I purchase the correct equipment for when I do.

    I’ve seen you can purchase nicer looking displays. Versions of the 500c and 850c displays come with 6pin plugs that can plug directly into the motor. As I’m sticking to the factory firmware at the moment will these displays work with the factory firmware or only with open source?

    Thanks for your help and advice

    Like

  20. Hi, thanks for your instructions. I have a motor flashed with the firmware for a standard tongsheng display (mbrusa firmware), and now have an 860c display, that I would like to swap on, so that I have access to all the display features. I am a little unsure as to how to flash the mbrusa firmware onto the 860c display – do I follow the same instructions as if I were to flash the casainho display firmware that you provide a link to, but use the mbrusa display code instead? Presumably, if I use the mbrusa motor firmware and casainho display firmware, it wouldnt work properly?

    Like

    • Neil Perry @ Empowered People

      Hi Nick, You will need the Embrusa 850/860c code (the current version is V20.1C.3 as of Nov 2021) https://github.com/emmebrusa/TSDZ2-Smart-EBike-860C/releases this also includes the TSDZ2 Motor Firmware to match. Note this is not the same as the stock screen firmware so you cannot mix and match. Flash in the same way you would the Casainho firmware for both the screen and motor. There is no java app all configuration is done via the screen. I hope that helps.

      Like

      • Hi, thanks for your instructions. I have a motor flashed with the firmware for a standard tongsheng display (mbrusa firmware), and now have an 860c display, that I would like to swap on, so that I have access to all the display features. I am a little unsure as to how to flash the mbrusa firmware onto the 860c display – do I follow the same instructions as if I were to flash the casainho display firmware that you provide a link to, but use the mbrusa display code instead? Presumably, if I use the mbrusa motor firmware and casainho display firmware, it wouldnt work properly?

        Perfect, thanks – it was the lack of a Java app that was confusing me – I guess it is not so important if it is more straight forward to directly input controls onto the screen

        Like

  21. So here is an interesting one that has me stumped. Wife’s bike is a 48V 500W with a 48v 13ah battery & VLCD6. The battery is good (or should be). Backed up stock settings using ST Programmer (all tabs) and the flashed using configurator adjusting settings for 750W & 48V etc. Put battery back on to test & nothing. Tried flashing back using back-up files using ST Programmer – said succesful but still nothing happend when switcing on at diaplay. More alarminingly is that the battery appears dead. The power led’s do not light up at all. (battery should have been at least 70-80% charged prior to the flash). Surely getting any settings wrong on the motor wouldn’t affect the battery or the BMS?

    Like

    • Just an update – left the battery for 24hrs and suddenly worked fine again, as did the motor. Don’t know what the problem was but it seems to have fixed iteslf

      Like

  22. Pingback: Aventon Pace 500 – Installing Throttle on Demand Controller Upgrade – blog.jseaber.com

  23. Dear Neil,

    could you please clarify the wiring diagram for the DIY of the cable when I buy a speedometer sensor extension cable and sp link usb stick? Some pictures of the cables would be great!

    Thanks for that!!!

    Like

  24. Dave Pickering

    Hi Neil, I’m struggling a bit here. I keep getting the following error message on the STVP …
    Error : Cannot communicate with the tool.
    Wrong tool selection or check tool power supply or check that a previous session is closed.
    Error : < PROGRAM MEMORY reading failed.
    Error : < Operation aborted.
    I have a TSDZ2B with VLCD6 display. My ST LINK V2 has slightly different pinout to yours but I have adjusted accordingly.
    Any help you can give woudl be much appreciated.
    Dave

    Like

    • Actually come to think of it I did have issues with one ST link adapter that had different pinout as well at one point and replaced it. I still have it. Is it the same as the one I have just added to the bottom of the article?

      Also. is your cable very short like the one in the article? (less than 2 inches) I also had issues using a longer cable I think either noise or volt drop but it really made a difference. that’s why I use a USB extension and a very short cable from the STLink to the motor

      Like

      • Dave Pickering

        Hi. Thanks so much for your reply. The one I have is the same as the top one you have pictured. The picture of it on eBay was the same as the 2nd and 3rd pictures? Anyway I’ve tried to amend the pin out to no avail. My cable is about 6″ long. I really struggled to solder it. Did these problems cause the same error message for you?
        I ask as I’m trying to narrow down the problem – I’ve installed and re-installed all the software without success. ☹️
        Moved it all on to C drive too.

        Like

      • To be honest Dave it was quite a while back so I don’t remember the exact errors but I do remember thinking it would not connect at all even though the stlink was seen as a device. I took the easy option and ordered a new one which worked. I wanted two so I could leave one at home and one in the charity. So I wasn’t in a mad rush at the time as I did have a working one. Unfortunately my cable is clued now so not easy to convert the pinout I’m afraid.
        Update:
        Ok I figured why not try it again. and made a short cable to convert it. and would you know it it now works! so sorry but looks like its not the same issue.
        If you can i would recommend a shorter cable as this was definitely an issue for me.
        have you selected the ‘STM8S105x6’ as in the screenshot?
        and are the drivers working ok?
        You should also see a ‘STM32 STLink’ showing under ‘ Universal Serial Bus devices’ in device manager in windows if the drivers are working corectly.

        I have also updated the pinout diagram to try and make it as clear as possible which pins are which on the STLink adapter.

        Like

    • Did you ever get this sorted? I’m having exactly the same error and its infuriating. My STLink has a slightly different order of pins and I ve adjusted to suit, but same problem. Infuriating

      Like

    • same issue here. any updates?

      Like

  25. Mark Hendricks

    So, I see the various aftermarket firmware options, but isn’t there someway to clone stock firmware? For instance, I have a motor from Eco Cycles, but it has their old programming. Is it possible to clone the programming from one of theor new motors or even one from PSW or Ebird? I really don’t like the look of OSF and because I have to warrenty customer installs, I don’t want them making changes either.

    Like

    • Yes of course, as long as you have access to a motor with the ‘stock’ firmware you want to copy. Just connect with the ‘st visual programmer’ software and like I recommend the first thing you do is backup the stock firmware to 3 files. You can then upload these 3 files to another motor too ,in effect clone it.
      Is there much difference in the stock motor firmwares from ECO, Ebird or PSW? I have only ever purchased motors from PSW power so I don’t have access to an ECO or Ebird supplied motor to compare the stock firmware files.

      Like

  26. Thanks for all of this info. Great stuff. I’m struggling with firmware on my VLCD5 that doesnt appear to tally with the instruction manual, so going to OSF may resolve some issues i’ think im having with torque sensor calibration…

    Like

  27. As of Feb 23, which firmware is recommended for a VLCD5 display?

    Like

  28. Hi guys, thank you for the great overview.
    I have an old TSDZ2 with broken Torque Sensor. I want to use the Motor for a Childrens Car with throttle grip. Is there an option to enable “street mode” without padeling at all and to accelerate with a grip?
    thanks in advance

    Like

  29. The link to Stock Firmware Updates is not working. Can’t find any firmware on that site. Can you update the link and point me in the right direction?

    Like

  30. Hello there, very interesting article.
    Do you know if the osf works with the new TSDZ2B?
    Thanks
    Al

    Like

  31. I got 2 x TSZD2B from PSWPOWER with 850C displays. My customer used it for a while then he needed support and I put the other motor in.
    Neither system now works: they have swapped displays: surely displays aren’t locked to a motor.
    I have fitted many systems now, always with VLCD5
    This is what happens:
    – The 850C shows numeric (correct) speed on the centre display;
    – the outer speed ring goes green right to max speed as throttle twisted slowly;
    – neither throttle or pedal sensor work once ‘speed’ hits the limit;
    – this gives stop/start motor behavior
    HELP!!!

    Like

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.