TSDZ2 OSF for all displays, VLCD5-VLCD6-XH18, LCD3, 860C-850C-SW102.

Actually why 850C is mentioned everywhere as supported but in fact it is not? :)

Planning to flash OSF and looking for display, the best for me would be SW102 but it says that the newest versions were not tested with latest firmware, is it still safe to buy this display? 860C is more expensive and bigger, I prefer smaller form factor :)

VLCD13 looks cool but I guess it is not supported? Also pswpower sells 850C with the tsdz2b, is this display supported? I guess no?
 
well , its simple - he is losing assistance but motor is not shutting off . if he turns off/on that helps . and he is curious what causes it
If the motor is not shutting off, so that it is still running, but there is no assistance, then something mechanical like gearing or clutch between the motor and the chain has failed, and it would need to be opened up to check which part it is.
 
If the motor is not shutting off, so that it is still running, but there is no assistance, then something mechanical like gearing or clutch between the motor and the chain has failed, and it would need to be opened up to check which part it is.
I have similar issue. sometimes motor is going crazy with feeding power. or stops feeding power. first I opened and fiddled with tq sensor hall . bit it didn't help . then I changed the osf with different tq sensor values (read them) and it still didn't help . finally I have turn off preset values and let osf calibrate each time. now when bike behaves wrong I just turn off/on the display ...I know it's annoying but it helps ...i think sensor is not keeping values and firmware has to read max min values...?
 
Last edited:
...
... 850C with the tsdz2b, is this display supported? ...
The 850C is mentioned, because in the first place this display was the first color display for OSF, which is followed up by the 860C.
After this update, the hardware is of the 850C is changed, so that (new design) display isn't supported anymore.
We are talking here about display's that support the Bafang communication protocol, so that is why the display FW must be flashed. Same for SW102.
Only the old version 850C and SW102 are supported and the 860C.

But............. the 850C and SW102 also are sold with or specific for Tsdz2, meaning they have already FW with the Tongsheng communication protocol.
These displays are not flashable anymore, but you can use OSF for stock display and you only need to flash the controller FW with Javaconfigurator.

FYI: this is possible for all displays that are specific made for Tsdz2, so besides 850C there are still choices.
Maybe the display's of Aikema are supported too, but you must ask yourself.

One sidenote: OSF for stock is specific written for XH18, Vlcd5, Vlcd6 and there are some small changes for other display's, but most of these other display's aren't tested with OSF.
It will work, but you could have some disadvantages with display handeling.
 
Last edited:
Yes this I understood that 850C which is sold with tsdz2 is supported but not as 860C and you can not change settings on the fly and need to use java configurator. Is it possible to get SW102 somewhere where it will work with OSF and custom firmware? Or for now only 860C is fully supported? I really like SW102 small form factor and 860C is just very big and cost 2x :)

Can I flash this one with custom firmware and use with OSF?

 
Last edited:
I'm getting this error when flashing on Linux:

Code:
Address 4000 is out of range at line 1

when using "compile_and_flash_20.sh"

Code:
Do you want to flash the motor ? [Y/n]Y
sudo stm8flash -c stlinkv2 -p stm8s105?6 -w data_empty.ihx
Determine FLASH area
STLink: v2, JTAG: v29, SWIM: v7, VID: 8304, PID: 4837
Due to its file extension (or lack thereof), "data_empty.ihx" is considered as INTEL HEX format!
Address 4000 is out of range at line 1
make: *** [Makefile:112: clear_eeprom] Error 255

I'm able to read and write with these commands:

Code:
stm8flash -c stlinkv2 -p "stm8s105?6" -r TSDZ2_orig.bin
stm8flash -c stlinkv2 -p "stm8s105?6" -w TSDZ2_orig.bin

I followed the instructions on the "Flash the firmware on TSDZ2" wiki, but did not perform the "Erase protection" step:

Code:
echo "00 00 ff 20 df 00 ff 00 ff 00 ff 00 ff 00 ff" | xxd -r -p > option_bytes_pwm_n_channels_enabled.bin
stm8flash -c stlinkv2 -p stm8s105?6 -s opt -w option_bytes_pwm_n_channels_enabled.bin

Suggestions?

Thks

BTW, I'm using 3.3v and have the RST pin connected
 
I'm getting this error when flashing on Linux:

Code:
Address 4000 is out of range at line 1

when using "compile_and_flash_20.sh"

Code:
Do you want to flash the motor ? [Y/n]Y
sudo stm8flash -c stlinkv2 -p stm8s105?6 -w data_empty.ihx
Determine FLASH area
STLink: v2, JTAG: v29, SWIM: v7, VID: 8304, PID: 4837
Due to its file extension (or lack thereof), "data_empty.ihx" is considered as INTEL HEX format!
Address 4000 is out of range at line 1
make: *** [Makefile:112: clear_eeprom] Error 255

I'm able to read and write with these commands:

Code:
stm8flash -c stlinkv2 -p "stm8s105?6" -r TSDZ2_orig.bin
stm8flash -c stlinkv2 -p "stm8s105?6" -w TSDZ2_orig.bin

I followed the instructions on the "Flash the firmware on TSDZ2" wiki, but did not perform the "Erase protection" step:

Code:
echo "00 00 ff 20 df 00 ff 00 ff 00 ff 00 ff 00 ff" | xxd -r -p > option_bytes_pwm_n_channels_enabled.bin
stm8flash -c stlinkv2 -p stm8s105?6 -s opt -w option_bytes_pwm_n_channels_enabled.bin

Suggestions?

Thks

BTW, I'm using 3.3v and have the RST pin connected
don't you have to remove the protection in order to write in those sectors? I remember in some other projects I was fighting with removing writing protections to write to some sectors.
 
From the wiki you followed these linux instructions?
The one on the Readme.md says to use the supplied script:
Code:
compile_and_flash_20.sh

That script executes:

Code:
# Flash new firmware
if [ "$flash" = "yes" ]; then
    make clear_eeprom
    make flash
fi

The OS X and Linux installation wiki you mention doesn't do the
Code:
clear_eeprom
on step 9.

So I flashed main.ihx only and it works

This is
Code:
clear_eeprom:
    sudo stm8flash -c stlinkv2 -p stm8s105?6 -w data_empty.ihx

Does anyone have the same error at that step?

don't you have to remove the protection in order to write in those sectors? I remember in some other projects I was fighting with removing writing protections to write to some sectors.
I'm not sure about that step. I saw this TSDZ2 OSF for all displays, VLCD5-VLCD6-XH18, LCD3, 860C-850C-SW102., so I skipped it.

Do I need to do the "Erase protection" step first for the "clear_eeprom" to work?
 
Last edited:
I am not sure so maybe wait for some other answers.

BTW: How is the work going for TMP36 temp sensor?
I saw your previous posts about it @mbrusa , do I only need to uncomment that line in 860C display code and recompile? Does the motor firmware already supports it? How about other non 860C displays? Can it be reconfigured in java configurator? I am little worried about the accuracy of TMP36 but I guess 2C is ok margin for this use?

LM35 is nowhere to be bought anymore except shady chinease sources
 
Last edited:
Support for TMP36 has been around for some time.
The same for other modifications.
Before releasing the new version I wanted to add other improvements, unfortunately in the summer I don't have the time to continue, I will resume in the autumn.

Here is the new version for 860C with the changes already made.

TSDZ2 Open Source Firmware v20.1C.4 update 3 for 860C display
1 - Anti-tampering measure.
Added password to parameters regarding speed limit, motor power, use of throttle and cruise.
2 - Startup assist. Added speed limit to 6 km/h.
3 - Choice of temperature sensor, LM35 or TMP36.
4 - Choice of brake input, brake sensors or on/off thermostat (NO max 85°C).
5 - Choosing how to use the throttle.
6 - Choosing how to use the cruise.
7 - Added motor overcurrent check (by mspider65), e7 Overcurrent error.
8 - Added throttle input check on power up, e5 Throttle fault.

I will update GitHub as soon as possible.
 

Attachments

  • TSDZ2-v20.1C.4-860C-3..zip
    473.1 KB · Views: 5
Support for TMP36 has been around for some time.
The same for other modifications.
Before releasing the new version I wanted to add other improvements, unfortunately in the summer I don't have the time to continue, I will resume in the autumn.

Here is the new version for 860C with the changes already made.

TSDZ2 Open Source Firmware v20.1C.4 update 3 for 860C display
1 - Anti-tampering measure.
Added password to parameters regarding speed limit, motor power, use of throttle and cruise.
2 - Startup assist. Added speed limit to 6 km/h.
3 - Choice of temperature sensor, LM35 or TMP36.
4 - Choice of brake input, brake sensors or on/off thermostat (NO max 85°C).
5 - Choosing how to use the throttle.
6 - Choosing how to use the cruise.
7 - Added motor overcurrent check (by mspider65), e7 Overcurrent error.
8 - Added throttle input check on power up, e5 Throttle fault.

I will update GitHub as soon as possible.

I would love to help with development but I am not the best with C ;)
We all understand that this is opensource project and that you prioritize other stuff over this. We are really grateful that you are doing and maintain the project in your free time! Really big thanks!

So this change is only for display (860C) firmware regarding the TMP36? Does the motor controller need some changes too or this saves the config data in controller which is already translated in units? Out of curiosity, how this can be handled in none 860C bikes? Can this be somehow configured before flashing? I have actually found source of LM35 now locally so I am good. Building 2 bikes but only one will have 860C.
 
I tried to use this nice OSF (update-2) with DZ40-Display (tdsz2-Version by enerprof) without luck. The display starts with 00 (speed) and blinking first battery bar. after some seconds it switches to "error 30" (communication problem).

I've read about similar problems with DZ41 and tried the fix using the older firmware version (copied 2 files changes_v20.1C.2-update-1_for_5_levels_20220918.zip to "SDZ2-Smart-EBike-1-20.1C.2/src/controller"+ vlcd5 in Javaconfigurator).

Nothing changed. Still the same Problem. Did I miss a step?

I would be very grateful for any help.
 
I would love to help with development but I am not the best with C ;)
We all understand that this is opensource project and that you prioritize other stuff over this. We are really grateful that you are doing and maintain the project in your free time! Really big thanks!

So this change is only for display (860C) firmware regarding the TMP36? Does the motor controller need some changes too or this saves the config data in controller which is already translated in units? Out of curiosity, how this can be handled in none 860C bikes? Can this be somehow configured before flashing? I have actually found source of LM35 now locally so I am good. Building 2 bikes but only one will have 860C.
The changes listed, including TMP36 support, are for the 860C version only.
It is necessary to flash the display and controller.
With 860C the configuration of all the parameters, including the choice of the type of temperature sensor, is done on the display.
 
I tried to use this nice OSF (update-2) with DZ40-Display (tdsz2-Version by enerprof) without luck. The display starts with 00 (speed) and blinking first battery bar. after some seconds it switches to "error 30" (communication problem).

I've read about similar problems with DZ41 and tried the fix using the older firmware version (copied 2 files changes_v20.1C.2-update-1_for_5_levels_20220918.zip to "SDZ2-Smart-EBike-1-20.1C.2/src/controller"+ vlcd5 in Javaconfigurator).

Nothing changed. Still the same Problem. Did I miss a step?

I would be very grateful for any help.
It's hard to make assumptions.
Does the display work with the stock firmware version?
 
Hi All,

I successfully flashed my TSDZ2 with the v20.1C.2 update 2 FW, I have the 850c display, is it possible to flash this with this firmware ? and if so where do I get the dispalay FE with instructions ?

Currently I have 4 modes as set with the java configurator but there's 5 modes on the display.

Thanks.
 
Hi All,

I successfully flashed my TSDZ2 with the v20.1C.2 update 2 FW, I have the 850c display, is it possible to flash this with this firmware ? ...
You have already succesfully flashed the controller and you can use the 850C now?
If so, then this 850C can't be flashed. It is already pre configured for Tongsheng protocol.

If you read back you will find one assist mode is disabled for it. (by the 850C checkbox)
This because stock display's like vlcd5 etc. have 4 assist modes.

I know also that for DZ41 is a patch to support 5 modes, but no guarantee that this works too for 850C
 
You have already succesfully flashed the controller and you can use the 850C now?
If so, then this 850C can't be flashed. It is already pre configured for Tongsheng protocol.

If you read back you will find one assist mode is disabled for it. (by the 850C checkbox)
This because stock display's like vlcd5 etc. have 4 assist modes.

I know also that for DZ41 is a patch to support 5 modes, but no guarantee that this works too for 850C
Thanks for the reply, so if I change the display to only give me 4 modes will this work fine with the new FW ? I suppose that's all I really need anyway and battery + speed.

Where's the best place to get the 860 display and can it be flashed like the controller or has it to be done a different way ?

Thanks again.
 
You have already succesfully flashed the controller and you can use the 850C now?
If so, then this 850C can't be flashed. It is already pre configured for Tongsheng protocol.

If you read back you will find one assist mode is disabled for it. (by the 850C checkbox)
This because stock display's like vlcd5 etc. have 4 assist modes.

I know also that for DZ41 is a patch to support 5 modes, but no guarantee that this works too for 850C
Hi Elinx.
In the latest version (v20.1C.2 2), the 5 levels are always supported regardless of the type of display.
If the fifth level request arrives from the display (between 0 and 1), OSF adapts automatically.
 
Hi mbrusa, your OSF distro has been working great on my commuter for the past year.

I recently replaced my AAA powered rear light with a new one powered through the motor system. I selected a flashing light mode and found only the front light flashing rear steady. 😅 Is it possible to select in the firmware which light is the rear?
 
There is only one lights output, so if you choose flashing, it flashes both front and rear.
If the rear light does not flash, it is because you have used a dynamo light, which has a reserve of power to stay on for a few minutes when the bike is stationary.
 
Back
Top