Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Hi All. Maybe a stupid question, but I have a TSDZ2B 500w mid motor with a 850c display. I was capable to flash the emmebrusa firmware or at least I think I flashed it succesfully (java configurator after flash and compile said that it is succesfull) and it should be because one time I chose no throttle and that time it was not functioning after a re-flash with throttle it worked again.

My question is that according to manual lot of configuration what I have choose in the java configurator can be changed later on the display, but on the display I see no new settings point, it does not changed at all. Am I doing something wrong or I have to do anything else in addition to change those parameters later on the go?
 
....
My question is that according to manual lot of configuration what I have choose in the java configurator can be changed later on the display, but on the display I see no new settings point, ....
You can't change all settings with the display. Most must be done with the java configurator.
The settings that can be changed is done with a button sequence with the light button.
Read the display manual about "what and how" parameters could be changed.
 
Could someone help me what is wrong
Classic problem of using unix style tools with paths that have spaces in them. i see that in the command all the instances of Program Files are in quotes but maybe this still is no good. I would suggest reinstalling sdcc and stm8flash and making sure you don't have a space in the folder name. Don't put them in "c:\Program Files"
 
I also have an issue. I have an M2 macbook air. When I click on the Java configurator it all seems fine but nothing happens when I click compile and flash other than a new file is added to the experimental files list. I tried running it from the command line and after clicking compile and flash and just leaving it it eventually gave an error...

TSDZ2-Smart-EBike-1-20.1C.2-update-2$ java -jar JavaConfigurator.jar
Java HotSpot(TM) 64-Bit Server VM warning: CodeCache is full. Compiler has been disabled.
Java HotSpot(TM) 64-Bit Server VM warning: Try increasing the code cache size using -XX:ReservedCodeCacheSize=
CodeCache: size=131072Kb used=8425Kb max_used=8425Kb free=122646Kb
bounds [0x0000000106d8c000, 0x00000001075dc000, 0x000000010ed8c000]
total_blobs=3091 nmethods=2498 adapters=506
compilation: disabled (not enough contiguous free space left)
I tried again adding -XX:ReservedCodeCacheSize=8GB and now it just sits there for ages.
The compile_and_flash.sh seems to do something but I don't know how this gets anything from the ini file or how to make sure it is using the correct ini file. compile_and_flash.sh can take a command line parameter ($1 in the script) which it considers to be "settings date" but I am not sure if am meant to use the date of the ini file I have here. The documentation is lacking for the command line procedure.
 
i have seen that there is a config.h in src/controller which has the right timestamp for when I ran the configurator and looking in the file it has setting that I definitely set like 14S for the battery etc. So even though compile and flash does not seem to be doing everything its at least configuring the code properly so i think I should be ok by using the shell script 🤞
 
Just wanted to make a post with the issues I encountered while installing and the solutions I found for it:

First there was the extension cable which only had 3 instead of 4 leads (which I ordered from PSWPOWER).

I then went on by just directly connecting.

I cut off one end off of the ST-Link cable's plugs, and tried stripping the cables, but it only has 3 very thin strands in each wire, so it was pretty much impossible to strip.

So I just got some old wire (don't know from what, just some regular grey wire, with a core that looked like copper strands, not too thick but not too thin) from the shed, cut off 4 pieces, stripped the ends, and put a heat shrink on each end. Was a bit fiddly but it worked in the end.

I first got a build error (error 1), ''D:/Program' is not recognised as an internal or external command, operable program, or batch file', which was solved by reinstalling SDCC to 'D:/' instead of 'D:/Program Files'.

I also got some 'function decelerator with no prototype' warning when building, which was solved by installing SDCC 4.1.0 instead of 4.3.0.

After that it built it correctly, but I still couldn't flash. It said something about a wrong tool selection.
I tried fiddling around with the cables and put them in different configurations (3V/5V, with/without RST), but it didn't work.
Also tried the different configurations both with the screen on and off.

I suspected something was wrong with the ST-Link, so I downloaded the STM32 ST-Link Utility, but every time I tried to connect to target, it got an STLink USB communication error.
Going to target->settings I could see it was detecting it after connecting (did say 'Old ST-Link firmware/ST-Link already used' instead of the serial number) and if I was quick I could change one setting each time, but after I did or clicking refresh it loaded (seemingly froze) for a while and then grayed out the options. Until I reconnected it again.
This had the same behaviour with and without it connected to the speed sensor cable.

Tried with another laptop but had the exact same issue.

In the end I updated the firmware (should've known I had to when the utility said 'Old ST-Link firmware) with the STSW-LINK007 program. I'm not sure if it worked straight away, but I think I had to reconnect it again before it did. But to my surprise it actually went and updated, and after that in the utility it actually showed the serial number instead of 'Old ST-Link firmware', and it didn't freeze or gray out the options anymore.

After that it was just a matter of connecting it back to the sensor cable, and flashing the firmware.

I'm not sure if I did it with or without RST (IIRC without), and IIRC I did have to turn the screen on for it to work.

Seeing it flash so quickly made me wonder if it even really flashed anything, but going for a ride I could immediately feel the difference. It's a beast now! Finally not the slow, clumsy feeling, piece of crap it was.

I hope the modifications I did for cooling will be sufficient. Went extreme with cooling though so I should hopefully be fine. I did both the mod with a aluminium pieces around the motor core (smaller pieces between the studs, and a bigger piece around that), and I had my brother cut one of those heatsink plates out of copper for in between the motor core and housing. And of course plenty thermal compound between all the plates and the parts they're touching (used Arctic MX-4 as it has a pretty high thermal conductivity of 8.5 W/(mK)).

I set the maximum amount of Amps to 16 (at 48V), because I don't trust it above that without a temperature sensor even with the cooling mods, and it's plenty already. It gets up to 40kmh / 25mph easily with the settings I chose (if the speed is displayed correctly, which I still have to check. But it did feel like it).

No temperature sensor though so it'll just be a guess. It's not the most expensive kit tho, so not all too worried about burning it lol. And ambient temps don't get high here, we only get a few days a year where it gets above 30°C.
If it can keep it up like this it'll have been a better purchase than a BBS02 after all though. Just felt really crappy in comparison to that without the firmware mod.

It was this ShengYang ST-Link btw, bought from 'TZT 123 Official Store' on AliExpress (doesn't have an ST logo on the picture, but does in reality):

And bought the TSDZ2 (B version, so actually TSDZ2B), from 'pswpower Store' on AliExpress the 2nd of November 2022, for €235 at the time (IIRC I asked them to send from a European warehouse, while paying for it as if it was shipped to a Chinese warehouse, to avoid taxes. But I'm not 100% sure about that).
 
Last edited:
Hello. I am a new owner of Tsdz2b with VLCD5, currently using the factory firmware.


In the future, he plans to upload open source software. My questions:


1. After uploading the software, can you return to the factory one?


2. To compare the factory and open software, is it enough to upload the TSDZ2-v1.1.2.hex file to the engine controller using St vlink 2 in the stvp program without using Java?
 
Last edited:
1. Yes, you can backup/restore the three stock files with STVP.
If you forgot to backup before you need a downloadsource for these files.

2. No, if you want to keep the Vlcd5 you need to flash the controller with java configurator.
 
Last edited:
Hello everyone,

if you have a 48V 750W motor, is it possible to limit the power assist mode to 250W with emmebrusa parameter configurator?
So that you are legally OK in the EU with max. 250W and 25kmh?

Many thanks for your feedback!
 
....

if you have a 48V 750W motor, is it possible to limit the power assist mode to 250W ....
So that you are legally OK in the EU with max. 250W and 25kmh?
No.
The EU have as limit a maximum of 250W continuous power, not the maximum feasible power, that can easy be more as twice as much for a short time.
The given 250W continuous is the power at which the temperature does not rise and is hardware related (dimensions, quantity copper etc) so this cannot be changed.

Continuous power can only be measured under special conditions with specific devices, so it isn't easy to check.
Mostly the continuous power and Voltage is printed on the motor, but with Tsdz this is imho a sticker.

Most important is the speedlimit of 25km/h and 6km/h for throttle, because that is easy to check.
 
Last edited:
Just installed the latest version Update 3 with my DZ40 display
This version requires that vlcd 5 should be selected in the configurator for DZ40 display
Everything working fine

( update 1 required vlcd6 be selected to get the display to work as expected )
 
I'm trying to understand differences between assist modes . emtb especially. how it works and why it's better than power mode ? I'm using power mode and I'm happy with but I hear ppl are enthusiastic about emtb mode but how it really works ?
 
I started out with power mode. Not much of a change in Eco/Tour. I liked EMTB more. No change of any of the assist numbers. Hybrid is where I have my bike now for the past year, and I ride modtly in Eco.

I did a second TSDZ2 for my wife, She is a light pedaler and we found EMTB wasn't enough assist, Switched to Hybrid, and boosted the levels for ECO/Turbo. She could not maintain 12 mph though, and always dropping back, so we rode other ebikes. Tried Cadence this month and I could tell the difference immediately. She likes it too, and told me yesterday she could ride all day like that,

The other day, I tried switching my bike to cadence, and the difference wasn't much. Perhaps the VLDC5 mode switch did not take. I'll need to do more test riding,

By the way, what does StartUp Boost do?
 
Last edited:
Back
Top